mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
ELECTRON-536: add missing translation strings (#408)
- add missing translations - fix macOS menu load issues.
This commit is contained in:
committed by
GitHub
parent
33f31fc507
commit
4fa422c19f
@@ -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 = {}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user