-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fixed #553, adding setting to change UI language #813
fixed #553, adding setting to change UI language #813
Conversation
click: function(){ | ||
let mainWindow = Windows.getByType('main'); | ||
mainWindow.webContents.executeJavaScript( | ||
`TAPi18n.setLanguage("${lang_code}");` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would need to call ipc.send('backendAction_setLanguage', lang_code);
after this line. This should change the menu language
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hint, @frozeman. However I failed calling ipc.send
both in menuItem.js
and in webpage.
First attempt:
click: function(){
let mainWindow = Windows.getByType('main');
mainWindow.webContents.executeJavaScript(
`TAPi18n.setLanguage('${lang_code}');`
);
ipc.send('backendAction_setLanguage', lang_code);
}
which gives
TypeError: ipc.send is not a function
at menuItem.click (/home/chihchengliang/ether/mist/modules/menuItems.js:444:21)
at MenuItem.click (/home/chihchengliang/npm-global/lib/node_modules/electron-prebuilt/dist/resources/electron.asar/browser/api/menu-item.js:81:16)
at Function.delegate.executeCommand (/home/chihchengliang/npm-global/lib/node_modules/electron-prebuilt/dist/resources/electron.asar/browser/api/menu.js:119:40)
in electron console and crashed. Checked the doc, ipcMain
has no function send
. It seems I can't send from main process.
Seeing ipc.send can be called from popWindow, I also tried sending from the webpage:
mainWindow.webContents.executeJavaScript(
`TAPi18n.setLanguage('${lang_code}');
ipc.send('backendAction_setLanguage', '${lang_code}');`
);
which throws Uncaught ReferenceError: ipc is not defined
in browser console.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since ipcMain
is an eventsEmitter
class, the event can be triggered via emit
function from ipc
instance. e.g.
ipc.emit('backendAction_setLanguage', {}, lang_code);
see doc for more detail.
Concerning the menu, i think |
Yep, sounds good to me. On 14 June 2016 at 18:37:07, Fabian Vogelsteller (notifications@github.com) wrote: Concerning the menu, i think view is better suitable for that. What you think @alexvandesande @hiddentao ? — |
Language switching works, though for some languages (e.g. |
@hiddentao It seems Korean the language code is "ko", not "kr", |
hi @hiddentao , |
I made PR for changing Korean code from kr to ko |
One of my language codes is set at "Dev" which is not functional. Also there should be a first item called "auto" that reverts back to the default |
069bb1e
to
ba649b2
Compare
hi @alexvandesande , the |
hi, in case anyone get confused, the required feature in this PR is completely implemented and ready for review. Let me know if anything need to modified or improved. Thanks :) |
Let me clean up the lang codes today. ;) update: done - #889. It would be great to get rid of the wallet-requirement so this won't cause trouble with Mist-users - @alexvandesande {edit: "what do you think"}?
|
I've done some work on this PR too but couldn't have it uploaded due to the other urgent issues. Will upload the changes as soon as I can. Btw: clicking on "auto" does nothing for me
|
hi, @alexvandesande : the |
I included these changes here: #896 |
* bump version to 0.7.6 * updated os timesync * adding setting to change UI language (fixes #813) (#896) * simple language setting menu * use i18n label in menu * simple language setting menu * use i18n label in menu * change language of menu bar by triggering 'backendAction_setLanguage' * adds translations for language names * remove duplicate 'gulp update-nodes' (#897) * add i18n entry for OSX's 'Services' (#887) * add i18n entry for OSX's 'Services' * update missing osx menu strings * update-popup-window: prevent maximize (#885) * update-popup-window prevent maximize * add resizable:false * added shrinkwrap (#903) * fixed webview tagd and updated electrong to 1.2.5 (#905) * Fixes the node start IPC connection (#841) * fixed eth start, but crash is not graceful * better socket connection logic, remove master ps logic for eth * fix splash screen display of state text for eth * better gulp download plugin, remove master passwd stuff once and for all * Adds Toggle password visibility to on boarding screen (#909) * add password visibilty toggle to onboarding * replaced 'showPassword' with 'passwordInputType' * changed id into class * 18n cleanup (former #889) (#910) * Renamed Korean and Albanian to ISO standards * Added menu items to set to Dutch, Farsi, Albanian and Italian (these three are rather incomplete) * changed log error to warn * fixed ipcBackend notifications * Fixing wallet tab insertion (#911) * small cleanup * added admin:true permission * removed webview duplicate * Fully automated UI testing (#788) * got app launching via test * work towards testing - private net integration * change how we name options to pass directly to geth, so that test suite works * refactor preloader scripts * cleanly quitting the app at the end of tests * trying to get electron working properly, upgrade to 1.2.2 * upgrade spectron * work towards getting tests to work * dont use NODE_ENV var as Meteor production uses it * fixed eth start, but crash is not graceful * better socket connection logic, remove master ps logic for eth * fix splash screen display of state text for eth * better gulp download plugin, remove master passwd stuff once and for all * got basic test working * update travis build * trigger build * update readme, travis * fix gulp-download-stream use * fix build command * testing account creation * added account creation test * only do a shallow clone * final deposit test * should be able to find geth executable now * adds the wallet as the default tab (#924) * Text updates Fix typos and make writing more clear and accurate * Capitalization consistency * adds the wallet as the default tab * always upsert * Update version to 0.8 (#930) * update to 0.8 * fixes menu margin clipping * remove comma * fix ipcpath bug
* bump version to 0.7.6 * updated os timesync * adding setting to change UI language (fixes #813) (#896) * simple language setting menu * use i18n label in menu * simple language setting menu * use i18n label in menu * change language of menu bar by triggering 'backendAction_setLanguage' * adds translations for language names * remove duplicate 'gulp update-nodes' (#897) * add i18n entry for OSX's 'Services' (#887) * add i18n entry for OSX's 'Services' * update missing osx menu strings * update-popup-window: prevent maximize (#885) * update-popup-window prevent maximize * add resizable:false * added shrinkwrap (#903) * fixed webview tagd and updated electrong to 1.2.5 (#905) * Fixes the node start IPC connection (#841) * fixed eth start, but crash is not graceful * better socket connection logic, remove master ps logic for eth * fix splash screen display of state text for eth * better gulp download plugin, remove master passwd stuff once and for all * Adds Toggle password visibility to on boarding screen (#909) * add password visibilty toggle to onboarding * replaced 'showPassword' with 'passwordInputType' * changed id into class * 18n cleanup (former #889) (#910) * Renamed Korean and Albanian to ISO standards * Added menu items to set to Dutch, Farsi, Albanian and Italian (these three are rather incomplete) * changed log error to warn * fixed ipcBackend notifications * Fixing wallet tab insertion (#911) * small cleanup * added admin:true permission * removed webview duplicate * Fully automated UI testing (#788) * got app launching via test * work towards testing - private net integration * change how we name options to pass directly to geth, so that test suite works * refactor preloader scripts * cleanly quitting the app at the end of tests * trying to get electron working properly, upgrade to 1.2.2 * upgrade spectron * work towards getting tests to work * dont use NODE_ENV var as Meteor production uses it * fixed eth start, but crash is not graceful * better socket connection logic, remove master ps logic for eth * fix splash screen display of state text for eth * better gulp download plugin, remove master passwd stuff once and for all * got basic test working * update travis build * trigger build * update readme, travis * fix gulp-download-stream use * fix build command * testing account creation * added account creation test * only do a shallow clone * final deposit test * should be able to find geth executable now * adds the wallet as the default tab (#924) * Text updates Fix typos and make writing more clear and accurate * Capitalization consistency * adds the wallet as the default tab * always upsert * Update version to 0.8 (#930) * update to 0.8 * fixes menu margin clipping * remove comma * work towards new minimonogo sync * fix ipcpath bug * got basic persistence working * minor error * refactor sendTransaction error alerts (#959) * "Change language" translated in mist.nb.i18n.json (#953) "Change language" translated in mist.nb.i18n.json * timer delay on menu refreshing from tab updates * rename 'passwordError' to 'wrongPassword' for consistency (#951) * sync not specific to a window * refactor to enable access to mongo sync from all windows * update .meteor paths on .gitignore (#977) * DAO fork support (#970) * created DAO fork dummy code * text update * added node flags choice * changed DAO fork texts * disable eth-node switch until hardfork is supported (#975) * disable eth-node until hardfork is supported * remove test function * reworded the disclaimer link
Merging of Choose account popup #814 * Creating change account modals * connect popup * fixing typo * connect account popup * Straightens checkbox on connect account modal * Connect account popup interface * fixing scroll gradient on choose account popup * Informing account names on connect popup * Adding animations on account and dapp info * Improvements on connect popup * Tweaking URL breakdown to show arrows when necessary * Fixing edgy cases on breadcrumb * Removing browserBar interface * Removing browser bar fold-down element * Vertical flexbox - window stretches appropriately * Popup updates * change dapp style and icon (#1) * more working code * Reload permissions and code cleaning * Website placeholder icon * Cleaning code * Unpin tab * Not showing remove button on wallet tab * Merge Hard Fork choice - Mist into master (#979) * bump version to 0.7.6 * updated os timesync * adding setting to change UI language (fixes #813) (#896) * simple language setting menu * use i18n label in menu * simple language setting menu * use i18n label in menu * change language of menu bar by triggering 'backendAction_setLanguage' * adds translations for language names * remove duplicate 'gulp update-nodes' (#897) * add i18n entry for OSX's 'Services' (#887) * add i18n entry for OSX's 'Services' * update missing osx menu strings * update-popup-window: prevent maximize (#885) * update-popup-window prevent maximize * add resizable:false * added shrinkwrap (#903) * fixed webview tagd and updated electrong to 1.2.5 (#905) * Fixes the node start IPC connection (#841) * fixed eth start, but crash is not graceful * better socket connection logic, remove master ps logic for eth * fix splash screen display of state text for eth * better gulp download plugin, remove master passwd stuff once and for all * Adds Toggle password visibility to on boarding screen (#909) * add password visibilty toggle to onboarding * replaced 'showPassword' with 'passwordInputType' * changed id into class * 18n cleanup (former #889) (#910) * Renamed Korean and Albanian to ISO standards * Added menu items to set to Dutch, Farsi, Albanian and Italian (these three are rather incomplete) * changed log error to warn * fixed ipcBackend notifications * Fixing wallet tab insertion (#911) * small cleanup * added admin:true permission * removed webview duplicate * Fully automated UI testing (#788) * got app launching via test * work towards testing - private net integration * change how we name options to pass directly to geth, so that test suite works * refactor preloader scripts * cleanly quitting the app at the end of tests * trying to get electron working properly, upgrade to 1.2.2 * upgrade spectron * work towards getting tests to work * dont use NODE_ENV var as Meteor production uses it * fixed eth start, but crash is not graceful * better socket connection logic, remove master ps logic for eth * fix splash screen display of state text for eth * better gulp download plugin, remove master passwd stuff once and for all * got basic test working * update travis build * trigger build * update readme, travis * fix gulp-download-stream use * fix build command * testing account creation * added account creation test * only do a shallow clone * final deposit test * should be able to find geth executable now * adds the wallet as the default tab (#924) * Text updates Fix typos and make writing more clear and accurate * Capitalization consistency * adds the wallet as the default tab * always upsert * Update version to 0.8 (#930) * update to 0.8 * fixes menu margin clipping * remove comma * work towards new minimonogo sync * fix ipcpath bug * got basic persistence working * minor error * refactor sendTransaction error alerts (#959) * "Change language" translated in mist.nb.i18n.json (#953) "Change language" translated in mist.nb.i18n.json * timer delay on menu refreshing from tab updates * rename 'passwordError' to 'wrongPassword' for consistency (#951) * sync not specific to a window * refactor to enable access to mongo sync from all windows * update .meteor paths on .gitignore (#977) * DAO fork support (#970) * created DAO fork dummy code * text update * added node flags choice * changed DAO fork texts * disable eth-node switch until hardfork is supported (#975) * disable eth-node until hardfork is supported * remove test function * reworded the disclaimer link * Syncing Tabs after account connection * Enable Tabs sync and persistence in all windows (#2) * sync not specific to a window * refactor to enable access to mongo sync from all windows * Pin/unpin Tabs * Adding show password on Create account popup * change remove button animation * add globe image as default non-icon
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Dear developers,
Thanks for the awesome project. To address #553 , I added a menu item "settings" that users can change languages in the wallet screen easily.
Note that the language of the app menu can't be changed with this feature, at the moment I can't figure out yet. Hints would be appreciated.
Warm regards,
Chih-Cheng
update:
successfully changed the language of the app menu.