@intlayer/core 3.5.3 → 3.5.5
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/{getHTMLLang.cjs → getLocaleLang.cjs} +7 -7
- package/dist/cjs/getLocaleLang.cjs.map +1 -0
- package/dist/cjs/getLocaleName.cjs +251 -233
- package/dist/cjs/getLocaleName.cjs.map +1 -1
- package/dist/cjs/getMultilingualUrls.cjs +4 -1
- package/dist/cjs/getMultilingualUrls.cjs.map +1 -1
- package/dist/cjs/index.cjs +3 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/localeNames/ar.cjs +262 -0
- package/dist/cjs/localeNames/ar.cjs.map +1 -0
- package/dist/cjs/localeNames/du.cjs +262 -0
- package/dist/cjs/localeNames/du.cjs.map +1 -0
- package/dist/cjs/localeNames/en.cjs +262 -0
- package/dist/cjs/localeNames/en.cjs.map +1 -0
- package/dist/cjs/localeNames/es.cjs +262 -0
- package/dist/cjs/localeNames/es.cjs.map +1 -0
- package/dist/cjs/localeNames/fr.cjs +262 -0
- package/dist/cjs/localeNames/fr.cjs.map +1 -0
- package/dist/cjs/localeNames/hi.cjs +262 -0
- package/dist/cjs/localeNames/hi.cjs.map +1 -0
- package/dist/cjs/localeNames/it.cjs +262 -0
- package/dist/cjs/localeNames/it.cjs.map +1 -0
- package/dist/cjs/localeNames/ja.cjs +262 -0
- package/dist/cjs/localeNames/ja.cjs.map +1 -0
- package/dist/cjs/localeNames/ko.cjs +262 -0
- package/dist/cjs/localeNames/ko.cjs.map +1 -0
- package/dist/cjs/localeNames/ownLocalesName.cjs +262 -0
- package/dist/cjs/localeNames/ownLocalesName.cjs.map +1 -0
- package/dist/cjs/localeNames/pt.cjs +262 -0
- package/dist/cjs/localeNames/pt.cjs.map +1 -0
- package/dist/cjs/localeNames/ru.cjs +262 -0
- package/dist/cjs/localeNames/ru.cjs.map +1 -0
- package/dist/cjs/localeNames/zh.cjs +262 -0
- package/dist/cjs/localeNames/zh.cjs.map +1 -0
- package/dist/cjs/types/declarationContent.cjs.map +1 -1
- package/dist/esm/getLocaleLang.mjs +5 -0
- package/dist/esm/getLocaleLang.mjs.map +1 -0
- package/dist/esm/getLocaleName.mjs +251 -233
- package/dist/esm/getLocaleName.mjs.map +1 -1
- package/dist/esm/getMultilingualUrls.mjs +4 -1
- package/dist/esm/getMultilingualUrls.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/localeNames/ar.mjs +238 -0
- package/dist/esm/localeNames/ar.mjs.map +1 -0
- package/dist/esm/localeNames/du.mjs +238 -0
- package/dist/esm/localeNames/du.mjs.map +1 -0
- package/dist/esm/localeNames/en.mjs +238 -0
- package/dist/esm/localeNames/en.mjs.map +1 -0
- package/dist/esm/localeNames/es.mjs +238 -0
- package/dist/esm/localeNames/es.mjs.map +1 -0
- package/dist/esm/localeNames/fr.mjs +238 -0
- package/dist/esm/localeNames/fr.mjs.map +1 -0
- package/dist/esm/localeNames/hi.mjs +238 -0
- package/dist/esm/localeNames/hi.mjs.map +1 -0
- package/dist/esm/localeNames/it.mjs +238 -0
- package/dist/esm/localeNames/it.mjs.map +1 -0
- package/dist/esm/localeNames/ja.mjs +238 -0
- package/dist/esm/localeNames/ja.mjs.map +1 -0
- package/dist/esm/localeNames/ko.mjs +238 -0
- package/dist/esm/localeNames/ko.mjs.map +1 -0
- package/dist/esm/localeNames/ownLocalesName.mjs +238 -0
- package/dist/esm/localeNames/ownLocalesName.mjs.map +1 -0
- package/dist/esm/localeNames/pt.mjs +238 -0
- package/dist/esm/localeNames/pt.mjs.map +1 -0
- package/dist/esm/localeNames/ru.mjs +238 -0
- package/dist/esm/localeNames/ru.mjs.map +1 -0
- package/dist/esm/localeNames/zh.mjs +238 -0
- package/dist/esm/localeNames/zh.mjs.map +1 -0
- package/dist/types/{getHTMLLang.d.ts → getLocaleLang.d.ts} +6 -6
- package/dist/types/getLocaleLang.d.ts.map +1 -0
- package/dist/types/getLocaleName.d.ts +8 -1
- package/dist/types/getLocaleName.d.ts.map +1 -1
- package/dist/types/getMultilingualUrls.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/localeNames/ar.d.ts +3 -0
- package/dist/types/localeNames/ar.d.ts.map +1 -0
- package/dist/types/localeNames/du.d.ts +3 -0
- package/dist/types/localeNames/du.d.ts.map +1 -0
- package/dist/types/localeNames/en.d.ts +3 -0
- package/dist/types/localeNames/en.d.ts.map +1 -0
- package/dist/types/localeNames/es.d.ts +3 -0
- package/dist/types/localeNames/es.d.ts.map +1 -0
- package/dist/types/localeNames/fr.d.ts +3 -0
- package/dist/types/localeNames/fr.d.ts.map +1 -0
- package/dist/types/localeNames/hi.d.ts +3 -0
- package/dist/types/localeNames/hi.d.ts.map +1 -0
- package/dist/types/localeNames/it.d.ts +3 -0
- package/dist/types/localeNames/it.d.ts.map +1 -0
- package/dist/types/localeNames/ja.d.ts +3 -0
- package/dist/types/localeNames/ja.d.ts.map +1 -0
- package/dist/types/localeNames/ko.d.ts +3 -0
- package/dist/types/localeNames/ko.d.ts.map +1 -0
- package/dist/types/localeNames/ownLocalesName.d.ts +3 -0
- package/dist/types/localeNames/ownLocalesName.d.ts.map +1 -0
- package/dist/types/localeNames/pt.d.ts +3 -0
- package/dist/types/localeNames/pt.d.ts.map +1 -0
- package/dist/types/localeNames/ru.d.ts +3 -0
- package/dist/types/localeNames/ru.d.ts.map +1 -0
- package/dist/types/localeNames/zh.d.ts +3 -0
- package/dist/types/localeNames/zh.d.ts.map +1 -0
- package/dist/types/types/declarationContent.d.ts +3 -3
- package/dist/types/types/declarationContent.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/cjs/getHTMLLang.cjs.map +0 -1
- package/dist/esm/getHTMLLang.mjs +0 -5
- package/dist/esm/getHTMLLang.mjs.map +0 -1
- package/dist/types/getHTMLLang.d.ts.map +0 -1
|
@@ -4,13 +4,13 @@ import type { Locales } from '@intlayer/config/client';
|
|
|
4
4
|
*
|
|
5
5
|
* Example:
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* getLocaleLang('en-US') // 'en'
|
|
8
|
+
* getLocaleLang('en') // 'en'
|
|
9
|
+
* getLocaleLang('fr-CA') // 'fr'
|
|
10
|
+
* getLocaleLang('fr') // 'fr'
|
|
11
11
|
*
|
|
12
12
|
* @param locale The locale to get the language code for.
|
|
13
13
|
* @returns The language code of the given locale.
|
|
14
14
|
*/
|
|
15
|
-
export declare const
|
|
16
|
-
//# sourceMappingURL=
|
|
15
|
+
export declare const getLocaleLang: (locale?: Locales) => string;
|
|
16
|
+
//# sourceMappingURL=getLocaleLang.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLocaleLang.d.ts","sourceRoot":"","sources":["../../src/getLocaleLang.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,YAAa,OAAO,KAAG,MACpB,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { Locales } from '@intlayer/config/client';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Given a displayLocale (the locale in which you want the name displayed)
|
|
4
|
+
* and a targetLocale (the locale whose name you want),
|
|
5
|
+
* returns the localized name.
|
|
6
|
+
*
|
|
7
|
+
* If no targetLocale is provided, the displayLocale's own name is returned.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getLocaleName: (displayLocale: Locales, targetLocale?: Locales) => string;
|
|
3
10
|
//# sourceMappingURL=getLocaleName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocaleName.d.ts","sourceRoot":"","sources":["../../src/getLocaleName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"getLocaleName.d.ts","sourceRoot":"","sources":["../../src/getLocaleName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA6PlD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,kBACT,OAAO,iBACP,OAAO,KACrB,MAWF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultilingualUrls.d.ts","sourceRoot":"","sources":["../../src/getMultilingualUrls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAY/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,QACzB,MAAM,YACF,OAAO,EAAE,kBACH,OAAO,kBACP,OAAO,KACrB,cAAc,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"getMultilingualUrls.d.ts","sourceRoot":"","sources":["../../src/getMultilingualUrls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAY/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,QACzB,MAAM,YACF,OAAO,EAAE,kBACH,OAAO,kBACP,OAAO,KACrB,cAAc,CAAC,MAAM,CAuDvB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type { ContentValue, Content, FlatContentValue, FlatContent, TypedNode, D
|
|
|
4
4
|
export { NodeType } from './types/index';
|
|
5
5
|
export { getLocaleName } from './getLocaleName';
|
|
6
6
|
export { getHTMLTextDir } from './getHTMLTextDir';
|
|
7
|
-
export {
|
|
7
|
+
export { getLocaleLang } from './getLocaleLang';
|
|
8
8
|
export { localeList } from './localeList';
|
|
9
9
|
export { isSameKeyPath } from './utils/isSameKeyPath';
|
|
10
10
|
export { localeDetector } from './localeDetector';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAAa,IAAI,OAAO,GACzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,CAAC,EACD,GAAG,EACH,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,SAAS,EACT,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,eAAe,EACf,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAAa,IAAI,OAAO,GACzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,CAAC,EACD,GAAG,EACH,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,SAAS,EACT,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,eAAe,EACf,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAwOjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"du.d.ts","sourceRoot":"","sources":["../../../src/localeNames/du.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA8OjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/localeNames/en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA4OlD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../src/localeNames/es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA2OlD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../src/localeNames/fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA2OjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hi.d.ts","sourceRoot":"","sources":["../../../src/localeNames/hi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA8OhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../../src/localeNames/it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA2OlD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ja.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ja.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAgPnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ko.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ko.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA8OjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownLocalesName.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ownLocalesName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAyOlD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pt.d.ts","sourceRoot":"","sources":["../../../src/localeNames/pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA2OrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ru.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA8OlD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../../src/localeNames/zh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA6OlD,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
1
|
import type { EnumerationContent, TranslationContent } from '../transpiler/index';
|
|
3
|
-
export type TypedNode = TranslationContent<
|
|
2
|
+
export type TypedNode<T = unknown> = TranslationContent<T> | EnumerationContent<T>;
|
|
4
3
|
export type ContentValue = string | string[] | number | number[] | {
|
|
5
4
|
[key: string]: ContentValue;
|
|
6
5
|
} | (() => ContentValue) | Promise<ContentValue> | TypedNode;
|
|
@@ -9,8 +8,9 @@ export type FlatContentValue = string | {
|
|
|
9
8
|
[key: string]: FlatContentValue;
|
|
10
9
|
} | TypedNode;
|
|
11
10
|
export type FlatContent = Record<string, FlatContentValue | undefined>;
|
|
11
|
+
type IsArray<T> = T extends any[] ? true : false;
|
|
12
12
|
type ReplaceContentValue<T> = {
|
|
13
|
-
[P in keyof T]: T[P] extends
|
|
13
|
+
[P in keyof T]: IsArray<T[P]> extends true ? ReplaceContentValueArray<T[P]> : T[P] extends object ? ReplaceContentValue<T[P]> : T[P] | TypedNode<T[P]>;
|
|
14
14
|
};
|
|
15
15
|
type ReplaceContentValueArray<T> = T extends (infer U)[] ? ReplaceContentValue<U>[] : ReplaceContentValue<T>;
|
|
16
16
|
export type DeclarationContent<T = undefined> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarationContent.d.ts","sourceRoot":"","sources":["../../../src/types/declarationContent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"declarationContent.d.ts","sourceRoot":"","sources":["../../../src/types/declarationContent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAC7B,kBAAkB,CAAC,CAAC,CAAC,GACrB,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE1B,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,MAAM,EAAE,GACR;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC7B,GACD,CAAC,MAAM,YAAY,CAAC,GACpB,OAAO,CAAC,YAAY,CAAC,GACrB,SAAS,CAAC;AAEd,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,SAAS,CAAC,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACjC,GACD,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC,CAAC;AAEvE,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,GAAG,IAAI,GAAG,KAAK,CAAC;AAGjD,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACtC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9B,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACzB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC7B,CAAC;AAEF,KAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACpD,mBAAmB,CAAC,CAAC,CAAC,EAAE,GACxB,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAE3B,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,SAAS,IAAI;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,SAAS,SAAS,GACxB,OAAO,GACP,mBAAmB,CAAC,CAAC,CAAC,CAAC;CAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.5",
|
|
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": [
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@formatjs/intl-localematcher": "^0.5.4",
|
|
62
62
|
"chokidar": "^3.6.0",
|
|
63
63
|
"negotiator": "^0.6.3",
|
|
64
|
-
"@intlayer/config": "^3.5.
|
|
64
|
+
"@intlayer/config": "^3.5.5"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/negotiator": "^0.6.3",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"tsup": "^8.3.5",
|
|
76
76
|
"typescript": "^5.7.2",
|
|
77
77
|
"@utils/eslint-config": "^1.0.4",
|
|
78
|
+
"@utils/tsup-config": "^1.0.4",
|
|
78
79
|
"@utils/ts-config": "^1.0.4",
|
|
79
|
-
"@utils/ts-config-types": "^1.0.4"
|
|
80
|
-
"@utils/tsup-config": "^1.0.4"
|
|
80
|
+
"@utils/ts-config-types": "^1.0.4"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"react": ">=16.0.0 <19.0.0",
|
|
84
|
-
"@intlayer/config": "^3.5.
|
|
84
|
+
"@intlayer/config": "^3.5.5"
|
|
85
85
|
},
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=14.18"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/getHTMLLang.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\n\n/**\n * Returns the language code of the given locale for locales including the country code.\n *\n * Example:\n *\n * getHTMLLang('en-US') // 'en'\n * getHTMLLang('en') // 'en'\n * getHTMLLang('fr-CA') // 'fr'\n * getHTMLLang('fr') // 'fr'\n *\n * @param locale The locale to get the language code for.\n * @returns The language code of the given locale.\n */\nexport const getHTMLLang = (locale?: Locales): string =>\n locale?.split('-')[0] ?? '';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,MAAM,cAAc,CAAC,WAC1B,QAAQ,MAAM,GAAG,EAAE,CAAC,KAAK;","names":[]}
|
package/dist/esm/getHTMLLang.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/getHTMLLang.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\n\n/**\n * Returns the language code of the given locale for locales including the country code.\n *\n * Example:\n *\n * getHTMLLang('en-US') // 'en'\n * getHTMLLang('en') // 'en'\n * getHTMLLang('fr-CA') // 'fr'\n * getHTMLLang('fr') // 'fr'\n *\n * @param locale The locale to get the language code for.\n * @returns The language code of the given locale.\n */\nexport const getHTMLLang = (locale?: Locales): string =>\n locale?.split('-')[0] ?? '';\n"],"mappings":"AAeO,MAAM,cAAc,CAAC,WAC1B,QAAQ,MAAM,GAAG,EAAE,CAAC,KAAK;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getHTMLLang.d.ts","sourceRoot":"","sources":["../../src/getHTMLLang.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,YAAa,OAAO,KAAG,MAClB,CAAC"}
|