Skip to content

Commit 4a5ee36

Browse files
committed
web: Check if custom Map is defined as fluent loop is iterating
1 parent f9681a2 commit 4a5ee36

File tree

1 file changed

+2
-1
lines changed
  • web/packages/core/src/internal

1 file changed

+2
-1
lines changed

web/packages/core/src/internal/i18n.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ const bundles: Record<string, FluentBundle> = {};
2121
for (const [locale, files] of Object.entries(BUNDLED_TEXTS)) {
2222
const bundle = new FluentBundle(locale);
2323
if (files) {
24-
const customMap = resetCustomMap();
24+
let customMap: typeof Map | undefined = undefined;
2525
for (const [filename, text] of Object.entries(files)) {
2626
if (text) {
27+
customMap ??= resetCustomMap();
2728
for (const error of bundle.addResource(
2829
new FluentResource(text),
2930
)) {

0 commit comments

Comments
 (0)