inline-i18n-multi-next 0.6.0 → 0.7.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 +38 -1
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +8 -0
- package/dist/client.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm install inline-i18n-multi-next
|
|
|
15
15
|
| Entry point | Environment | Key exports |
|
|
16
16
|
|---|---|---|
|
|
17
17
|
| `inline-i18n-multi-next/server` | Server Components | `it`, `t`, `configureI18n`, `generateLocaleParams`, `createMetadata`, `getAlternates`, `createI18nMiddleware` |
|
|
18
|
-
| `inline-i18n-multi-next/client` | Client Components | `LocaleProvider`, `useLocale`, `useT`, `it`, `T`, `RichText`, `useRichText`, `useLoadDictionaries`, `useDetectedLocale`, `registerFormatter`, `clearFormatters`, `detectLocale`, `configure`, `resetConfig` |
|
|
18
|
+
| `inline-i18n-multi-next/client` | Client Components | `LocaleProvider`, `useLocale`, `useT`, `it`, `T`, `RichText`, `useRichText`, `useLoadDictionaries`, `useDetectedLocale`, `registerFormatter`, `clearFormatters`, `detectLocale`, `clearICUCache`, `restoreLocale`, `configure`, `resetConfig` |
|
|
19
19
|
|
|
20
20
|
## Quick Start
|
|
21
21
|
|
|
@@ -229,6 +229,43 @@ export async function generateMetadata({ params }) {
|
|
|
229
229
|
}
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
+
## Plural Shorthand (v0.7.0)
|
|
233
|
+
|
|
234
|
+
Concise plural syntax:
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
// Server Component
|
|
238
|
+
export default async function Page() {
|
|
239
|
+
return (
|
|
240
|
+
<p>
|
|
241
|
+
{await it({
|
|
242
|
+
en: '{count, p, item|items}',
|
|
243
|
+
ko: '{count}개',
|
|
244
|
+
}, { count: 5 })}
|
|
245
|
+
</p>
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Client Component - also supports 3-part (zero|singular|plural)
|
|
250
|
+
<T en="{count, p, no items|item|items}" ko="{count, p, 없음|개|개}" count={0} />
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Locale Persistence (v0.7.0)
|
|
254
|
+
|
|
255
|
+
Auto-save and restore locale:
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
'use client'
|
|
259
|
+
import { configure, restoreLocale } from 'inline-i18n-multi-next/client'
|
|
260
|
+
|
|
261
|
+
configure({
|
|
262
|
+
persistLocale: { storage: 'cookie', key: 'LOCALE', expires: 365 }
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
// Restore on app init
|
|
266
|
+
const saved = restoreLocale() // returns locale string or undefined
|
|
267
|
+
```
|
|
268
|
+
|
|
232
269
|
## Custom Formatters
|
|
233
270
|
|
|
234
271
|
Register custom ICU formatters via the core re-exports.
|
package/dist/client.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CustomFormatter, DetectLocaleOptions, DetectSource, Dictionaries, Dictionary, Locale, LocaleProvider, PluralRules, RichText, RichTextSegment, T, TranslationVars, Translations, clearDictionaries, clearFormatters, detectLocale, en_de, en_es, en_fr, en_ja, en_zh, getDictionary, getLoadedLocales, getLocale, hasTranslation, isLoaded, it, it_de, it_es, it_fr, it_ja, it_zh, ja_es, ja_zh, loadAsync, loadDictionaries, loadDictionary, parseRichText, registerFormatter, setLocale, t, useDetectedLocale, useLoadDictionaries, useLocale, useRichText, useT, zh_es } from 'inline-i18n-multi-react';
|
|
1
|
+
export { CustomFormatter, DetectLocaleOptions, DetectSource, Dictionaries, Dictionary, Locale, LocaleProvider, PluralRules, RichText, RichTextSegment, T, TranslationVars, Translations, clearDictionaries, clearFormatters, clearICUCache, detectLocale, en_de, en_es, en_fr, en_ja, en_zh, getDictionary, getLoadedLocales, getLocale, hasTranslation, isLoaded, it, it_de, it_es, it_fr, it_ja, it_zh, ja_es, ja_zh, loadAsync, loadDictionaries, loadDictionary, parseRichText, registerFormatter, restoreLocale, setLocale, t, useDetectedLocale, useLoadDictionaries, useLocale, useRichText, useT, zh_es } from 'inline-i18n-multi-react';
|
package/dist/client.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CustomFormatter, DetectLocaleOptions, DetectSource, Dictionaries, Dictionary, Locale, LocaleProvider, PluralRules, RichText, RichTextSegment, T, TranslationVars, Translations, clearDictionaries, clearFormatters, detectLocale, en_de, en_es, en_fr, en_ja, en_zh, getDictionary, getLoadedLocales, getLocale, hasTranslation, isLoaded, it, it_de, it_es, it_fr, it_ja, it_zh, ja_es, ja_zh, loadAsync, loadDictionaries, loadDictionary, parseRichText, registerFormatter, setLocale, t, useDetectedLocale, useLoadDictionaries, useLocale, useRichText, useT, zh_es } from 'inline-i18n-multi-react';
|
|
1
|
+
export { CustomFormatter, DetectLocaleOptions, DetectSource, Dictionaries, Dictionary, Locale, LocaleProvider, PluralRules, RichText, RichTextSegment, T, TranslationVars, Translations, clearDictionaries, clearFormatters, clearICUCache, detectLocale, en_de, en_es, en_fr, en_ja, en_zh, getDictionary, getLoadedLocales, getLocale, hasTranslation, isLoaded, it, it_de, it_es, it_fr, it_ja, it_zh, ja_es, ja_zh, loadAsync, loadDictionaries, loadDictionary, parseRichText, registerFormatter, restoreLocale, setLocale, t, useDetectedLocale, useLoadDictionaries, useLocale, useRichText, useT, zh_es } from 'inline-i18n-multi-react';
|
package/dist/client.js
CHANGED
|
@@ -24,6 +24,10 @@ Object.defineProperty(exports, "clearFormatters", {
|
|
|
24
24
|
enumerable: true,
|
|
25
25
|
get: function () { return inlineI18nMultiReact.clearFormatters; }
|
|
26
26
|
});
|
|
27
|
+
Object.defineProperty(exports, "clearICUCache", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return inlineI18nMultiReact.clearICUCache; }
|
|
30
|
+
});
|
|
27
31
|
Object.defineProperty(exports, "detectLocale", {
|
|
28
32
|
enumerable: true,
|
|
29
33
|
get: function () { return inlineI18nMultiReact.detectLocale; }
|
|
@@ -120,6 +124,10 @@ Object.defineProperty(exports, "registerFormatter", {
|
|
|
120
124
|
enumerable: true,
|
|
121
125
|
get: function () { return inlineI18nMultiReact.registerFormatter; }
|
|
122
126
|
});
|
|
127
|
+
Object.defineProperty(exports, "restoreLocale", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function () { return inlineI18nMultiReact.restoreLocale; }
|
|
130
|
+
});
|
|
123
131
|
Object.defineProperty(exports, "setLocale", {
|
|
124
132
|
enumerable: true,
|
|
125
133
|
get: function () { return inlineI18nMultiReact.setLocale; }
|
package/dist/client.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { LocaleProvider, RichText, T, clearDictionaries, clearFormatters, detectLocale, en_de, en_es, en_fr, en_ja, en_zh, getDictionary, getLoadedLocales, getLocale, hasTranslation, isLoaded, it, it_de, it_es, it_fr, it_ja, it_zh, ja_es, ja_zh, loadAsync, loadDictionaries, loadDictionary, parseRichText, registerFormatter, setLocale, t, useDetectedLocale, useLoadDictionaries, useLocale, useRichText, useT, zh_es } from 'inline-i18n-multi-react';
|
|
1
|
+
export { LocaleProvider, RichText, T, clearDictionaries, clearFormatters, clearICUCache, detectLocale, en_de, en_es, en_fr, en_ja, en_zh, getDictionary, getLoadedLocales, getLocale, hasTranslation, isLoaded, it, it_de, it_es, it_fr, it_ja, it_zh, ja_es, ja_zh, loadAsync, loadDictionaries, loadDictionary, parseRichText, registerFormatter, restoreLocale, setLocale, t, useDetectedLocale, useLoadDictionaries, useLocale, useRichText, useT, zh_es } from 'inline-i18n-multi-react';
|
|
2
2
|
//# sourceMappingURL=client.mjs.map
|
|
3
3
|
//# sourceMappingURL=client.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inline-i18n-multi-next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Next.js integration for inline-i18n-multi",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"react": "^18.0.0 || ^19.0.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"inline-i18n-multi": "0.
|
|
55
|
-
"inline-i18n-multi-react": "0.
|
|
54
|
+
"inline-i18n-multi": "0.7.0",
|
|
55
|
+
"inline-i18n-multi-react": "0.7.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/react": "^19.0.2",
|