Modify localization to allow including parameters in HTML

E.g i18n-title=key;param (single param only)
This commit is contained in:
Rob Garrison 2018-12-02 20:32:18 -06:00
parent d379e5f34a
commit 9a314523f6

View File

@ -7,6 +7,9 @@ tDocLoader();
function t(key, params) { function t(key, params) {
if (!params && key.includes(';')) {
[key, params] = key.split(';');
}
const cache = !params && t.cache[key]; const cache = !params && t.cache[key];
const s = cache || chrome.i18n.getMessage(key, params); const s = cache || chrome.i18n.getMessage(key, params);
if (s === '') { if (s === '') {