@intlayer/core 1.0.0 → 1.0.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/cjs/getLocaleName.cjs +8 -13
- package/dist/cjs/getLocaleName.d.ts +1 -1
- package/dist/cjs/index.cjs +20 -27
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +12 -25
- package/dist/cjs/localeList.cjs +9 -14
- package/dist/cjs/localeList.d.ts +1 -1
- package/dist/cjs/transpiler/content_transformers/enumeration/enumeration.cjs +12 -17
- package/dist/cjs/transpiler/content_transformers/enumeration/enumeration.d.ts +6 -15
- package/dist/cjs/transpiler/content_transformers/enumeration/getEnumerationContent.cjs +14 -34
- package/dist/cjs/transpiler/content_transformers/enumeration/getEnumerationContent.d.ts +4 -7
- package/dist/cjs/transpiler/content_transformers/enumeration/index.cjs +11 -23
- package/dist/cjs/transpiler/content_transformers/enumeration/index.d.ts +4 -4
- package/dist/cjs/transpiler/content_transformers/index.cjs +11 -27
- package/dist/cjs/transpiler/content_transformers/index.d.ts +9 -15
- package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.cjs +9 -15
- package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.cjs.map +1 -1
- package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.d.ts +7 -8
- package/dist/cjs/transpiler/content_transformers/translation/index.cjs +13 -23
- package/dist/cjs/transpiler/content_transformers/translation/index.cjs.map +1 -1
- package/dist/cjs/transpiler/content_transformers/translation/index.d.ts +7 -5
- package/dist/cjs/transpiler/content_transformers/translation/{translations.cjs → translation.cjs} +17 -22
- package/dist/cjs/transpiler/content_transformers/translation/translation.cjs.map +1 -0
- package/dist/cjs/transpiler/content_transformers/translation/translation.d.ts +30 -0
- package/dist/cjs/transpiler/content_transformers/translation/types.cjs +17 -0
- package/dist/cjs/transpiler/content_transformers/translation/types.cjs.map +1 -0
- package/dist/cjs/transpiler/content_transformers/translation/types.d.ts +63 -0
- package/dist/cjs/transpiler/index.cjs +9 -22
- package/dist/cjs/transpiler/index.cjs.map +1 -1
- package/dist/cjs/transpiler/index.d.ts +9 -13
- package/dist/cjs/types/contentModule.cjs +4 -8
- package/dist/cjs/types/contentModule.d.ts +14 -28
- package/dist/cjs/types/index.cjs +9 -14
- package/dist/cjs/types/index.d.ts +7 -13
- package/dist/cjs/types/nodeType.cjs +8 -13
- package/dist/cjs/types/nodeType.d.ts +2 -2
- package/dist/cjs/utils/getStackTraceInfo.cjs +9 -14
- package/dist/cjs/utils/getStackTraceInfo.d.ts +3 -3
- package/dist/esm/getLocaleName.d.mts +1 -1
- package/dist/esm/getLocaleName.mjs +4 -2
- package/dist/esm/index.d.mts +12 -25
- package/dist/esm/index.mjs +7 -7
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/localeList.d.mts +1 -1
- package/dist/esm/localeList.mjs +5 -3
- package/dist/esm/transpiler/content_transformers/enumeration/enumeration.d.mts +6 -15
- package/dist/esm/transpiler/content_transformers/enumeration/enumeration.mjs +10 -6
- package/dist/esm/transpiler/content_transformers/enumeration/getEnumerationContent.d.mts +4 -7
- package/dist/esm/transpiler/content_transformers/enumeration/getEnumerationContent.mjs +10 -23
- package/dist/esm/transpiler/content_transformers/enumeration/index.d.mts +4 -4
- package/dist/esm/transpiler/content_transformers/enumeration/index.mjs +3 -3
- package/dist/esm/transpiler/content_transformers/index.d.mts +9 -15
- package/dist/esm/transpiler/content_transformers/index.mjs +3 -3
- package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.d.mts +7 -8
- package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.mjs +8 -5
- package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.mjs.map +1 -1
- package/dist/esm/transpiler/content_transformers/translation/index.d.mts +7 -5
- package/dist/esm/transpiler/content_transformers/translation/index.mjs +4 -3
- package/dist/esm/transpiler/content_transformers/translation/index.mjs.map +1 -1
- package/dist/esm/transpiler/content_transformers/translation/translation.d.mts +30 -0
- package/dist/esm/transpiler/content_transformers/translation/{translations.mjs → translation.mjs} +10 -7
- package/dist/esm/transpiler/content_transformers/translation/translation.mjs.map +1 -0
- package/dist/esm/transpiler/content_transformers/translation/types.d.mts +63 -0
- package/dist/esm/transpiler/content_transformers/translation/types.mjs +1 -0
- package/dist/esm/transpiler/content_transformers/translation/types.mjs.map +1 -0
- package/dist/esm/transpiler/index.d.mts +9 -13
- package/dist/esm/transpiler/index.mjs +2 -3
- package/dist/esm/transpiler/index.mjs.map +1 -1
- package/dist/esm/types/contentModule.d.mts +14 -28
- package/dist/esm/types/contentModule.mjs +1 -1
- package/dist/esm/types/index.d.mts +7 -13
- package/dist/esm/types/index.mjs +5 -3
- package/dist/esm/types/nodeType.d.mts +2 -2
- package/dist/esm/types/nodeType.mjs +4 -2
- package/dist/esm/utils/getStackTraceInfo.d.mts +3 -3
- package/dist/esm/utils/getStackTraceInfo.mjs +5 -3
- package/package.json +8 -5
- package/src/index.ts +2 -0
- package/src/transpiler/content_transformers/translation/getTranslationContent.ts +9 -5
- package/src/transpiler/content_transformers/translation/index.ts +2 -1
- package/src/transpiler/content_transformers/translation/translation.ts +53 -0
- package/src/transpiler/content_transformers/translation/types.ts +72 -0
- package/src/transpiler/index.ts +1 -7
- package/dist/cjs/transpiler/content_transformers/translation/translations.cjs.map +0 -1
- package/dist/cjs/transpiler/content_transformers/translation/translations.d.ts +0 -17
- package/dist/esm/transpiler/content_transformers/translation/translations.d.mts +0 -17
- package/dist/esm/transpiler/content_transformers/translation/translations.mjs.map +0 -1
- package/src/transpiler/content_transformers/translation/translations.ts +0 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "IntLayer - Layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.",
|
|
6
6
|
"keywords": [
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
"url": "git+https://github.com/aypineau/intlayer.git"
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
|
-
"author":
|
|
27
|
+
"author": {
|
|
28
|
+
"name": "Aymeric PINEAU",
|
|
29
|
+
"url": "https://github.com/aypineau"
|
|
30
|
+
},
|
|
28
31
|
"exports": {
|
|
29
32
|
".": {
|
|
30
33
|
"types": "./dist/esm/index.d.mts",
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
"./package.json"
|
|
48
51
|
],
|
|
49
52
|
"dependencies": {
|
|
50
|
-
"@intlayer/config": "^1.0.
|
|
53
|
+
"@intlayer/config": "^1.0.1"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
53
56
|
"@types/node": "^20.11.30",
|
|
@@ -56,8 +59,8 @@
|
|
|
56
59
|
"rimraf": "5.0.5",
|
|
57
60
|
"tsup": "^8.0.2",
|
|
58
61
|
"typescript": "^5.4.3",
|
|
59
|
-
"@utils/
|
|
60
|
-
"@utils/
|
|
62
|
+
"@utils/eslint-config": "^1.0.1",
|
|
63
|
+
"@utils/ts-config": "^1.0.1"
|
|
61
64
|
},
|
|
62
65
|
"peerDependencies": {
|
|
63
66
|
"@types/react": "^18.2.78",
|
package/src/index.ts
CHANGED
|
@@ -2,12 +2,16 @@ import {
|
|
|
2
2
|
type Locales,
|
|
3
3
|
intlayerIntlConfiguration,
|
|
4
4
|
} from '@intlayer/config/client';
|
|
5
|
-
import type {
|
|
5
|
+
import type { CustomizableLanguageContent } from './types';
|
|
6
6
|
|
|
7
7
|
const defaultLocale = intlayerIntlConfiguration.defaultLocale;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
languageContent:
|
|
9
|
+
type GetTranslationContent = <Content = string>(
|
|
10
|
+
languageContent: CustomizableLanguageContent<Content>,
|
|
11
11
|
locale: Locales
|
|
12
|
-
)
|
|
13
|
-
|
|
12
|
+
) => Content;
|
|
13
|
+
|
|
14
|
+
export const getTranslationContent: GetTranslationContent = <Content = string>(
|
|
15
|
+
languageContent: CustomizableLanguageContent<Content>,
|
|
16
|
+
locale: Locales
|
|
17
|
+
) => languageContent[locale ?? defaultLocale] ?? languageContent[defaultLocale];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { intlayerConfiguration } from '@intlayer/config/client';
|
|
2
|
+
import { NodeType } from '../../../types/index';
|
|
3
|
+
import { getStackTraceInfo } from '../../../utils/getStackTraceInfo';
|
|
4
|
+
import type { CustomizableLanguageContent, TranslationContent } from './types';
|
|
5
|
+
|
|
6
|
+
const { defaultLocale } = intlayerConfiguration.internationalization;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Transpile multilingual dictionary content
|
|
10
|
+
*
|
|
11
|
+
* Usage
|
|
12
|
+
*
|
|
13
|
+
* translation<string>({
|
|
14
|
+
* "en": "test",
|
|
15
|
+
* "fr": "test",
|
|
16
|
+
* // ... any other available locale
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* translation<number, Locales.ENGLISH>({
|
|
20
|
+
* "en": 1
|
|
21
|
+
* })
|
|
22
|
+
*
|
|
23
|
+
* translation<string, Locales.ENGLISH | Locales.FRENCH>({
|
|
24
|
+
* "fr": "test",
|
|
25
|
+
* "en": "test"
|
|
26
|
+
* })
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
const translation = <Content = string>(
|
|
30
|
+
content?: CustomizableLanguageContent<Content>
|
|
31
|
+
) => {
|
|
32
|
+
const stackTraceInfo = getStackTraceInfo();
|
|
33
|
+
|
|
34
|
+
if (typeof content === 'string') {
|
|
35
|
+
const result: TranslationContent<Content> = {
|
|
36
|
+
nodeType: NodeType.Translation,
|
|
37
|
+
...stackTraceInfo,
|
|
38
|
+
[defaultLocale]: content,
|
|
39
|
+
} as TranslationContent<Content>;
|
|
40
|
+
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const result: TranslationContent<Content> = {
|
|
45
|
+
nodeType: NodeType.Translation,
|
|
46
|
+
...stackTraceInfo,
|
|
47
|
+
...(content as unknown as object),
|
|
48
|
+
} as TranslationContent<Content>;
|
|
49
|
+
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { translation as t };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { LocalesValues } from '@intlayer/config/client';
|
|
2
|
+
// @ts-expect-error intlayer declared for module augmentation
|
|
3
|
+
import type { IConfigLocales } from 'intlayer';
|
|
4
|
+
import type { NodeType } from '../../../types';
|
|
5
|
+
import type { NoteStackTraceInfo } from '../../../utils/getStackTraceInfo';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...
|
|
9
|
+
* If not, it will return never
|
|
10
|
+
*/
|
|
11
|
+
export type ConfigLocales = keyof IConfigLocales<unknown>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...
|
|
15
|
+
* If not, it will return all available locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...
|
|
16
|
+
*/
|
|
17
|
+
export type CustomLocales = ConfigLocales extends never
|
|
18
|
+
? LocalesValues
|
|
19
|
+
: ConfigLocales;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Record of locales and content
|
|
23
|
+
*
|
|
24
|
+
* const myVar1: LanguageContent<string> = {
|
|
25
|
+
* "en": "",
|
|
26
|
+
* "fr": ""
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* const myVar2: LanguageContent<{age: number, name: string}> = {
|
|
30
|
+
* "en": {age: 1, name: "test"},
|
|
31
|
+
* "fr": {age: 1, name: "test"}
|
|
32
|
+
* }
|
|
33
|
+
*/
|
|
34
|
+
export type LanguageContent<Content> = Partial<Record<LocalesValues, Content>>;
|
|
35
|
+
export type ConfigLanguageContent<Content> = Record<ConfigLocales, Content>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Valid
|
|
39
|
+
* const test: CustomizableLanguageContent<string, Locales.ENGLISH | Locales.FRENCH> = {
|
|
40
|
+
* "en": "test",
|
|
41
|
+
* "fr": "test"
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* const test: CustomizableLanguageContent<number> = {
|
|
45
|
+
* "fr": 1,
|
|
46
|
+
* "en": 1,
|
|
47
|
+
* ... any other available locale
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* Invalid
|
|
51
|
+
*
|
|
52
|
+
* const test: CustomizableLanguageContent<string> = {
|
|
53
|
+
* "en": "test",
|
|
54
|
+
* "fr": "test",
|
|
55
|
+
* "sss": "test" // Does not exist in Locales
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* const test: CustomizableLanguageContent<string, Locales.ENGLISH | Locales.FRENCH> = {
|
|
59
|
+
* "fr": "test"
|
|
60
|
+
* // Locales.ENGLISH is missing
|
|
61
|
+
* }
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
export type CustomizableLanguageContent<Content = string> =
|
|
65
|
+
ConfigLocales extends never
|
|
66
|
+
? LanguageContent<Content>
|
|
67
|
+
: ConfigLanguageContent<Content>;
|
|
68
|
+
|
|
69
|
+
export type TranslationContent<Content> = LanguageContent<Content> &
|
|
70
|
+
NoteStackTraceInfo & {
|
|
71
|
+
nodeType: NodeType.Translation;
|
|
72
|
+
};
|
package/src/transpiler/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/translations.ts"],"sourcesContent":["import { type Locales, intlayerConfiguration } from '@intlayer/config/client';\nimport type { ReactNode } from 'react';\nimport { NodeType } from '../../../types/index';\nimport {\n getStackTraceInfo,\n type NoteStackTraceInfo,\n} from '../../../utils/getStackTraceInfo';\n\nexport type LanguageContent<Content> = Record<Locales, Content>;\n\nexport type TranslationContent<Content> = Partial<LanguageContent<Content>> &\n NoteStackTraceInfo & {\n nodeType: NodeType.Translation;\n };\n\n/**\n * Create a JSON with the content and the stack trace information\n */\nconst translations = <Content>(\n content?: Partial<LanguageContent<Content>> | string\n) => {\n const stackTraceInfo = getStackTraceInfo();\n\n if (typeof content === 'string') {\n const result: TranslationContent<Content> = {\n nodeType: NodeType.Translation,\n ...stackTraceInfo,\n [intlayerConfiguration.internationalization.defaultLocale]: content,\n };\n\n return result;\n }\n\n const result: TranslationContent<Content> = {\n nodeType: NodeType.Translation,\n ...stackTraceInfo,\n ...content,\n };\n\n return result;\n};\n\nexport { translations as t };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoD;AAEpD,mBAAyB;AACzB,+BAGO;AAYP,MAAM,eAAe,CACnB,YACG;AACH,QAAM,qBAAiB,4CAAkB;AAEzC,MAAI,OAAO,YAAY,UAAU;AAC/B,UAAMA,UAAsC;AAAA,MAC1C,UAAU,sBAAS;AAAA,MACnB,GAAG;AAAA,MACH,CAAC,oCAAsB,qBAAqB,aAAa,GAAG;AAAA,IAC9D;AAEA,WAAOA;AAAA,EACT;AAEA,QAAM,SAAsC;AAAA,IAC1C,UAAU,sBAAS;AAAA,IACnB,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,SAAO;AACT;","names":["result"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Locales } from "@intlayer/config/client";
|
|
2
|
-
import { NoteStackTraceInfo } from "../../../utils/getStackTraceInfo.js";
|
|
3
|
-
import { NodeType } from "../../../types/nodeType.js";
|
|
4
|
-
|
|
5
|
-
type LanguageContent<Content> = Record<Locales, Content>;
|
|
6
|
-
type TranslationContent<Content> = Partial<LanguageContent<Content>> &
|
|
7
|
-
NoteStackTraceInfo & {
|
|
8
|
-
nodeType: NodeType.Translation;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Create a JSON with the content and the stack trace information
|
|
12
|
-
*/
|
|
13
|
-
declare const translations: <Content>(
|
|
14
|
-
content?: Partial<LanguageContent<Content>> | string
|
|
15
|
-
) => TranslationContent<Content>;
|
|
16
|
-
|
|
17
|
-
export { type LanguageContent, type TranslationContent, translations as t };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Locales } from "@intlayer/config/client";
|
|
2
|
-
import { NoteStackTraceInfo } from "../../../utils/getStackTraceInfo.mjs";
|
|
3
|
-
import { NodeType } from "../../../types/nodeType.mjs";
|
|
4
|
-
|
|
5
|
-
type LanguageContent<Content> = Record<Locales, Content>;
|
|
6
|
-
type TranslationContent<Content> = Partial<LanguageContent<Content>> &
|
|
7
|
-
NoteStackTraceInfo & {
|
|
8
|
-
nodeType: NodeType.Translation;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Create a JSON with the content and the stack trace information
|
|
12
|
-
*/
|
|
13
|
-
declare const translations: <Content>(
|
|
14
|
-
content?: Partial<LanguageContent<Content>> | string
|
|
15
|
-
) => TranslationContent<Content>;
|
|
16
|
-
|
|
17
|
-
export { type LanguageContent, type TranslationContent, translations as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/translations.ts"],"sourcesContent":["import { type Locales, intlayerConfiguration } from '@intlayer/config/client';\nimport type { ReactNode } from 'react';\nimport { NodeType } from '../../../types/index';\nimport {\n getStackTraceInfo,\n type NoteStackTraceInfo,\n} from '../../../utils/getStackTraceInfo';\n\nexport type LanguageContent<Content> = Record<Locales, Content>;\n\nexport type TranslationContent<Content> = Partial<LanguageContent<Content>> &\n NoteStackTraceInfo & {\n nodeType: NodeType.Translation;\n };\n\n/**\n * Create a JSON with the content and the stack trace information\n */\nconst translations = <Content>(\n content?: Partial<LanguageContent<Content>> | string\n) => {\n const stackTraceInfo = getStackTraceInfo();\n\n if (typeof content === 'string') {\n const result: TranslationContent<Content> = {\n nodeType: NodeType.Translation,\n ...stackTraceInfo,\n [intlayerConfiguration.internationalization.defaultLocale]: content,\n };\n\n return result;\n }\n\n const result: TranslationContent<Content> = {\n nodeType: NodeType.Translation,\n ...stackTraceInfo,\n ...content,\n };\n\n return result;\n};\n\nexport { translations as t };\n"],"mappings":"AAAA,SAAuB,6BAA6B;AAEpD,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,OAEK;AAYP,MAAM,eAAe,CACnB,YACG;AACH,QAAM,iBAAiB,kBAAkB;AAEzC,MAAI,OAAO,YAAY,UAAU;AAC/B,UAAMA,UAAsC;AAAA,MAC1C,UAAU,SAAS;AAAA,MACnB,GAAG;AAAA,MACH,CAAC,sBAAsB,qBAAqB,aAAa,GAAG;AAAA,IAC9D;AAEA,WAAOA;AAAA,EACT;AAEA,QAAM,SAAsC;AAAA,IAC1C,UAAU,SAAS;AAAA,IACnB,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,SAAO;AACT;","names":["result"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { type Locales, intlayerConfiguration } from '@intlayer/config/client';
|
|
2
|
-
import { NodeType } from '../../../types/index';
|
|
3
|
-
import {
|
|
4
|
-
getStackTraceInfo,
|
|
5
|
-
type NoteStackTraceInfo,
|
|
6
|
-
} from '../../../utils/getStackTraceInfo';
|
|
7
|
-
|
|
8
|
-
export type LanguageContent<Content> = Record<Locales, Content>;
|
|
9
|
-
|
|
10
|
-
export type TranslationContent<Content> = Partial<LanguageContent<Content>> &
|
|
11
|
-
NoteStackTraceInfo & {
|
|
12
|
-
nodeType: NodeType.Translation;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Create a JSON with the content and the stack trace information
|
|
17
|
-
*/
|
|
18
|
-
const translations = <Content>(
|
|
19
|
-
content?: Partial<LanguageContent<Content>> | string
|
|
20
|
-
) => {
|
|
21
|
-
const stackTraceInfo = getStackTraceInfo();
|
|
22
|
-
|
|
23
|
-
if (typeof content === 'string') {
|
|
24
|
-
const result: TranslationContent<Content> = {
|
|
25
|
-
nodeType: NodeType.Translation,
|
|
26
|
-
...stackTraceInfo,
|
|
27
|
-
[intlayerConfiguration.internationalization.defaultLocale]: content,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const result: TranslationContent<Content> = {
|
|
34
|
-
nodeType: NodeType.Translation,
|
|
35
|
-
...stackTraceInfo,
|
|
36
|
-
...content,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { translations as t };
|