Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
switch to camelCase for var 'lang_code' (#1736)
Browse files Browse the repository at this point in the history
  • Loading branch information
luclu authored and evertonfraga committed Mar 15, 2017
1 parent 0169627 commit 2f1db5e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions modules/menuItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,23 +245,23 @@ let menuTempl = function (webviews) {
],
});

const genSwitchLanguageFunc = lang_code => function (menuItem, browserWindow) {
const genSwitchLanguageFunc = langCode => function (menuItem, browserWindow) {
browserWindow.webContents.executeJavaScript(
`TAPi18n.setLanguage("${lang_code}");`
`TAPi18n.setLanguage("${langCode}");`
);
ipc.emit('backendAction_setLanguage', {}, lang_code);
ipc.emit('backendAction_setLanguage', {}, langCode);
};
const currentLanguage = i18n.getBestMatchedLangCode(global.language);

const languageMenu =
Object.keys(i18n.options.resources)
.filter(lang_code => lang_code !== 'dev')
.map((lang_code) => {
menuItem = {
label: i18n.t(`mist.applicationMenu.view.langCodes.${lang_code}`),
.filter(langCode => langCode !== 'dev')
.map((langCode) => {
const menuItem = {
label: i18n.t(`mist.applicationMenu.view.langCodes.${langCode}`),
type: 'checkbox',
checked: (currentLanguage === lang_code),
click: genSwitchLanguageFunc(lang_code),
checked: (currentLanguage === langCode),
click: genSwitchLanguageFunc(langCode),
};
return menuItem;
});
Expand Down

0 comments on commit 2f1db5e

Please sign in to comment.