generaltranslation 3.3.3 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/id.cjs.min.cjs +2 -0
- package/dist/id.cjs.min.cjs.map +1 -0
- package/dist/id.d.ts +7 -0
- package/dist/id.esm.min.mjs +2 -0
- package/dist/id.esm.min.mjs.map +1 -0
- package/dist/index.cjs.min.cjs +1 -1
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +100 -79
- package/dist/index.esm.min.mjs +1 -1
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/internal.cjs.min.cjs +1 -1
- package/dist/internal.cjs.min.cjs.map +1 -1
- package/dist/internal.d.ts +8 -8
- package/dist/internal.esm.min.mjs +1 -1
- package/dist/internal.esm.min.mjs.map +1 -1
- package/dist/locales/_determineLocale.d.ts +1 -0
- package/dist/locales/_getLocaleDirection.d.ts +1 -0
- package/dist/locales/_getLocaleEmoji.d.ts +1 -0
- package/dist/locales/_getLocaleName.d.ts +1 -0
- package/dist/locales/_getLocaleProperties.d.ts +1 -0
- package/dist/locales/_isSameLanguage.d.ts +1 -0
- package/dist/locales/_isValidLocale.d.ts +1 -0
- package/dist/locales/_requiresTranslation.d.ts +1 -0
- package/dist/projects/_getProjectLocales.d.ts +1 -0
- package/dist/settings/defaultAPIRoutes.d.ts +1 -1
- package/dist/settings/libraryDefaultLanguage.d.ts +1 -1
- package/dist/settings/libraryDefaultLocale.d.ts +2 -0
- package/dist/types/types.d.ts +5 -5
- package/package.json +13 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
var e="en-US",t="generaltranslation.locale",a=["singular","plural","dual","zero","one","two","few","many","other"],n="https://cache.gtx.dev",l="https://prod.gtx.dev",r="x-generaltranslation-locale";function o(e){return a.includes(e)}export{l as defaultAPIURL,n as defaultCacheURL,o as isAcceptedPluralForm,e as libraryDefaultLocale,t as localeCookieName,r as localeHeaderName,a as pluralForms};
|
2
2
|
//# sourceMappingURL=internal.esm.min.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"internal.esm.min.mjs","sources":["../src/internal.ts"],"sourcesContent":["
|
1
|
+
{"version":3,"file":"internal.esm.min.mjs","sources":["../src/internal.ts"],"sourcesContent":["export const libraryDefaultLocale = \"en-US\" as const;\nexport const localeCookieName = \"generaltranslation.locale\" as const;\nexport const pluralForms = [\"singular\", \"plural\", \"dual\", \"zero\", \"one\", \"two\", \"few\", \"many\", \"other\"] as const;\nexport const defaultCacheURL = \"https://cache.gtx.dev\" as const;\nexport const defaultAPIURL = \"https://prod.gtx.dev\" as const;\nexport const localeHeaderName = \"x-generaltranslation-locale\";\nexport function isAcceptedPluralForm(\n form: string\n ): form is (typeof pluralForms)[number] {\n return pluralForms.includes(form as (typeof pluralForms)[number]);\n}"],"names":["libraryDefaultLocale","localeCookieName","pluralForms","defaultCacheURL","defaultAPIURL","localeHeaderName","isAcceptedPluralForm","form","includes"],"mappings":"AAAO,IAAMA,EAAuB,QACvBC,EAAmB,4BACnBC,EAAc,CAAC,WAAY,SAAU,OAAQ,OAAQ,MAAO,MAAO,MAAO,OAAQ,SAClFC,EAAkB,wBAClBC,EAAgB,uBAChBC,EAAmB,8BAC1B,SAAUC,EACZC,GAEA,OAAOL,EAAYM,SAASD,EAChC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const defaultEmoji = "\uD83C\uDF0D";
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -3,6 +3,6 @@ declare const defaultAPIRoutes: {
|
|
3
3
|
readonly translateReact: "/v1/translate/react";
|
4
4
|
readonly translateContent: "/v1/translate/content";
|
5
5
|
readonly updateProjectDictionary: "/v1/project/dictionary/update";
|
6
|
-
readonly
|
6
|
+
readonly getProjectLocales: "/v1/project/locales";
|
7
7
|
};
|
8
8
|
export default defaultAPIRoutes;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const libraryDefaultLanguage = "en";
|
1
|
+
declare const libraryDefaultLanguage = "en-US";
|
2
2
|
export default libraryDefaultLanguage;
|
package/dist/types/types.d.ts
CHANGED
@@ -33,28 +33,28 @@ export type Request = {
|
|
33
33
|
type: 'string';
|
34
34
|
data: {
|
35
35
|
content: Content;
|
36
|
-
|
36
|
+
targetLocale: string;
|
37
37
|
metadata: Record<string, any>;
|
38
38
|
};
|
39
39
|
} | {
|
40
40
|
type: 'react';
|
41
41
|
data: {
|
42
42
|
children: any;
|
43
|
-
|
43
|
+
targetLocale: string;
|
44
44
|
metadata: Record<string, any>;
|
45
45
|
};
|
46
46
|
};
|
47
47
|
export type ContentTranslationResult = {
|
48
48
|
translation: Content;
|
49
|
-
|
49
|
+
locale: string;
|
50
50
|
reference?: {
|
51
51
|
id: string;
|
52
52
|
key: string;
|
53
53
|
};
|
54
54
|
};
|
55
55
|
export type ReactTranslationResult = {
|
56
|
-
translation:
|
57
|
-
|
56
|
+
translation: ReactChildrenAsObject;
|
57
|
+
locale: string;
|
58
58
|
reference?: {
|
59
59
|
id: string;
|
60
60
|
key: string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "generaltranslation",
|
3
|
-
"version": "
|
3
|
+
"version": "4.0.1",
|
4
4
|
"description": "A language toolkit for AI developers",
|
5
5
|
"main": "dist/index.cjs.min.cjs",
|
6
6
|
"module": "dist/index.esm.min.mjs",
|
@@ -21,6 +21,7 @@
|
|
21
21
|
"internationalization",
|
22
22
|
"localization",
|
23
23
|
"translate",
|
24
|
+
"locale",
|
24
25
|
"i18n",
|
25
26
|
"toolkit"
|
26
27
|
],
|
@@ -53,6 +54,11 @@
|
|
53
54
|
"require": "./dist/index.cjs.min.cjs",
|
54
55
|
"import": "./dist/index.esm.min.mjs"
|
55
56
|
},
|
57
|
+
"./id": {
|
58
|
+
"types": "./dist/id.d.ts",
|
59
|
+
"require": "./dist/id.cjs.min.cjs",
|
60
|
+
"import": "./dist/id.esm.min.mjs"
|
61
|
+
},
|
56
62
|
"./internal": {
|
57
63
|
"types": "./dist/internal.d.ts",
|
58
64
|
"require": "./dist/internal.cjs.min.cjs",
|
@@ -63,6 +69,9 @@
|
|
63
69
|
"*": {
|
64
70
|
"internal": [
|
65
71
|
"./dist/internal.d.ts"
|
72
|
+
],
|
73
|
+
"id": [
|
74
|
+
"./dist/id.d.ts"
|
66
75
|
]
|
67
76
|
}
|
68
77
|
},
|
@@ -71,6 +80,9 @@
|
|
71
80
|
"paths": {
|
72
81
|
"generaltranslation/internal": [
|
73
82
|
"/dist/internal"
|
83
|
+
],
|
84
|
+
"generaltranslation/id": [
|
85
|
+
"/dist/id"
|
74
86
|
]
|
75
87
|
}
|
76
88
|
}
|