@cellarnode/i18n 0.3.0 → 0.3.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/dist/i18next-config.d.ts +21 -0
- package/dist/i18next-config.js +21 -0
- package/package.json +5 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared i18next-cli config for all CellarNode frontend repos.
|
|
3
|
+
* Re-export from your project's i18next.config.ts:
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* export { default } from '@cellarnode/i18n/config';
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
locales: ("en" | "zh" | "fr" | "de" | "it" | "es" | "sv" | "ru")[];
|
|
11
|
+
defaultLocale: string;
|
|
12
|
+
extract: {
|
|
13
|
+
input: string[];
|
|
14
|
+
output: string;
|
|
15
|
+
defaultNamespace: string;
|
|
16
|
+
};
|
|
17
|
+
lint: {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SUPPORTED_LANGUAGES } from './constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Shared i18next-cli config for all CellarNode frontend repos.
|
|
4
|
+
* Re-export from your project's i18next.config.ts:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* export { default } from '@cellarnode/i18n/config';
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export default {
|
|
11
|
+
locales: [...SUPPORTED_LANGUAGES],
|
|
12
|
+
defaultLocale: 'en',
|
|
13
|
+
extract: {
|
|
14
|
+
input: ['src/**/*.{ts,tsx}'],
|
|
15
|
+
output: 'public/locales/{{language}}/{{namespace}}.json',
|
|
16
|
+
defaultNamespace: 'common',
|
|
17
|
+
},
|
|
18
|
+
lint: {
|
|
19
|
+
enabled: true,
|
|
20
|
+
},
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cellarnode/i18n",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Shared i18n configuration for CellarNode frontends — language constants, i18next factory, browser locale detection, and common translations.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"default": "./dist/index.js"
|
|
20
20
|
},
|
|
21
|
+
"./config": {
|
|
22
|
+
"types": "./dist/i18next-config.d.ts",
|
|
23
|
+
"default": "./dist/i18next-config.js"
|
|
24
|
+
},
|
|
21
25
|
"./locales/*": "./locales/*",
|
|
22
26
|
"./scripts/copy-common": "./dist/scripts/copy-common.js"
|
|
23
27
|
},
|