This commit is contained in:
syuilo
2018-04-15 06:16:50 +09:00
parent d3b3a7fc4e
commit a53746e9d0
4 changed files with 12 additions and 9 deletions

View File

@ -63,6 +63,8 @@ export default class Replacer {
key = key.substr(1);
}
if (ctx && ctx.lang) this.lang = ctx.lang;
if (match[0] == '"') {
return '"' + this.get(name, key).replace(/"/g, '\\"') + '"';
} else if (match[0] == "'") {

View File

@ -31,11 +31,9 @@
// Detect the user language
// Note: The default language is Japanese
//let lang = navigator.language.split('-')[0];
//if (!/^(en|ja)$/.test(lang)) lang = 'ja';
//if (localStorage.getItem('lang')) lang = localStorage.getItem('lang');
//if (ENV != 'production') lang = 'ja';
const lang = 'ja';
let lang = navigator.language.split('-')[0];
if (!/^(en|ja)$/.test(lang)) lang = 'ja';
if (localStorage.getItem('lang')) lang = localStorage.getItem('lang');
// Detect the user agent
const ua = navigator.userAgent.toLowerCase();