Fix: lang selector

This commit is contained in:
Cutls 2019-10-05 03:50:49 +09:00
parent 9bb066596c
commit cb6a75de3b
2 changed files with 4 additions and 4 deletions

View File

@ -10,8 +10,8 @@ if (process.argv.indexOf("--automatic") === -1) {
} }
} }
console.log("Constructing view files " + ver + ": make sure to update package.json") console.log("Constructing view files " + ver + ": make sure to update package.json")
const langs = ["ja", "en", "ps", "bg", "cs", "de", "es-AR"] const langs = ["ja", "en", "bg", "cs", "de", "es-AR", "ps"]
const langsh = ["日本語", "English", "Crowdin translate system(beta)", "български", "Česky", "Deutsch", "Spanish, Argentina"] const langsh = ["日本語", "English", "български", "Česky", "Deutsch", "Spanish, Argentina", "Crowdin translate system(beta)"]
const simples = ["acct", "index", "setting", "update", "setting"] const simples = ["acct", "index", "setting", "update", "setting"]
const samples = ["acct.sample.html", "index.sample.html", "setting.sample.html", "update.sample.html", "setting.sample.js"] const samples = ["acct.sample.html", "index.sample.html", "setting.sample.html", "update.sample.html", "setting.sample.js"]
const pages = ["acct.html", "index.html", "setting.html", "update.html", "setting.vue.js"] const pages = ["acct.html", "index.html", "setting.html", "update.html", "setting.vue.js"]
@ -23,7 +23,7 @@ for (let n = 0; n < langs.length; n++) {
if (!fs.existsSync(targetDir)) { if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir); fs.mkdirSync(targetDir);
} }
langstr = langstr + '<a onclick="changelang(\'' + lang + '\')" class="pointer" style="margin-right:5px;">' + langsh[n] + '</a>' langstr = langstr + '<a onclick="changelang(\'' + lang + '\')" class="pointer" style="margin:4px;border: 1px solid var(--color); padding: 3px">' + langsh[n] + '</a>'
fs.writeFileSync("../" + lang + "/main.js", fs.readFileSync("language/" + lang + "/main.json", 'utf8').replace(/^{/, "var lang = {")) fs.writeFileSync("../" + lang + "/main.js", fs.readFileSync("language/" + lang + "/main.json", 'utf8').replace(/^{/, "var lang = {"))
} }
for (let i = 0; i < samples.length; i++) { for (let i = 0; i < samples.length; i++) {

View File

@ -46,7 +46,7 @@
</div> </div>
<div class="collapsible-body"> <div class="collapsible-body">
<h5>@@setlang@@</h5> <h5>@@setlang@@</h5>
To translate with Crowdin, you have to login Crowdin and restart TheDesk when login is finished.<br> To translate with Crowdin, you have to login Crowdin and restart TheDesk when login is finished.<br><br>
@@langlist@@ @@langlist@@
<h5>@@backup@@</h5> <h5>@@backup@@</h5>
<button onclick="exportSettings()" class="btn waves-effect lime darken-3" <button onclick="exportSettings()" class="btn waves-effect lime darken-3"