ELECTRON-536: add missing translation strings (#408)

- add missing translations
- fix macOS menu load issues.
This commit is contained in:
Vishwas Shashidhar
2018-06-21 18:13:03 +05:30
committed by GitHub
parent 33f31fc507
commit 4fa422c19f
6 changed files with 57 additions and 14 deletions

View File

@@ -19,7 +19,16 @@ const getMessageFor = function(phrase) {
const setLanguage = function(lng) {
language = lng ? lng : 'en-US';
loadedTranslations = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'locale', language + '.json'), 'utf8'));
let file = path.join(__dirname, '..', '..', 'locale', language + '.json');
if (!fs.existsSync(file)) {
file = path.join(__dirname, '..', '..', 'locale', 'en-US.json');
}
let data = fs.readFileSync(file, 'utf8');
try {
loadedTranslations = JSON.parse(data);
} catch (e) {
loadedTranslations = {}
}
};
/**