微信小程序发布试用版本

This commit is contained in:
zhonghua1
2026-01-31 21:10:40 +08:00
parent 4ebeec45bc
commit 80d6d46182
338 changed files with 5767 additions and 6091 deletions

View File

@@ -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();
});
}