微信小程序发布试用版本
This commit is contained in:
38
unpackage/dist/dev/mp-weixin/lang/i18n.js
vendored
38
unpackage/dist/dev/mp-weixin/lang/i18n.js
vendored
@@ -55,22 +55,40 @@ if (i18nEnable) {
|
||||
`);
|
||||
let initLanguageAfter = () => {
|
||||
function $i18n(e) {
|
||||
return i18n.global.messages[i18n.global.locale][e];
|
||||
try {
|
||||
if (i18n && i18n.global && i18n.global.messages && i18n.global.locale) {
|
||||
return i18n.global.messages[i18n.global.locale][e];
|
||||
}
|
||||
if (i18n && i18n.messages && i18n.locale) {
|
||||
return i18n.messages[i18n.locale][e];
|
||||
}
|
||||
return "";
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at lang/i18n.js:86", "[i18n] 获取翻译文本失败:", error);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
setTimeout(function() {
|
||||
$i18n("tabbar").split(",").forEach((text, index) => {
|
||||
common_vendor.index.setTabBarItem({
|
||||
index,
|
||||
text,
|
||||
complete: () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
try {
|
||||
const tabbarText = $i18n("tabbar");
|
||||
if (tabbarText) {
|
||||
tabbarText.split(",").forEach((text, index) => {
|
||||
common_vendor.index.setTabBarItem({
|
||||
index,
|
||||
text,
|
||||
complete: () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at lang/i18n.js:104", "[i18n] 更新 tabbar 失败:", error);
|
||||
}
|
||||
}, 1);
|
||||
};
|
||||
initLanguageAfter();
|
||||
common_vendor.index.$on("changeLanguage", (e) => {
|
||||
common_vendor.index.__f__("log", "at lang/i18n.js:90", "changeLanguage", e);
|
||||
common_vendor.index.__f__("log", "at lang/i18n.js:110", "changeLanguage", e);
|
||||
initLanguageAfter();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user