@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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.3
4
+
5
+ - Fixed a bug where regional locales stopped working
6
+
3
7
  ## 3.0.2
4
8
 
5
9
  - Fixed a parsing bug in extended language codes [#16](https://github.com/shoelace-style/localize/issues/16)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoelace-style/localize",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "A micro library for localizing custom elements using Lit's Reactive Controller model.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
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