Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

도움말의 특수 규칙 -> 어인정 메뉴에서 사용 가능한 단어 그룹이 제대로 표시되지 않는 현상 (L#theme_) 해결 #985

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Server/lib/sub/webinit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ var Language = {
'en_US': require("../Web/lang/en_US.json")
};

for(let lang in Language) updateThemes(lang);

function updateThemes(lang){
Language[lang].themes = {};
for(let j in Language[lang].kkutu)
if(j.includes("theme_"))
Language[lang].themes[j] = Language[lang].kkutu[j];
}
function updateLanguage(){
var i, src;

Expand All @@ -31,6 +39,8 @@ function updateLanguage(){

delete require.cache[require.resolve(src)];
Language[i] = require(src);

updateThemes(i);
}
}
function getLanguage(locale, page, shop){
Expand All @@ -41,6 +51,7 @@ function getLanguage(locale, page, shop){
for(i in L.GLOBAL) R[i] = L.GLOBAL[i];
if(shop) for(i in L.SHOP) R[i] = L.SHOP[i];
for(i in L[page]) R[i] = L[page][i];
if(page == "help") Object.assign(R, L.themes);
if(R['title']) R['title'] = `[${process.env['KKT_SV_NAME']}] ${R['title']}`;

return R;
Expand Down