Skip to content

Commit

Permalink
Add to18n function to options page
Browse files Browse the repository at this point in the history
  • Loading branch information
bijij committed Jan 1, 2022
1 parent 0c512d0 commit 0a99cc4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
let defaultOptions;
let options;

function toI18n(str) {
return str.replace(/__MSG_(\w+)__/g, function (match, v1) {
return v1 ? chrome.i18n.getMessage(v1) : '';
});
}

// Load options from storage
const load = function () {
return new Promise(function (resolve) {
Expand Down Expand Up @@ -96,7 +102,7 @@ const update_context_menu = function (enabled) {
} else {
chrome.contextMenus.remove('ViewImage-SearchByImage');
}
}
};

// On change, save
document.addEventListener('change', event => {
Expand Down

0 comments on commit 0a99cc4

Please sign in to comment.