@entifix/i18n 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 r10c Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ export * from './instance.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './instance.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './instance.js';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB"}
@@ -0,0 +1,81 @@
1
+ import { type Locale } from '@entifix/core';
2
+ import { type i18n, type Namespace, type ThirdPartyModule } from 'i18next';
3
+ /** One locale's catalogs, keyed by namespace. */
4
+ export type LocaleCatalogs = Readonly<Record<string, object>>;
5
+ /**
6
+ * Every catalog an application renders: entifix's framework namespaces plus the
7
+ * host's own, already merged.
8
+ *
9
+ * ⚠️ **Supplied by the host, never assembled here.** This package used to import
10
+ * five namespaces directly, two of which were r10c product copy — `'r10c Admin'`
11
+ * shipped inside the framework. Taking them as a value is what lets two
12
+ * applications with different copy share one i18next setup.
13
+ */
14
+ export interface I18nCatalogs {
15
+ readonly resources: Readonly<Record<string, LocaleCatalogs>>;
16
+ readonly namespaces: readonly string[];
17
+ readonly defaultNS: string;
18
+ }
19
+ /**
20
+ * Hand this package the application's catalogs. Call it once, from a module
21
+ * every entry point imports.
22
+ *
23
+ * ⚠️ **A registry rather than an argument, and the reason is the call site.**
24
+ * Every other seam in entifix takes its value at a composition root — a `Layer`,
25
+ * a React provider, a hook option. `getServerT` has neither: it is called
26
+ * directly inside React server components scattered across an application, with
27
+ * nothing in between to thread a parameter through. So the seam is module
28
+ * initialization, and the failure mode is made loud below rather than silent.
29
+ *
30
+ * Locale *routing* needs none of this. `@entifix/core`'s locale helpers carry
31
+ * no catalogs, so Next middleware reads a cookie and a header without ever
32
+ * loading i18next or a single translation.
33
+ */
34
+ export declare function defineCatalogs(catalogs: I18nCatalogs): void;
35
+ /**
36
+ * Builds an isolated i18next instance for one locale.
37
+ *
38
+ * Always an *instance*, never the `i18next` singleton: a server renders several
39
+ * locales concurrently, and a shared singleton would let one request's `lng`
40
+ * leak into another's markup.
41
+ *
42
+ * Catalogs are bundled rather than fetched, so `init` completes synchronously
43
+ * (`initAsync: false`) and the first paint is already translated — no Suspense
44
+ * boundary, no flash of untranslated keys.
45
+ *
46
+ * `modules` is how the React binding passes `initReactI18next` without this
47
+ * package taking a dependency on React.
48
+ */
49
+ export declare function createI18n(locale: Locale, modules?: readonly ThirdPartyModule[]): i18n;
50
+ /**
51
+ * A translate function for a locale the caller already holds — a route param,
52
+ * typically — bound to one namespace.
53
+ *
54
+ * Request-free by construction, and that is the point: a component built on it
55
+ * touches neither `headers()` nor `cookies()`, so the page containing it stays
56
+ * statically renderable and can be prerendered once per locale. Its
57
+ * request-reading counterpart is `getServerT` in `@entifix/next-i18n`,
58
+ * which re-exports this one for symmetry at app call sites.
59
+ *
60
+ * It lives here rather than in the Next i18n shell because a `layer:shell`
61
+ * package may not depend on another `layer:shell` package — and the storefront
62
+ * shell, which has a real `[locale]` segment and therefore never reads a
63
+ * request, is exactly the caller that needs it.
64
+ */
65
+ export declare function getServerTFor<N extends Namespace>(locale: Locale, ns?: N): import("i18next").TFunction<"translation" | (N extends null ? "translation" : N), undefined>;
66
+ /**
67
+ * The instance used when no provider is mounted — Storybook, a unit spec, a
68
+ * screen that forgot.
69
+ *
70
+ * One per process, shared across packages on purpose. Each React package
71
+ * resolves copy through its own `useTranslation`, and react-i18next falls back
72
+ * to its *uninitialized* global when no provider is in the tree — which renders
73
+ * raw keys at the user. Handing every caller the same initialized default
74
+ * instance makes that failure mode "the fleet default locale" instead.
75
+ *
76
+ * Built lazily, so an app that always mounts a provider never pays for it.
77
+ */
78
+ export declare function sharedFallbackI18n(modules?: readonly ThirdPartyModule[]): i18n;
79
+ /** Drops the installed catalogs and the shared instance. For specs. */
80
+ export declare function resetCatalogs(): void;
81
+ //# sourceMappingURL=instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAgB,EACd,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAC;AAEjB,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAC7D,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAID;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAE3D;AAaD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,SAAS,gBAAgB,EAAO,GACxC,IAAI,CAqBN;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,gGAOxE;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,SAAS,gBAAgB,EAAO,GACxC,IAAI,CAGN;AAED,uEAAuE;AACvE,wBAAgB,aAAa,IAAI,IAAI,CAGpC"}
@@ -0,0 +1,102 @@
1
+ import { DEFAULT_LOCALE, EntifixBuildError } from '@entifix/core';
2
+ import i18next from 'i18next';
3
+ let installed;
4
+ /**
5
+ * Hand this package the application's catalogs. Call it once, from a module
6
+ * every entry point imports.
7
+ *
8
+ * ⚠️ **A registry rather than an argument, and the reason is the call site.**
9
+ * Every other seam in entifix takes its value at a composition root — a `Layer`,
10
+ * a React provider, a hook option. `getServerT` has neither: it is called
11
+ * directly inside React server components scattered across an application, with
12
+ * nothing in between to thread a parameter through. So the seam is module
13
+ * initialization, and the failure mode is made loud below rather than silent.
14
+ *
15
+ * Locale *routing* needs none of this. `@entifix/core`'s locale helpers carry
16
+ * no catalogs, so Next middleware reads a cookie and a header without ever
17
+ * loading i18next or a single translation.
18
+ */ export function defineCatalogs(catalogs) {
19
+ installed = catalogs;
20
+ }
21
+ const required = ()=>{
22
+ if (installed === undefined) {
23
+ throw new EntifixBuildError('No i18n catalogs are installed. Call `defineCatalogs({ resources, ' + 'namespaces, defaultNS })` once from a module every entry point ' + 'imports, before the first server render.');
24
+ }
25
+ return installed;
26
+ };
27
+ /**
28
+ * Builds an isolated i18next instance for one locale.
29
+ *
30
+ * Always an *instance*, never the `i18next` singleton: a server renders several
31
+ * locales concurrently, and a shared singleton would let one request's `lng`
32
+ * leak into another's markup.
33
+ *
34
+ * Catalogs are bundled rather than fetched, so `init` completes synchronously
35
+ * (`initAsync: false`) and the first paint is already translated — no Suspense
36
+ * boundary, no flash of untranslated keys.
37
+ *
38
+ * `modules` is how the React binding passes `initReactI18next` without this
39
+ * package taking a dependency on React.
40
+ */ export function createI18n(locale, modules = []) {
41
+ const catalogs = required();
42
+ const instance = modules.reduce((acc, module)=>acc.use(module), i18next.createInstance());
43
+ instance.init({
44
+ lng: locale,
45
+ fallbackLng: DEFAULT_LOCALE,
46
+ ns: [
47
+ ...catalogs.namespaces
48
+ ],
49
+ defaultNS: catalogs.defaultNS,
50
+ resources: catalogs.resources,
51
+ initAsync: false,
52
+ interpolation: {
53
+ // React escapes for us; double-escaping turns "Café" into "Caf&#233;".
54
+ escapeValue: false
55
+ }
56
+ });
57
+ return instance;
58
+ }
59
+ /**
60
+ * A translate function for a locale the caller already holds — a route param,
61
+ * typically — bound to one namespace.
62
+ *
63
+ * Request-free by construction, and that is the point: a component built on it
64
+ * touches neither `headers()` nor `cookies()`, so the page containing it stays
65
+ * statically renderable and can be prerendered once per locale. Its
66
+ * request-reading counterpart is `getServerT` in `@entifix/next-i18n`,
67
+ * which re-exports this one for symmetry at app call sites.
68
+ *
69
+ * It lives here rather than in the Next i18n shell because a `layer:shell`
70
+ * package may not depend on another `layer:shell` package — and the storefront
71
+ * shell, which has a real `[locale]` segment and therefore never reads a
72
+ * request, is exactly the caller that needs it.
73
+ */ export function getServerTFor(locale, ns) {
74
+ // `Namespace` is i18next's own, so it resolves to whatever union the *host*
75
+ // declared in `CustomTypeOptions`. This package names no namespace of its own
76
+ // and imports no catalog — which is the whole point — while a caller still
77
+ // gets a `t` bound to the namespace it asked for, and an unknown key stays a
78
+ // compile error.
79
+ return createI18n(locale).getFixedT(locale, ns != null ? ns : null);
80
+ }
81
+ let shared;
82
+ /**
83
+ * The instance used when no provider is mounted — Storybook, a unit spec, a
84
+ * screen that forgot.
85
+ *
86
+ * One per process, shared across packages on purpose. Each React package
87
+ * resolves copy through its own `useTranslation`, and react-i18next falls back
88
+ * to its *uninitialized* global when no provider is in the tree — which renders
89
+ * raw keys at the user. Handing every caller the same initialized default
90
+ * instance makes that failure mode "the fleet default locale" instead.
91
+ *
92
+ * Built lazily, so an app that always mounts a provider never pays for it.
93
+ */ export function sharedFallbackI18n(modules = []) {
94
+ shared != null ? shared : shared = createI18n(DEFAULT_LOCALE, modules);
95
+ return shared;
96
+ }
97
+ /** Drops the installed catalogs and the shared instance. For specs. */ export function resetCatalogs() {
98
+ installed = undefined;
99
+ shared = undefined;
100
+ }
101
+
102
+ //# sourceMappingURL=instance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/instance.ts"],"sourcesContent":["import { DEFAULT_LOCALE, EntifixBuildError, type Locale } from '@entifix/core';\nimport i18next, {\n type i18n,\n type Namespace,\n type ThirdPartyModule,\n} from 'i18next';\n\n/** One locale's catalogs, keyed by namespace. */\nexport type LocaleCatalogs = Readonly<Record<string, object>>;\n\n/**\n * Every catalog an application renders: entifix's framework namespaces plus the\n * host's own, already merged.\n *\n * ⚠️ **Supplied by the host, never assembled here.** This package used to import\n * five namespaces directly, two of which were r10c product copy — `'r10c Admin'`\n * shipped inside the framework. Taking them as a value is what lets two\n * applications with different copy share one i18next setup.\n */\nexport interface I18nCatalogs {\n readonly resources: Readonly<Record<string, LocaleCatalogs>>;\n readonly namespaces: readonly string[];\n readonly defaultNS: string;\n}\n\nlet installed: I18nCatalogs | undefined;\n\n/**\n * Hand this package the application's catalogs. Call it once, from a module\n * every entry point imports.\n *\n * ⚠️ **A registry rather than an argument, and the reason is the call site.**\n * Every other seam in entifix takes its value at a composition root — a `Layer`,\n * a React provider, a hook option. `getServerT` has neither: it is called\n * directly inside React server components scattered across an application, with\n * nothing in between to thread a parameter through. So the seam is module\n * initialization, and the failure mode is made loud below rather than silent.\n *\n * Locale *routing* needs none of this. `@entifix/core`'s locale helpers carry\n * no catalogs, so Next middleware reads a cookie and a header without ever\n * loading i18next or a single translation.\n */\nexport function defineCatalogs(catalogs: I18nCatalogs): void {\n installed = catalogs;\n}\n\nconst required = (): I18nCatalogs => {\n if (installed === undefined) {\n throw new EntifixBuildError(\n 'No i18n catalogs are installed. Call `defineCatalogs({ resources, ' +\n 'namespaces, defaultNS })` once from a module every entry point ' +\n 'imports, before the first server render.',\n );\n }\n return installed;\n};\n\n/**\n * Builds an isolated i18next instance for one locale.\n *\n * Always an *instance*, never the `i18next` singleton: a server renders several\n * locales concurrently, and a shared singleton would let one request's `lng`\n * leak into another's markup.\n *\n * Catalogs are bundled rather than fetched, so `init` completes synchronously\n * (`initAsync: false`) and the first paint is already translated — no Suspense\n * boundary, no flash of untranslated keys.\n *\n * `modules` is how the React binding passes `initReactI18next` without this\n * package taking a dependency on React.\n */\nexport function createI18n(\n locale: Locale,\n modules: readonly ThirdPartyModule[] = [],\n): i18n {\n const catalogs = required();\n const instance = modules.reduce<i18n>(\n (acc, module) => acc.use(module),\n i18next.createInstance(),\n );\n\n instance.init({\n lng: locale,\n fallbackLng: DEFAULT_LOCALE,\n ns: [...catalogs.namespaces],\n defaultNS: catalogs.defaultNS,\n resources: catalogs.resources,\n initAsync: false,\n interpolation: {\n // React escapes for us; double-escaping turns \"Café\" into \"Caf&#233;\".\n escapeValue: false,\n },\n });\n\n return instance;\n}\n\n/**\n * A translate function for a locale the caller already holds — a route param,\n * typically — bound to one namespace.\n *\n * Request-free by construction, and that is the point: a component built on it\n * touches neither `headers()` nor `cookies()`, so the page containing it stays\n * statically renderable and can be prerendered once per locale. Its\n * request-reading counterpart is `getServerT` in `@entifix/next-i18n`,\n * which re-exports this one for symmetry at app call sites.\n *\n * It lives here rather than in the Next i18n shell because a `layer:shell`\n * package may not depend on another `layer:shell` package — and the storefront\n * shell, which has a real `[locale]` segment and therefore never reads a\n * request, is exactly the caller that needs it.\n */\nexport function getServerTFor<N extends Namespace>(locale: Locale, ns?: N) {\n // `Namespace` is i18next's own, so it resolves to whatever union the *host*\n // declared in `CustomTypeOptions`. This package names no namespace of its own\n // and imports no catalog — which is the whole point — while a caller still\n // gets a `t` bound to the namespace it asked for, and an unknown key stays a\n // compile error.\n return createI18n(locale).getFixedT(locale, ns ?? null);\n}\n\nlet shared: i18n | undefined;\n\n/**\n * The instance used when no provider is mounted — Storybook, a unit spec, a\n * screen that forgot.\n *\n * One per process, shared across packages on purpose. Each React package\n * resolves copy through its own `useTranslation`, and react-i18next falls back\n * to its *uninitialized* global when no provider is in the tree — which renders\n * raw keys at the user. Handing every caller the same initialized default\n * instance makes that failure mode \"the fleet default locale\" instead.\n *\n * Built lazily, so an app that always mounts a provider never pays for it.\n */\nexport function sharedFallbackI18n(\n modules: readonly ThirdPartyModule[] = [],\n): i18n {\n shared ??= createI18n(DEFAULT_LOCALE, modules);\n return shared;\n}\n\n/** Drops the installed catalogs and the shared instance. For specs. */\nexport function resetCatalogs(): void {\n installed = undefined;\n shared = undefined;\n}\n"],"names":["DEFAULT_LOCALE","EntifixBuildError","i18next","installed","defineCatalogs","catalogs","required","undefined","createI18n","locale","modules","instance","reduce","acc","module","use","createInstance","init","lng","fallbackLng","ns","namespaces","defaultNS","resources","initAsync","interpolation","escapeValue","getServerTFor","getFixedT","shared","sharedFallbackI18n","resetCatalogs"],"mappings":"AAAA,SAASA,cAAc,EAAEC,iBAAiB,QAAqB,gBAAgB;AAC/E,OAAOC,aAIA,UAAU;AAoBjB,IAAIC;AAEJ;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,eAAeC,QAAsB;IACnDF,YAAYE;AACd;AAEA,MAAMC,WAAW;IACf,IAAIH,cAAcI,WAAW;QAC3B,MAAM,IAAIN,kBACR,uEACE,oEACA;IAEN;IACA,OAAOE;AACT;AAEA;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASK,WACdC,MAAc,EACdC,UAAuC,EAAE;IAEzC,MAAML,WAAWC;IACjB,MAAMK,WAAWD,QAAQE,MAAM,CAC7B,CAACC,KAAKC,SAAWD,IAAIE,GAAG,CAACD,SACzBZ,QAAQc,cAAc;IAGxBL,SAASM,IAAI,CAAC;QACZC,KAAKT;QACLU,aAAanB;QACboB,IAAI;eAAIf,SAASgB,UAAU;SAAC;QAC5BC,WAAWjB,SAASiB,SAAS;QAC7BC,WAAWlB,SAASkB,SAAS;QAC7BC,WAAW;QACXC,eAAe;YACb,uEAAuE;YACvEC,aAAa;QACf;IACF;IAEA,OAAOf;AACT;AAEA;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASgB,cAAmClB,MAAc,EAAEW,EAAM;IACvE,4EAA4E;IAC5E,8EAA8E;IAC9E,2EAA2E;IAC3E,6EAA6E;IAC7E,iBAAiB;IACjB,OAAOZ,WAAWC,QAAQmB,SAAS,CAACnB,QAAQW,aAAAA,KAAM;AACpD;AAEA,IAAIS;AAEJ;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,mBACdpB,UAAuC,EAAE;IAEzCmB,iBAAAA,SAAAA,SAAWrB,WAAWR,gBAAgBU;IACtC,OAAOmB;AACT;AAEA,qEAAqE,GACrE,OAAO,SAASE;IACd5B,YAAYI;IACZsB,SAAStB;AACX"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Kept as its own entry point for the reason it always was: Next middleware runs
3
+ * on the edge, and importing this package's barrel would pull the i18next
4
+ * runtime into a bundle that only reads a cookie and a header.
5
+ *
6
+ * What changed is where the implementation lives. Locale routing carries no
7
+ * catalogs and no i18next, so it belongs in `@entifix/core` — which is what
8
+ * makes a middleware bundle free of this package entirely.
9
+ */
10
+ export { DEFAULT_LOCALE, isLocale, type Locale, LOCALE_COOKIE, LOCALE_HEADER, localeHref, type LocalePath, LOCALES, negotiateLocale, type NegotiateLocaleInput, parseAcceptLanguage, splitLocalePath, } from '@entifix/core';
11
+ //# sourceMappingURL=routing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../src/routing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,cAAc,EACd,QAAQ,EACR,KAAK,MAAM,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,KAAK,UAAU,EACf,OAAO,EACP,eAAe,EACf,KAAK,oBAAoB,EACzB,mBAAmB,EACnB,eAAe,GAChB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Kept as its own entry point for the reason it always was: Next middleware runs
3
+ * on the edge, and importing this package's barrel would pull the i18next
4
+ * runtime into a bundle that only reads a cookie and a header.
5
+ *
6
+ * What changed is where the implementation lives. Locale routing carries no
7
+ * catalogs and no i18next, so it belongs in `@entifix/core` — which is what
8
+ * makes a middleware bundle free of this package entirely.
9
+ */ export { DEFAULT_LOCALE, isLocale, LOCALE_COOKIE, LOCALE_HEADER, localeHref, LOCALES, negotiateLocale, parseAcceptLanguage, splitLocalePath } from '@entifix/core';
10
+
11
+ //# sourceMappingURL=routing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/routing.ts"],"sourcesContent":["/**\n * Kept as its own entry point for the reason it always was: Next middleware runs\n * on the edge, and importing this package's barrel would pull the i18next\n * runtime into a bundle that only reads a cookie and a header.\n *\n * What changed is where the implementation lives. Locale routing carries no\n * catalogs and no i18next, so it belongs in `@entifix/core` — which is what\n * makes a middleware bundle free of this package entirely.\n */\nexport {\n DEFAULT_LOCALE,\n isLocale,\n type Locale,\n LOCALE_COOKIE,\n LOCALE_HEADER,\n localeHref,\n type LocalePath,\n LOCALES,\n negotiateLocale,\n type NegotiateLocaleInput,\n parseAcceptLanguage,\n splitLocalePath,\n} from '@entifix/core';\n"],"names":["DEFAULT_LOCALE","isLocale","LOCALE_COOKIE","LOCALE_HEADER","localeHref","LOCALES","negotiateLocale","parseAcceptLanguage","splitLocalePath"],"mappings":"AAAA;;;;;;;;CAQC,GACD,SACEA,cAAc,EACdC,QAAQ,EAERC,aAAa,EACbC,aAAa,EACbC,UAAU,EAEVC,OAAO,EACPC,eAAe,EAEfC,mBAAmB,EACnBC,eAAe,QACV,gBAAgB"}
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@entifix/i18n",
3
+ "version": "0.1.0-0",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/r10c-technologies/entifix.git",
8
+ "directory": "packages/ts/i18n"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "type": "module",
14
+ "main": "./dist/index.js",
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ "./package.json": "./package.json",
19
+ ".": {
20
+ "@entifix/source": "./src/index.ts",
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.js",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./routing": {
26
+ "@entifix/source": "./src/routing.ts",
27
+ "types": "./dist/routing.d.ts",
28
+ "import": "./dist/routing.js",
29
+ "default": "./dist/routing.js"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "!**/*.tsbuildinfo",
35
+ "LICENSE"
36
+ ],
37
+ "nx": {
38
+ "tags": [
39
+ "layer:entifix",
40
+ "scope:shared",
41
+ "entifix:client",
42
+ "tier:2"
43
+ ],
44
+ "sourceRoot": "packages/ts/i18n/src",
45
+ "targets": {
46
+ "build": {
47
+ "executor": "@nx/js:swc",
48
+ "outputs": [
49
+ "{options.outputPath}"
50
+ ],
51
+ "options": {
52
+ "outputPath": "packages/ts/i18n/dist",
53
+ "main": "packages/ts/i18n/src/index.ts",
54
+ "tsConfig": "packages/ts/i18n/tsconfig.lib.json",
55
+ "skipTypeCheck": true,
56
+ "stripLeadingPaths": true
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "dependencies": {
62
+ "@swc/helpers": "0.5.23",
63
+ "@entifix/core": "0.1.0-0"
64
+ },
65
+ "peerDependencies": {
66
+ "i18next": ">=26 <27"
67
+ },
68
+ "devDependencies": {
69
+ "i18next": "26.3.6"
70
+ }
71
+ }