Add translation

This commit is contained in:
月月
2024-09-16 16:40:54 +08:00
parent 73334862c6
commit 69adcbbda5
20 changed files with 312 additions and 123 deletions
+1 -2
View File
@@ -37,7 +37,7 @@ async function loadLanguage(lang) {
// Get translation, if no corresponding value, return the key
function getString(key) {
if (!translations[currentLanguage]?.[key]) {
if (!translations[currentLanguage]?.[key] && key) {
console.log('Not found:' + key);
}
return translations[currentLanguage]?.[key] || key;
@@ -48,7 +48,6 @@ function init() {
try {
loadLanguage(currentLanguage);
console.log("初始化完成");
} catch (error) {
console.error('Failed to initialize default language:', error);
}