We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31eca8b commit 30c7e6dCopy full SHA for 30c7e6d
client/app/libs/i18n/index.js
@@ -21,10 +21,11 @@ export const I18n = {
21
t: (scope: string, options?: Options): string => {
22
const locale = Cookies.get('locale') || 'en';
23
let result = translations[locale][scope] || missingResult(locale, scope);
24
- const resultOptions = result.match(/(?<={).*?(?=})/g);
+ const resultOptions = result.match(/\{(.*?)\}/g);
25
if (resultOptions) {
26
resultOptions.forEach((option: string) => {
27
- result = result.replaceAll(`{${option}}`, getValue(options, option));
+ const optionKey = option.replace('{', '').replace('}', '');
28
+ result = result.replaceAll(option, getValue(options, optionKey));
29
});
30
}
31
return result;
0 commit comments