@object-ui/i18n 17.3.0 → 17.5.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.
- package/CHANGELOG.md +1295 -1
- package/README.md +0 -13
- package/dist/index.d.ts +3 -1
- package/dist/index.js +11 -1
- package/dist/locales/ar.d.ts +466 -107
- package/dist/locales/ar.js +559 -153
- package/dist/locales/de.d.ts +466 -107
- package/dist/locales/de.js +574 -175
- package/dist/locales/en.d.ts +502 -143
- package/dist/locales/en.js +678 -145
- package/dist/locales/es.d.ts +466 -107
- package/dist/locales/es.js +553 -155
- package/dist/locales/fr.d.ts +466 -107
- package/dist/locales/fr.js +553 -152
- package/dist/locales/index.d.ts +4734 -1144
- package/dist/locales/ja.d.ts +466 -107
- package/dist/locales/ja.js +545 -146
- package/dist/locales/ko.d.ts +466 -107
- package/dist/locales/ko.js +551 -153
- package/dist/locales/pt.d.ts +466 -107
- package/dist/locales/pt.js +552 -154
- package/dist/locales/ru.d.ts +466 -107
- package/dist/locales/ru.js +563 -153
- package/dist/locales/zh.d.ts +501 -142
- package/dist/locales/zh.js +542 -142
- package/dist/pickLocalized.d.ts +21 -0
- package/dist/pickLocalized.js +40 -7
- package/dist/provider.d.ts +83 -1
- package/dist/provider.js +303 -29
- package/dist/useDisplayLocale.d.ts +49 -0
- package/dist/useDisplayLocale.js +55 -0
- package/dist/useObjectLabel.d.ts +8 -2
- package/dist/useObjectLabel.js +28 -8
- package/dist/useSafeTranslation.js +50 -2
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/number-display.d.ts +32 -0
- package/dist/utils/number-display.js +32 -0
- package/dist/utils/spec-formatters.d.ts +39 -13
- package/dist/utils/spec-formatters.js +3 -3
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -21,7 +21,6 @@ npm install @object-ui/i18n
|
|
|
21
21
|
|
|
22
22
|
**Peer Dependencies:**
|
|
23
23
|
- `react` ^18.0.0 || ^19.0.0
|
|
24
|
-
- `react-dom` ^18.0.0 || ^19.0.0
|
|
25
24
|
|
|
26
25
|
## Quick Start
|
|
27
26
|
|
|
@@ -136,20 +135,8 @@ isRTL('ar'); // true
|
|
|
136
135
|
isRTL('en'); // false
|
|
137
136
|
```
|
|
138
137
|
|
|
139
|
-
<!-- release-metadata:v3.3.0 -->
|
|
140
|
-
|
|
141
|
-
## Compatibility
|
|
142
|
-
|
|
143
|
-
- **React:** 18.x or 19.x
|
|
144
|
-
- **Node.js:** ≥ 18
|
|
145
|
-
- **TypeScript:** ≥ 5.0 (strict mode)
|
|
146
|
-
- **`@objectstack/spec`:** ^3.3.0
|
|
147
|
-
- **`@objectstack/client`:** ^3.3.0
|
|
148
|
-
- **Tailwind CSS:** ≥ 3.4 (for packages with UI)
|
|
149
|
-
|
|
150
138
|
## Links
|
|
151
139
|
|
|
152
|
-
- 📚 [Documentation](https://www.objectui.org/docs/packages/i18n)
|
|
153
140
|
- 📦 [npm package](https://www.npmjs.com/package/@object-ui/i18n)
|
|
154
141
|
- 📝 [Changelog](./CHANGELOG.md)
|
|
155
142
|
- 🐛 [Report an issue](https://github.com/objectstack-ai/objectui/issues)
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* @packageDocumentation
|
|
32
32
|
*/
|
|
33
33
|
export { createI18n, getDirection, getAvailableLanguages, type I18nConfig, type TranslationKeys } from './i18n';
|
|
34
|
-
export { I18nProvider, useObjectTranslation, useI18nContext, LOCALE_STORAGE_KEY, readStoredLanguage, type I18nProviderProps, } from './provider';
|
|
34
|
+
export { I18nProvider, useObjectTranslation, useI18nContext, LOCALE_STORAGE_KEY, readStoredLanguage, LOCALE_SEED_STORAGE_KEY, readCachedLanguageSeed, cacheLanguageSeed, type I18nProviderProps, } from './provider';
|
|
35
35
|
export { createSafeTranslation, useSafeTranslate } from './useSafeTranslation';
|
|
36
36
|
export { useObjectLabel, useSafeFieldLabel } from './useObjectLabel';
|
|
37
37
|
export { builtInLocales, isRTL, RTL_LANGUAGES } from './locales/index';
|
|
@@ -51,3 +51,5 @@ export { isSpecTranslationData, transformSpecTranslations, type SpecTranslationD
|
|
|
51
51
|
export { pickLocalized } from './pickLocalized';
|
|
52
52
|
export { LocalizationProvider, useLocalization, type LocalizationValue } from './LocalizationContext';
|
|
53
53
|
export { resolveFieldCurrency } from './currency';
|
|
54
|
+
export { useDisplayLocale } from './useDisplayLocale';
|
|
55
|
+
export { formatDisplayNumber, shouldGroupDisplayNumber, type DisplayNumberFormatOptions, } from './utils/index';
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,12 @@ export { createI18n, getDirection, getAvailableLanguages } from './i18n';
|
|
|
36
36
|
export { I18nProvider, useObjectTranslation, useI18nContext,
|
|
37
37
|
// Language-preference persistence: the key the provider writes, and the
|
|
38
38
|
// reader apps that bring their own i18next instance need to honour it.
|
|
39
|
-
LOCALE_STORAGE_KEY, readStoredLanguage,
|
|
39
|
+
LOCALE_STORAGE_KEY, readStoredLanguage,
|
|
40
|
+
// Tenant locale seed (objectui#4035) — a SEPARATE slot from the explicit
|
|
41
|
+
// choice above, and never a substitute for it. An app that fetches its
|
|
42
|
+
// tenant's server-side locale caches it here; the provider applies it at
|
|
43
|
+
// bootstrap only when the user has chosen nothing themselves.
|
|
44
|
+
LOCALE_SEED_STORAGE_KEY, readCachedLanguageSeed, cacheLanguageSeed, } from './provider';
|
|
40
45
|
// Safe translation hook factory
|
|
41
46
|
export { createSafeTranslation, useSafeTranslate } from './useSafeTranslation';
|
|
42
47
|
// Convention-based object/field label i18n
|
|
@@ -64,3 +69,8 @@ export { isSpecTranslationData, transformSpecTranslations, } from './utils/index
|
|
|
64
69
|
export { pickLocalized } from './pickLocalized';
|
|
65
70
|
export { LocalizationProvider, useLocalization } from './LocalizationContext';
|
|
66
71
|
export { resolveFieldCurrency } from './currency';
|
|
72
|
+
// The one number-display formatter (objectui#4033) and the locale it formats
|
|
73
|
+
// in. Every field cell / widget / metric renderer goes through this pair —
|
|
74
|
+
// see `utils/number-display.ts` for the grouping policy and its interim status.
|
|
75
|
+
export { useDisplayLocale } from './useDisplayLocale';
|
|
76
|
+
export { formatDisplayNumber, shouldGroupDisplayNumber, } from './utils/index';
|