glotfox 0.1.2 → 0.1.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.
|
@@ -1145,9 +1145,11 @@ function digitRuns(s) {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
var escapeRe = (s) => s.replace(/[.*+?^$()|[\]\\{}]/g, "\\$&");
|
|
1147
1147
|
var containsTerm = (text, term) => new RegExp(`(?<![\\p{L}\\p{N}])${escapeRe(term)}(?![\\p{L}\\p{N}])`, "iu").test(text);
|
|
1148
|
+
var CATEGORY_ORDER = ["zero", "one", "two", "few", "many", "other"];
|
|
1148
1149
|
function requiredCategories(locale, type) {
|
|
1149
1150
|
try {
|
|
1150
|
-
|
|
1151
|
+
const categories = new Intl.PluralRules(locale, { type }).resolvedOptions().pluralCategories;
|
|
1152
|
+
return CATEGORY_ORDER.filter((c) => categories.includes(c));
|
|
1151
1153
|
} catch {
|
|
1152
1154
|
return null;
|
|
1153
1155
|
}
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glotfox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "GlotFox CLI: extract translation keys from React/Next.js and vanilla JS/TS projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@glotfox/shared": "0.0.0",
|
|
24
|
-
"@types/node": "^
|
|
24
|
+
"@types/node": "^24.0.0",
|
|
25
25
|
"esbuild": "^0.25.12",
|
|
26
26
|
"typescript": "^5.7.0",
|
|
27
27
|
"vitest": "^3.0.0"
|