Quick fix for i18n
Just use the english locale for now. Load locale data from the filesystem in the main process and pass it to the renderer preload script via ipc. Note that we need the locale data to be available by the time view scripts are loaded. // FREEBIE
This commit is contained in:
parent
88893079d2
commit
63657db3be
5 changed files with 51 additions and 12 deletions
|
@ -153,17 +153,19 @@
|
|||
};
|
||||
|
||||
// Translate
|
||||
window.i18n = function(message, substitutions) {
|
||||
if (window.chrome && chrome.i18n) {
|
||||
return chrome.i18n.getMessage(message, substitutions);
|
||||
}
|
||||
};
|
||||
i18n.getLocale = function() {
|
||||
if (window.chrome && chrome.i18n) {
|
||||
return chrome.i18n.getUILanguage();
|
||||
}
|
||||
return 'en';
|
||||
};
|
||||
|
||||
if (window.chrome && window.chrome.i18n) {
|
||||
window.i18n = function(message, substitutions) {
|
||||
return chrome.i18n.getMessage(message, substitutions);
|
||||
};
|
||||
|
||||
i18n.getLocale = function() {
|
||||
if (window.chrome && chrome.i18n) {
|
||||
return chrome.i18n.getUILanguage();
|
||||
}
|
||||
return 'en';
|
||||
};
|
||||
}
|
||||
|
||||
extension.install = function(mode) {
|
||||
if (mode === 'standalone') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue