mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 15:31:51 +08:00
load category strings in its own object instead of just overwriting everything
This commit is contained in:
parent
f66ef6417f
commit
41ddbb66a9
@ -1074,11 +1074,11 @@ var translations = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var categories = {}
|
var categories = {}
|
||||||
|
|
||||||
var allStrings = {}
|
var allStrings = {}
|
||||||
|
var categoryStrings = {}
|
||||||
|
|
||||||
function separateStrings(){
|
function separateStrings(){
|
||||||
let categoriesTemp = Object.assign({}, categories);
|
|
||||||
categories = {}
|
|
||||||
|
|
||||||
for(var j in languageList){
|
for(var j in languageList){
|
||||||
var lang = languageList[j]
|
var lang = languageList[j]
|
||||||
@ -1106,12 +1106,11 @@ function separateStrings(){
|
|||||||
translateObj(translations[i], i, str)
|
translateObj(translations[i], i, str)
|
||||||
}
|
}
|
||||||
|
|
||||||
categories[lang] = {
|
categoryStrings[lang] = {}
|
||||||
id: lang
|
var str = categoryStrings[lang]
|
||||||
}
|
|
||||||
var str = categories[lang]
|
for(var i in categories){
|
||||||
for(var i in categoriesTemp){
|
translateObj(categories[i], i, str)
|
||||||
translateObj(categoriesTemp[i], i, str)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,13 +78,13 @@ class Titlescreen{
|
|||||||
}
|
}
|
||||||
setLang(){
|
setLang(){
|
||||||
let stringLang = allStrings[settings.getItem("language")]
|
let stringLang = allStrings[settings.getItem("language")]
|
||||||
let categoryLang = categories[settings.getItem("language")]
|
let categoryLang = categoryStrings[settings.getItem("language")]
|
||||||
|
|
||||||
strings = stringLang
|
strings = stringLang
|
||||||
strings.categories = categoryLang
|
strings.categories = categoryLang
|
||||||
|
|
||||||
settings.setLang(stringLang, true, allStrings)
|
settings.setLang(stringLang, true, allStrings)
|
||||||
settings.setLang(categoryLang, true, categories)
|
settings.setLang(categoryLang, true, categoryStrings)
|
||||||
|
|
||||||
let boldFonts = strings.font === "Microsoft YaHei, sans-serif"
|
let boldFonts = strings.font === "Microsoft YaHei, sans-serif"
|
||||||
loader.screen.style.fontFamily = strings.font
|
loader.screen.style.fontFamily = strings.font
|
||||||
|
Loading…
Reference in New Issue
Block a user