Skip to content

Commit

Permalink
Updated i18n as per SearchWidget placeholder message
Browse files Browse the repository at this point in the history
  • Loading branch information
kabir-afk committed Jun 5, 2024
1 parent c01b133 commit 2a8bb61
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ var browser = (browserType === 'firefox') ? browser : (browserType === 'chrome')
// which fetches the messages from sourceMap and replpace them with whatever the key-value pair
// for that particular message is

banana = {i18n: msg => sourceMap.get(resArr[1])[msg]};
banana = {i18n: (msg,argument) => {
let string = sourceMap.get(resArr[1])[msg];
if ((/\$1/).test(string)) {
string = string.replace(/\$1/,argument);
}
return string;
}};
console.log("banana received: ",banana);
} else if (browserType === 'firefox') {
// Use Firefox WebExtensions API
Expand Down

0 comments on commit 2a8bb61

Please sign in to comment.