Skip to content

Commit

Permalink
fix(translations): checked language at menu
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed May 17, 2018
1 parent 8cd1309 commit 520a359
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/background/menu/config_menu_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ export const settingsMenuTemplateFunc = (config, onLanguageChange) => ({
const translations = []
fs.readdirSync('translations').forEach(translation => {
const translationJson = JSON.parse(fs.readFileSync(`translations/${translation}`, 'utf8'))
const lang = path.basename(translation, '.json')
translations.push({
label: translationJson.nameOriginal,
type: 'checkbox',
checked: config.language === lang,
click: () => {
const lang = path.basename(translation, '.json')
BrowserWindow.getFocusedWindow().webContents.send('changeLanguage', lang)
config.language = lang
if(onLanguageChange)
Expand Down

0 comments on commit 520a359

Please sign in to comment.