@shoelace-style/localize 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ export class LocalizeController {
|
|
|
54
54
|
const locale = new Intl.Locale(this.lang());
|
|
55
55
|
const language = locale === null || locale === void 0 ? void 0 : locale.language.toLowerCase();
|
|
56
56
|
const region = (_b = (_a = locale === null || locale === void 0 ? void 0 : locale.region) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '';
|
|
57
|
-
const primary = translations.get(region);
|
|
57
|
+
const primary = translations.get(`${language}-${region}`);
|
|
58
58
|
const secondary = translations.get(language);
|
|
59
59
|
let term;
|
|
60
60
|
if (primary && primary[key]) {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -119,7 +119,7 @@ export class LocalizeController<UserTranslation extends Translation = DefaultTra
|
|
|
119
119
|
const locale = new Intl.Locale(this.lang());
|
|
120
120
|
const language = locale?.language.toLowerCase();
|
|
121
121
|
const region = locale?.region?.toLowerCase() ?? '';
|
|
122
|
-
const primary = <UserTranslation>translations.get(region);
|
|
122
|
+
const primary = <UserTranslation>translations.get(`${language}-${region}`);
|
|
123
123
|
const secondary = <UserTranslation>translations.get(language);
|
|
124
124
|
let term: any;
|
|
125
125
|
|