Change the language locale for chrome.app?

532 Views Asked by At

My question, I want to change Target in Shortcut with JavaScript

Example
C:\Users\Administrator\Desktop\xxx\something.exe

become

C:\Users\Administrator\Desktop\xxx\something.exe --lang=zh

Reason:

I want to switch language for chrome app (zh means chinese)

I use nw.js which has locale en folder message.json and zh folder message.json

my app using google i18n. The problem is chrome.i18.getMessage is very easy to use but there is no method like chrome.i18n.setlocale(zh) (setting your language json file as chinese)

Thus, this gives me a huge difficulty in term of language switcher

there is a way is you create two short cut one short cut normal another shortcut change target as
C:\Users\Administrator\Desktop\xxx\something.exe --lang=zh

Then, when you open this short cut, your language will be the message.json in zh folder, which is chinese

what I want

i want there is a drop down list. when user select chinese, it closes app and open another short cut

or

one short cut. when the user selects Chinese it becomes Chinese. when the user selects English it becomes English

switch language is easy if you write your own i18n

but my boss asks me using chrome.i18n so it is very hard for me to switch locales

the only way to change the locale according google is

Change the shortcut's properties so that the Target field specifies the language. --lang and --user-data-dir flags. The target should look something like this:

path_to_chrome.exe --lang=locale --user-data-dir=c:\locale_profile_dir

what i can do to write a javascript to change the locale for chrome.app???

0

There are 0 best solutions below