generaltranslation 7.4.3 → 7.5.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/CHANGELOG.md +6 -0
- package/dist/index.cjs.min.cjs +1 -1
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +36 -6
- package/dist/index.esm.min.mjs +3 -3
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/locales/customLocaleMapping.d.ts +1 -0
- package/dist/locales/getLocaleProperties.d.ts +9 -0
- package/dist/locales/resolveAliasLocale.d.ts +8 -0
- package/dist/translate/uploadFiles.d.ts +1 -0
- package/dist/types-dir/uploadFiles.d.ts +23 -0
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
@@ -2,3 +2,4 @@ import { LocaleProperties } from './getLocaleProperties';
|
|
2
2
|
export type FullCustomMapping = Record<string, LocaleProperties>;
|
3
3
|
export type CustomMapping = Record<string, string | Partial<LocaleProperties>>;
|
4
4
|
export declare const getCustomProperty: (customMapping: CustomMapping, locale: string, property: keyof LocaleProperties) => string | undefined;
|
5
|
+
export declare const shouldUseCanonicalLocale: (locale: string, customMapping: CustomMapping) => boolean;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { CustomMapping } from './customLocaleMapping';
|
1
2
|
export type LocaleProperties = {
|
2
3
|
code: string;
|
3
4
|
name: string;
|
@@ -21,3 +22,11 @@ export type LocaleProperties = {
|
|
21
22
|
nativeMinimizedName: string;
|
22
23
|
emoji: string;
|
23
24
|
};
|
25
|
+
/**
|
26
|
+
* Creates a set of custom locale properties from a custom mapping.
|
27
|
+
*
|
28
|
+
* @param lArray - An array of locale codes to search for in the custom mapping.
|
29
|
+
* @param customMapping - Optional custom mapping of locale codes to names.
|
30
|
+
* @returns A partial set of locale properties, or undefined if no custom mapping is provided.
|
31
|
+
*/
|
32
|
+
export declare function createCustomLocaleProperties(lArray: string[], customMapping?: CustomMapping): Partial<LocaleProperties> | undefined;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { CustomMapping } from './customLocaleMapping';
|
2
|
+
/**
|
3
|
+
* Resolves the alias locale for a given locale.
|
4
|
+
* @param locale - The locale to resolve the alias locale for
|
5
|
+
* @param customMapping - The custom mapping to use for resolving the alias locale
|
6
|
+
* @returns The alias locale
|
7
|
+
*/
|
8
|
+
export declare function _resolveAliasLocale(locale: string, customMapping?: CustomMapping): string;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { DataFormat } from './content';
|
2
|
+
import { FileFormat } from './file';
|
3
|
+
export type FileUpload = {
|
4
|
+
content: string;
|
5
|
+
fileName: string;
|
6
|
+
fileFormat: FileFormat;
|
7
|
+
dataFormat?: DataFormat;
|
8
|
+
locale: string;
|
9
|
+
};
|
10
|
+
export type UploadData = {
|
11
|
+
data: {
|
12
|
+
source: FileUpload;
|
13
|
+
translations: FileUpload[];
|
14
|
+
}[];
|
15
|
+
sourceLocale: string;
|
16
|
+
modelProvider?: string;
|
17
|
+
};
|
18
|
+
export type UploadFilesOptions = {
|
19
|
+
sourceLocale: string;
|
20
|
+
modelProvider?: string;
|
21
|
+
timeout?: number;
|
22
|
+
};
|
23
|
+
export type RequiredUploadFilesOptions = UploadFilesOptions & Required<Pick<UploadFilesOptions, 'sourceLocale'>>;
|
package/dist/types.d.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
type CustomMapping = Record<string, string | Partial<LocaleProperties>>;
|
2
|
+
|
1
3
|
type LocaleProperties = {
|
2
4
|
code: string;
|
3
5
|
name: string;
|
@@ -300,8 +302,6 @@ type TranslationResult = RequestSuccess | TranslationError;
|
|
300
302
|
*/
|
301
303
|
type TranslateManyResult = Array<TranslationResult>;
|
302
304
|
|
303
|
-
type CustomMapping = Record<string, string | Partial<LocaleProperties>>;
|
304
|
-
|
305
305
|
/**
|
306
306
|
* @deprecated Use {@link Content} instead.
|
307
307
|
*/
|