@hua-labs/i18n-core 2.1.0 → 2.2.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/README.md CHANGED
@@ -4,7 +4,7 @@ Lightweight, production-ready i18n library for React. Delivers zero-flicker lang
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@hua-labs/i18n-core.svg)](https://www.npmjs.com/package/@hua-labs/i18n-core)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/@hua-labs/i18n-core.svg)](https://www.npmjs.com/package/@hua-labs/i18n-core)
7
- [![license](https://img.shields.io/npm/l/@hua-labs/i18n-core.svg)](https://github.com/HUA-Labs/HUA-Labs-public/blob/main/LICENSE)
7
+ [![license](https://img.shields.io/npm/l/@hua-labs/i18n-core.svg)](https://github.com/HUA-Labs/hua-packages/blob/main/LICENSE)
8
8
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
9
9
  [![React](https://img.shields.io/badge/React-19-blue)](https://reactjs.org/)
10
10
 
@@ -17,7 +17,10 @@ Lightweight, production-ready i18n library for React. Delivers zero-flicker lang
17
17
  - **Type-safe arrays — tArray() returns string[] without casting**
18
18
  - **State management — First-class Zustand support via i18n-core-zustand**
19
19
  - **Automatic retry — Exponential backoff for API loader failures**
20
+ - **React Native — Works in Expo and bare RN projects via CJS/ESM dual format**
20
21
  - **~6.5KB gzipped — Zero external dependencies**
22
+ - **Cross-platform — I18nPlatformAdapter for Web, React Native, Flutter bridge**
23
+ - **Generic getRawValue<T>() — type-safe raw value access without casting**
21
24
 
22
25
  ## Installation
23
26
 
@@ -65,6 +68,8 @@ function Welcome() {
65
68
  | `Translator` | class | Core translator class (for manual instantiation) |
66
69
  | `ssrTranslate` | function | Server-side translation function (no React needed) |
67
70
  | `serverTranslate` | function | Server-side translate with full config |
71
+ | `webPlatformAdapter` | function | Default web adapter — navigator.language detection + window event language sync |
72
+ | `headlessPlatformAdapter` | function | No-op adapter for SSR, testing, and Flutter bridge scenarios |
68
73
  | `I18nConfig` | type | |
69
74
  | `I18nContextType` | type | |
70
75
  | `TranslationParams` | type | |
@@ -74,6 +79,7 @@ function Welcome() {
74
79
  | `ResolvePluralKey` | type | |
75
80
  | `PluralValue` | type | |
76
81
  | `PluralCategory` | type | |
82
+ | `I18nPlatformAdapter` | interface | Platform adapter interface — implement for React Native or custom environments |
77
83
  | `createCoreI18n` | function | Create an i18n Provider component with configuration |
78
84
  | `CoreProvider` | function | Minimal Provider with zero config |
79
85
  | `createLanguageProvider` | function | Create a Provider with just a language setting |