Skip to content

Commit

Permalink
fix: ensure locales don't use reserved JS names (#2885)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskelin committed Mar 2, 2021
1 parent 35de38c commit 05fc06e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/tools/lib/generate-json-imports/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ if (languages.length === 0) {
// There is i18n - generate the full file
} else {
// Keys for the array
const languagesKeysString = languages.map(key => `${key},`).join("\n\t");
const languagesKeysString = languages.map(key => `"${key}": _${key},`).join("\n\t");
const languagesKeysStringArray = languages.map(key => `"${key}",`).join("\n\t");

// Actual imports for json assets
const assetsImportsString = languages.map(key => `import ${key} from "../assets/i18n/messagebundle_${key}.json";`).join("\n");
const assetsImportsString = languages.map(key => `import _${key} from "../assets/i18n/messagebundle_${key}.json";`).join("\n");

// static imports
contentStatic = `import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
Expand Down

0 comments on commit 05fc06e

Please sign in to comment.