@zeesoft/i18n-verify 3.2.3 → 3.2.5
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/dist/executor.mjs +8 -3
- package/package.json +1 -1
package/dist/executor.mjs
CHANGED
|
@@ -5763,6 +5763,7 @@ class BaseValidator {
|
|
|
5763
5763
|
}
|
|
5764
5764
|
#getCompatibleLocale(locale) {
|
|
5765
5765
|
if (this.isQaLocale()) {
|
|
5766
|
+
Logger.warn(`Detected QA lcoale so defaulting to 'en'.`);
|
|
5766
5767
|
return "en";
|
|
5767
5768
|
}
|
|
5768
5769
|
locale = locale.replace(/[-_ ]/g, "-");
|
|
@@ -5772,10 +5773,14 @@ class BaseValidator {
|
|
|
5772
5773
|
suitableLocale = locale;
|
|
5773
5774
|
} else {
|
|
5774
5775
|
const temp = locale.split("-")[0];
|
|
5775
|
-
|
|
5776
|
-
|
|
5776
|
+
const firstMatch = locales.find((l) => l.startsWith(temp));
|
|
5777
|
+
if (firstMatch) {
|
|
5778
|
+
suitableLocale = firstMatch;
|
|
5777
5779
|
} else {
|
|
5778
|
-
|
|
5780
|
+
Logger.warn(
|
|
5781
|
+
`No suitable locale found for ${locale}. Defaulting to 'en'.`
|
|
5782
|
+
);
|
|
5783
|
+
suitableLocale = "en";
|
|
5779
5784
|
}
|
|
5780
5785
|
}
|
|
5781
5786
|
return suitableLocale;
|
package/package.json
CHANGED