diff options
author | tg(x) <*@tg-x.net> | 2016-02-23 14:20:05 +0100 |
---|---|---|
committer | tg(x) <*@tg-x.net> | 2016-02-23 14:20:05 +0100 |
commit | b9d085b694eff488b6c98e899b32df27c7e48627 (patch) | |
tree | 73332eccd2fd224ce983796346bb3b9706a2e6cc /extension/lib | |
parent | 5591077fe9241def5fa33fc90a24681c8b7b0976 (diff) | |
download | wallet-core-b9d085b694eff488b6c98e899b32df27c7e48627.tar.xz |
Revert "revert incomplete i18n for now"
This reverts commit 86c57da86d9a8a6c30288273af41b5d676b41842.
Diffstat (limited to 'extension/lib')
-rw-r--r-- | extension/lib/i18n.ts | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/extension/lib/i18n.ts b/extension/lib/i18n.ts index 6ed8942b3..c23ab0740 100644 --- a/extension/lib/i18n.ts +++ b/extension/lib/i18n.ts @@ -17,10 +17,22 @@ declare var i18n: any; var i18n = <any>function i18n(strings, ...values) { - // TODO: actually look up translation - return String.raw(strings, ...values); + i18n['init'](); + //console.log('i18n:', ...strings, ...values) + return i18n['jed'].translate(strings[0]).fetch(...values); + //return String.raw(strings, ...values); }; +i18n.lang = chrome.i18n.getUILanguage(); +i18n.jed = null; +i18n.strings = {}; + +i18n.init = function() { + if (null == i18n.jed) { + i18n.jed = new window['Jed'] (i18n.strings[i18n.lang]); + } +} + // Interpolate i8nized values with arbitrary objects and // return array of strings/objects. i18n.parts = function(strings, ...values) { @@ -35,4 +47,3 @@ i18n.parts = function(strings, ...values) { return parts; }; - |