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

switch to camelCase for var 'lang_code' #1736

Merged
merged 2 commits into from
Mar 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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