Merge pull request #1860 from syuilo/i18n-msg-patch

Update warning message for missing locale
This commit is contained in:
syuilo 2018-07-08 04:37:09 +09:00 committed by GitHub
commit 0025f3b526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ export default class Replacer {
if (text.hasOwnProperty(path)) {
text = text[path];
} else {
console.warn(`path '${path}' not found in '${this.lang}'`);
if (this.lang === 'ja') console.warn(`path '${path}' not found`);
return key; // Fallback
}
}
@ -46,10 +46,10 @@ export default class Replacer {
});
if (error) {
console.warn(`key '${key}' not found in '${path}' of '${this.lang}'`);
if (this.lang === 'ja') console.warn(`key '${key}' not found in '${path}'`);
return key; // Fallback
} else if (typeof text !== 'string') {
console.warn(`key '${key}' is not string in '${path}' of '${this.lang}'`);
if (this.lang === 'ja') console.warn(`key '${key}' is not string in '${path}'`);
return key; // Fallback
} else {
return text;