Skip to content

Commit 30c7e6d

Browse files
committed
[#2107] Fix Safari bug cause by unsupported lookbehind assertion
1 parent 31eca8b commit 30c7e6d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

client/app/libs/i18n/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ export const I18n = {
2121
t: (scope: string, options?: Options): string => {
2222
const locale = Cookies.get('locale') || 'en';
2323
let result = translations[locale][scope] || missingResult(locale, scope);
24-
const resultOptions = result.match(/(?<={).*?(?=})/g);
24+
const resultOptions = result.match(/\{(.*?)\}/g);
2525
if (resultOptions) {
2626
resultOptions.forEach((option: string) => {
27-
result = result.replaceAll(`{${option}}`, getValue(options, option));
27+
const optionKey = option.replace('{', '').replace('}', '');
28+
result = result.replaceAll(option, getValue(options, optionKey));
2829
});
2930
}
3031
return result;

0 commit comments

Comments
 (0)