@ultimat3/i18n 20.2.0 → 21.0.0

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/locales.ts +4 -31
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/i18n",
3
- "version": "20.2.0",
3
+ "version": "21.0.0",
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.2.0"
38
+ "@ultimat3/core": "21.0.0"
39
39
  }
40
40
  }
package/src/locales.ts CHANGED
@@ -44,28 +44,10 @@ export const SUPPORTED_LOCALES: readonly Locale[] = [
44
44
  'zh',
45
45
  ];
46
46
 
47
- /**
48
- * Right-to-left scripts, by primary subtag. A static CLDR-derived set rather than
49
- * `Intl.Locale.prototype.getTextInfo` so direction is deterministic across runtimes.
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
- }