@ultimat3/i18n 20.1.6 → 20.2.1
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/package.json +2 -2
- package/src/catalogs/en.json +2 -0
- package/src/locales.ts +4 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/i18n",
|
|
3
|
-
"version": "20.1
|
|
3
|
+
"version": "20.2.1",
|
|
4
4
|
"description": "Dependency-free translator, catalog flattening, locale negotiation and loud missing-key rendering",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ultimat3/core": "20.1
|
|
38
|
+
"@ultimat3/core": "20.2.1"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/src/catalogs/en.json
CHANGED
package/src/locales.ts
CHANGED
|
@@ -44,28 +44,10 @@ export const SUPPORTED_LOCALES: readonly Locale[] = [
|
|
|
44
44
|
'zh',
|
|
45
45
|
];
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const RTL_LOCALES: ReadonlySet<string> = new Set([
|
|
52
|
-
'ar',
|
|
53
|
-
'arc',
|
|
54
|
-
'ckb',
|
|
55
|
-
'dv',
|
|
56
|
-
'fa',
|
|
57
|
-
'he',
|
|
58
|
-
'ks',
|
|
59
|
-
'ku',
|
|
60
|
-
'nqo',
|
|
61
|
-
'ps',
|
|
62
|
-
'sd',
|
|
63
|
-
'ug',
|
|
64
|
-
'ur',
|
|
65
|
-
'yi',
|
|
66
|
-
]);
|
|
67
|
-
|
|
68
|
-
export type Direction = 'ltr' | 'rtl';
|
|
47
|
+
// Direction moved to `@ultimat3/core` (`locale-direction.ts`) so a browser chunk that needs only
|
|
48
|
+
// `directionOf` does not reach this barrel and the framework catalog it installs (issue #490).
|
|
49
|
+
// Re-exported under the same names: every caller of this package is unchanged.
|
|
50
|
+
export { type Direction, directionOf, isRtl } from '@ultimat3/core';
|
|
69
51
|
|
|
70
52
|
/**
|
|
71
53
|
* Strip region, lowercase, fall back to the default.
|
|
@@ -155,12 +137,3 @@ export function negotiateLocale(
|
|
|
155
137
|
}
|
|
156
138
|
return fallback;
|
|
157
139
|
}
|
|
158
|
-
|
|
159
|
-
export function isRtl(locale: Locale): boolean {
|
|
160
|
-
const primary = locale.split('-')[0]?.toLowerCase() ?? '';
|
|
161
|
-
return RTL_LOCALES.has(primary);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export function directionOf(locale: Locale): Direction {
|
|
165
|
-
return isRtl(locale) ? 'rtl' : 'ltr';
|
|
166
|
-
}
|