Skip to content

Commit

Permalink
* core: fix setLangCode not work when lang code includes "-".
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Apr 10, 2024
1 parent 355f193 commit 702fab8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core/src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getLangCode() {
}

export function setLangCode(langCode: I18nLangCode) {
globalLangCode = langCode.toLowerCase();
globalLangCode = langCode.toLowerCase().replace('-', '_');
}

export function addI18nMap(map: I18nLangMap): void;
Expand Down Expand Up @@ -74,3 +74,4 @@ i18n.addLang = addI18nMap;
i18n.getLang = getLang;
i18n.getCode = getLangCode;
i18n.setCode = setLangCode;
i18n.map = globalLangMap;

0 comments on commit 702fab8

Please sign in to comment.