generaltranslation 7.6.3 → 7.6.4-alpha.2
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/id.cjs.min.cjs.map +1 -1
- package/dist/id.d.ts +76 -2
- package/dist/id.esm.min.mjs.map +1 -1
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +391 -32
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/internal.cjs.min.cjs.map +1 -1
- package/dist/internal.d.ts +183 -14
- package/dist/internal.esm.min.mjs.map +1 -1
- package/package.json +15 -15
package/dist/index.d.ts
CHANGED
@@ -1,15 +1,373 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
type CustomMapping = Record<string, string | Partial<LocaleProperties>>;
|
2
|
+
|
3
|
+
type LocaleProperties = {
|
4
|
+
code: string;
|
5
|
+
name: string;
|
6
|
+
nativeName: string;
|
7
|
+
languageCode: string;
|
8
|
+
languageName: string;
|
9
|
+
nativeLanguageName: string;
|
10
|
+
nameWithRegionCode: string;
|
11
|
+
nativeNameWithRegionCode: string;
|
12
|
+
regionCode: string;
|
13
|
+
regionName: string;
|
14
|
+
nativeRegionName: string;
|
15
|
+
scriptCode: string;
|
16
|
+
scriptName: string;
|
17
|
+
nativeScriptName: string;
|
18
|
+
maximizedCode: string;
|
19
|
+
maximizedName: string;
|
20
|
+
nativeMaximizedName: string;
|
21
|
+
minimizedCode: string;
|
22
|
+
minimizedName: string;
|
23
|
+
nativeMinimizedName: string;
|
24
|
+
emoji: string;
|
25
|
+
};
|
26
|
+
|
27
|
+
type VariableType = 'v' | 'n' | 'd' | 'c';
|
28
|
+
/**
|
29
|
+
* Variables are used to store the variable name and type.
|
30
|
+
*/
|
31
|
+
type Variable = {
|
32
|
+
k: string;
|
33
|
+
i?: number;
|
34
|
+
v?: VariableType;
|
35
|
+
};
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Map of data-_gt properties to their corresponding React props
|
39
|
+
*/
|
40
|
+
declare const HTML_CONTENT_PROPS: {
|
41
|
+
readonly pl: "placeholder";
|
42
|
+
readonly ti: "title";
|
43
|
+
readonly alt: "alt";
|
44
|
+
readonly arl: "aria-label";
|
45
|
+
readonly arb: "aria-labelledby";
|
46
|
+
readonly ard: "aria-describedby";
|
47
|
+
};
|
48
|
+
type HtmlContentPropKeysRecord = Partial<Record<keyof typeof HTML_CONTENT_PROPS, string>>;
|
49
|
+
/**
|
50
|
+
* GTProp is an internal property used to contain data for translating and rendering elements.
|
51
|
+
* note, transformations are only read on the server side if they are 'plural' or 'branch'
|
52
|
+
*/
|
53
|
+
type GTProp = {
|
54
|
+
b?: Record<string, JsxChildren>;
|
55
|
+
t?: 'p' | 'b';
|
56
|
+
} & HtmlContentPropKeysRecord;
|
57
|
+
type JsxElement = {
|
58
|
+
t?: string;
|
59
|
+
i?: number;
|
60
|
+
d?: GTProp;
|
61
|
+
c?: JsxChildren;
|
62
|
+
};
|
63
|
+
type JsxChild = string | JsxElement | Variable;
|
64
|
+
/**
|
65
|
+
* The format of the content
|
66
|
+
*/
|
67
|
+
type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';
|
68
|
+
/**
|
69
|
+
* A content type representing JSX, ICU, and I18next messages
|
70
|
+
*/
|
71
|
+
type Content = JsxChildren | IcuMessage | I18nextMessage;
|
72
|
+
/**
|
73
|
+
* A content type representing JSX elements
|
74
|
+
*/
|
75
|
+
type JsxChildren = JsxChild | JsxChild[];
|
76
|
+
/**
|
77
|
+
* A content type representing ICU messages
|
78
|
+
*/
|
79
|
+
type IcuMessage = string;
|
80
|
+
/**
|
81
|
+
* A content type representing I18next messages
|
82
|
+
*/
|
83
|
+
type I18nextMessage = string;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* ActionType is the type of action to perform on the request.
|
87
|
+
*
|
88
|
+
* @param standard - The standard action type (standard model).
|
89
|
+
* @param fast - The fast action type (mini model).
|
90
|
+
* @param string - Other model
|
91
|
+
*/
|
92
|
+
type ActionType = 'standard' | 'fast' | string;
|
93
|
+
/**
|
94
|
+
* EntryMetadata is the metadata for a GTRequest.
|
95
|
+
*
|
96
|
+
* @param context - The context of the request.
|
97
|
+
* @param id - The id of the request.
|
98
|
+
* @param hash - The hash of the request.
|
99
|
+
*/
|
100
|
+
type EntryMetadata = {
|
101
|
+
context?: string;
|
102
|
+
id?: string;
|
103
|
+
hash?: string;
|
104
|
+
dataFormat?: DataFormat;
|
105
|
+
sourceLocale?: string;
|
106
|
+
actionType?: ActionType;
|
107
|
+
timeout?: number;
|
108
|
+
regionCode?: string;
|
109
|
+
scriptCode?: string;
|
110
|
+
};
|
111
|
+
/**
|
112
|
+
* GTRequest is a translation request object for {@link JsxChildren} | {@link IcuMessage} | {@link I18nextMessage}
|
113
|
+
*
|
114
|
+
* @param source - The source content to translate.
|
115
|
+
* @param targetLocale - The target locale to translate to.
|
116
|
+
* @param metadata - The metadata for the request.
|
117
|
+
*/
|
118
|
+
type Entry = {
|
119
|
+
source: Content;
|
120
|
+
targetLocale?: string;
|
121
|
+
metadata?: EntryMetadata;
|
122
|
+
};
|
123
|
+
|
124
|
+
type TranslationStatusResult = {
|
125
|
+
count: number;
|
126
|
+
availableLocales: string[];
|
127
|
+
locales: string[];
|
128
|
+
localesWaitingForApproval: any[];
|
129
|
+
};
|
130
|
+
type CheckTranslationStatusOptions = {
|
131
|
+
timeout?: number;
|
132
|
+
};
|
133
|
+
|
134
|
+
type FileFormat = 'GTJSON' | 'JSON' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS' | 'HTML';
|
135
|
+
type CompletedFileTranslationData = {
|
136
|
+
locale: string;
|
137
|
+
metadata: any;
|
138
|
+
fileId: string;
|
139
|
+
fileName: string;
|
140
|
+
versionId: string;
|
141
|
+
id: string;
|
142
|
+
isReady: boolean;
|
143
|
+
downloadUrl: string;
|
144
|
+
};
|
145
|
+
|
146
|
+
type FileTranslationQuery = {
|
147
|
+
versionId: string;
|
148
|
+
fileName?: string;
|
149
|
+
fileId?: string;
|
150
|
+
locale: string;
|
151
|
+
};
|
152
|
+
type CheckFileTranslationsOptions = {
|
153
|
+
timeout?: number;
|
154
|
+
};
|
155
|
+
type CheckFileTranslationsResult = {
|
156
|
+
translations: CompletedFileTranslationData[];
|
157
|
+
};
|
158
|
+
type FileQuery = {
|
159
|
+
fileId: string;
|
160
|
+
versionId?: string;
|
161
|
+
};
|
162
|
+
type FileQueryResult = {
|
163
|
+
sourceFile: {
|
164
|
+
id: string;
|
165
|
+
fileId: string;
|
166
|
+
versionId: string;
|
167
|
+
sourceLocale: string;
|
168
|
+
fileName: string;
|
169
|
+
fileFormat: string;
|
170
|
+
dataFormat: string | null;
|
171
|
+
createdAt: string;
|
172
|
+
updatedAt: string;
|
173
|
+
approvalRequiredAt: string | null;
|
174
|
+
locales: string[];
|
175
|
+
};
|
176
|
+
translations: {
|
177
|
+
locale: string;
|
178
|
+
completedAt: string | null;
|
179
|
+
approvedAt: string | null;
|
180
|
+
publishedAt: string | null;
|
181
|
+
createdAt: string | null;
|
182
|
+
updatedAt: string | null;
|
183
|
+
}[];
|
184
|
+
};
|
185
|
+
|
186
|
+
type DownloadFileBatchOptions = {
|
187
|
+
timeout?: number;
|
188
|
+
};
|
189
|
+
type File = {
|
190
|
+
id: string;
|
191
|
+
fileName: string;
|
192
|
+
data: string;
|
193
|
+
metadata: any;
|
194
|
+
};
|
195
|
+
type DownloadFileBatchResult = {
|
196
|
+
files: File[];
|
197
|
+
count: number;
|
198
|
+
};
|
199
|
+
|
200
|
+
type FetchTranslationsOptions = {
|
201
|
+
timeout?: number;
|
202
|
+
};
|
203
|
+
type RetrievedTranslation = {
|
204
|
+
locale: string;
|
205
|
+
translation: any;
|
206
|
+
};
|
207
|
+
type RetrievedTranslations = RetrievedTranslation[];
|
208
|
+
type FetchTranslationsResult = {
|
209
|
+
translations: RetrievedTranslations;
|
210
|
+
};
|
211
|
+
|
212
|
+
type Updates = ({
|
213
|
+
metadata: Record<string, any>;
|
214
|
+
} & ({
|
215
|
+
dataFormat: 'JSX';
|
216
|
+
source: JsxChildren;
|
217
|
+
} | {
|
218
|
+
dataFormat: 'ICU';
|
219
|
+
source: string;
|
220
|
+
} | {
|
221
|
+
dataFormat: 'I18NEXT';
|
222
|
+
source: string;
|
223
|
+
}))[];
|
224
|
+
type EnqueueFilesResult = {
|
225
|
+
translations: CompletedFileTranslationData[];
|
226
|
+
data: Record<string, {
|
227
|
+
fileName: string;
|
228
|
+
versionId: string;
|
229
|
+
}>;
|
230
|
+
locales: string[];
|
231
|
+
message: string;
|
232
|
+
};
|
233
|
+
|
234
|
+
type EnqueueEntriesOptions = {
|
235
|
+
timeout?: number;
|
236
|
+
sourceLocale?: string;
|
237
|
+
targetLocales?: string[];
|
238
|
+
dataFormat?: DataFormat;
|
239
|
+
version?: string;
|
240
|
+
description?: string;
|
241
|
+
requireApproval?: boolean;
|
242
|
+
modelProvider?: string;
|
243
|
+
};
|
244
|
+
type EnqueueEntriesResult = {
|
245
|
+
versionId: string;
|
246
|
+
locales: string[];
|
247
|
+
message: string;
|
248
|
+
projectSettings: {
|
249
|
+
cdnEnabled: boolean;
|
250
|
+
requireApproval: boolean;
|
251
|
+
};
|
252
|
+
};
|
253
|
+
|
254
|
+
type DownloadFileOptions = {
|
255
|
+
timeout?: number;
|
256
|
+
};
|
257
|
+
|
258
|
+
/**
|
259
|
+
* TranslationResultReference is used to store the reference for a translation result.
|
260
|
+
*/
|
261
|
+
type TranslationResultReference = {
|
262
|
+
id?: string;
|
263
|
+
hash: string;
|
264
|
+
};
|
265
|
+
/**
|
266
|
+
* TypedResult is a union type that represents the different types of translations that can be returned.
|
267
|
+
*/
|
268
|
+
type TypedResult = {
|
269
|
+
translation: JsxChildren;
|
270
|
+
dataFormat: 'JSX';
|
271
|
+
} | {
|
272
|
+
translation: I18nextMessage | IcuMessage;
|
273
|
+
dataFormat: 'ICU' | 'I18NEXT';
|
274
|
+
};
|
275
|
+
/**
|
276
|
+
* RequestError is a type that represents an error that occurred during a translation request.
|
277
|
+
*/
|
278
|
+
type TranslationError = {
|
279
|
+
error: string;
|
280
|
+
code: number;
|
281
|
+
reference?: TranslationResultReference;
|
282
|
+
};
|
283
|
+
/**
|
284
|
+
* RequestSuccess is a type that represents a successful translation request.
|
285
|
+
*/
|
286
|
+
type RequestSuccess = TypedResult & {
|
287
|
+
locale: string;
|
288
|
+
reference: TranslationResultReference;
|
289
|
+
};
|
290
|
+
type TranslationResult = RequestSuccess | TranslationError;
|
291
|
+
|
292
|
+
/**
|
293
|
+
* BatchTranslationResult is the result of a batch translation request.
|
294
|
+
*/
|
295
|
+
type TranslateManyResult = Array<TranslationResult>;
|
296
|
+
|
297
|
+
type FormatVariables = Record<string, string | number | boolean | null | undefined | Date>;
|
298
|
+
|
299
|
+
type SetupProjectResult = {
|
300
|
+
setupJobId: string;
|
301
|
+
status: 'queued';
|
302
|
+
};
|
303
|
+
|
304
|
+
type SetupJobStatus = 'queued' | 'processing' | 'completed' | 'failed';
|
305
|
+
type CheckSetupStatusResult = {
|
306
|
+
jobId: string;
|
307
|
+
status: SetupJobStatus;
|
308
|
+
error?: {
|
309
|
+
message: string;
|
310
|
+
};
|
311
|
+
};
|
312
|
+
|
313
|
+
type ShouldSetupProjectResult = {
|
314
|
+
shouldSetupProject: boolean;
|
315
|
+
};
|
316
|
+
|
317
|
+
type EnqueueOptions = {
|
318
|
+
sourceLocale: string;
|
319
|
+
targetLocales: string[];
|
320
|
+
publish?: boolean;
|
321
|
+
requireApproval?: boolean;
|
322
|
+
modelProvider?: string;
|
323
|
+
force?: boolean;
|
324
|
+
timeout?: number;
|
325
|
+
};
|
326
|
+
|
327
|
+
type CustomRegionMapping = {
|
328
|
+
[region: string]: {
|
329
|
+
name?: string;
|
330
|
+
emoji?: string;
|
331
|
+
locale?: string;
|
332
|
+
};
|
333
|
+
};
|
334
|
+
|
335
|
+
type FileUpload = {
|
336
|
+
content: string;
|
337
|
+
fileName: string;
|
338
|
+
fileFormat: FileFormat;
|
339
|
+
dataFormat?: DataFormat;
|
340
|
+
locale: string;
|
341
|
+
versionId?: string;
|
342
|
+
fileId?: string;
|
343
|
+
};
|
344
|
+
type FileUploadRef = {
|
345
|
+
fileId: string;
|
346
|
+
versionId: string;
|
347
|
+
fileName: string;
|
348
|
+
fileFormat: FileFormat;
|
349
|
+
dataFormat?: DataFormat;
|
350
|
+
locale?: string;
|
351
|
+
};
|
352
|
+
type UploadFilesOptions = {
|
353
|
+
sourceLocale: string;
|
354
|
+
modelProvider?: string;
|
355
|
+
timeout?: number;
|
356
|
+
};
|
357
|
+
type UploadFilesResponse = {
|
358
|
+
uploadedFiles: FileUploadRef[];
|
359
|
+
count: number;
|
360
|
+
message: string;
|
361
|
+
};
|
362
|
+
|
363
|
+
type ProjectData = {
|
364
|
+
id: string;
|
365
|
+
name: string;
|
366
|
+
orgId: string;
|
367
|
+
defaultLocale: string;
|
368
|
+
currentLocales: string[];
|
369
|
+
};
|
370
|
+
|
13
371
|
/**
|
14
372
|
* Type representing the constructor parameters for the GT class.
|
15
373
|
* @typedef {Object} GTConstructorParams
|
@@ -46,7 +404,7 @@ type GTConstructorParams = {
|
|
46
404
|
* locales: ['en-US', 'es-ES', 'fr-FR']
|
47
405
|
* });
|
48
406
|
*/
|
49
|
-
|
407
|
+
declare class GT {
|
50
408
|
/** Base URL for the translation service API */
|
51
409
|
baseUrl?: string;
|
52
410
|
/** Project ID for the translation service */
|
@@ -781,7 +1139,7 @@ export declare class GT {
|
|
781
1139
|
* formatMessage('Hello {name}', { name: 'John' }, { locales: ['fr'] });
|
782
1140
|
* // Returns: "Bonjour John"
|
783
1141
|
*/
|
784
|
-
|
1142
|
+
declare function formatMessage(message: string, options?: {
|
785
1143
|
locales?: string | string[];
|
786
1144
|
variables?: FormatVariables;
|
787
1145
|
}): string;
|
@@ -793,7 +1151,7 @@ export declare function formatMessage(message: string, options?: {
|
|
793
1151
|
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
794
1152
|
* @returns {string} The formatted number.
|
795
1153
|
*/
|
796
|
-
|
1154
|
+
declare function formatNum(number: number, options: {
|
797
1155
|
locales: string | string[];
|
798
1156
|
} & Intl.NumberFormatOptions): string;
|
799
1157
|
/**
|
@@ -804,7 +1162,7 @@ export declare function formatNum(number: number, options: {
|
|
804
1162
|
* @param {string | string[]} [params.options.locales] - The languages to use for formatting.
|
805
1163
|
* @returns {string} The formatted date.
|
806
1164
|
*/
|
807
|
-
|
1165
|
+
declare function formatDateTime(date: Date, options?: {
|
808
1166
|
locales?: string | string[];
|
809
1167
|
} & Intl.DateTimeFormatOptions): string;
|
810
1168
|
/**
|
@@ -816,7 +1174,7 @@ export declare function formatDateTime(date: Date, options?: {
|
|
816
1174
|
* @param {string | string[]} [params.options.locales] - The locale codes to use for formatting.
|
817
1175
|
* @returns {string} The formatted currency value.
|
818
1176
|
*/
|
819
|
-
|
1177
|
+
declare function formatCurrency(value: number, currency: string, options: {
|
820
1178
|
locales: string | string[];
|
821
1179
|
} & Intl.NumberFormatOptions): string;
|
822
1180
|
/**
|
@@ -827,7 +1185,7 @@ export declare function formatCurrency(value: number, currency: string, options:
|
|
827
1185
|
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
828
1186
|
* @returns {string} The formatted list.
|
829
1187
|
*/
|
830
|
-
|
1188
|
+
declare function formatList(array: Array<string | number>, options: {
|
831
1189
|
locales: string | string[];
|
832
1190
|
} & Intl.ListFormatOptions): string;
|
833
1191
|
/**
|
@@ -839,7 +1197,7 @@ export declare function formatList(array: Array<string | number>, options: {
|
|
839
1197
|
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
840
1198
|
* @returns {string} The formatted relative time string.
|
841
1199
|
*/
|
842
|
-
|
1200
|
+
declare function formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options: {
|
843
1201
|
locales: string | string[];
|
844
1202
|
} & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
|
845
1203
|
/**
|
@@ -850,7 +1208,7 @@ export declare function formatRelativeTime(value: number, unit: Intl.RelativeTim
|
|
850
1208
|
* @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
|
851
1209
|
* @returns {string} The display name corresponding to the code.
|
852
1210
|
*/
|
853
|
-
|
1211
|
+
declare function getLocaleName(locale: string, defaultLocale?: string, customMapping?: CustomMapping): string;
|
854
1212
|
/**
|
855
1213
|
* Retrieves an emoji based on a given locale code, taking into account region, language, and specific exceptions.
|
856
1214
|
*
|
@@ -860,7 +1218,7 @@ export declare function getLocaleName(locale: string, defaultLocale?: string, cu
|
|
860
1218
|
* @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
|
861
1219
|
* @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.
|
862
1220
|
*/
|
863
|
-
|
1221
|
+
declare function getLocaleEmoji(locale: string, customMapping?: CustomMapping): string;
|
864
1222
|
/**
|
865
1223
|
* Generates linguistic details for a given locale code.
|
866
1224
|
*
|
@@ -895,7 +1253,7 @@ export declare function getLocaleEmoji(locale: string, customMapping?: CustomMap
|
|
895
1253
|
* @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., "Österreichisches Deutsch".
|
896
1254
|
* @property {string} emoji - The emoji associated with the locale's region, if applicable.
|
897
1255
|
*/
|
898
|
-
|
1256
|
+
declare function getLocaleProperties(locale: string, defaultLocale?: string, customMapping?: CustomMapping): LocaleProperties;
|
899
1257
|
/**
|
900
1258
|
* Determines whether a translation is required based on the source and target locales.
|
901
1259
|
*
|
@@ -910,53 +1268,53 @@ export declare function getLocaleProperties(locale: string, defaultLocale?: stri
|
|
910
1268
|
*
|
911
1269
|
* @returns {boolean} - Returns `true` if translation is required, otherwise `false`.
|
912
1270
|
*/
|
913
|
-
|
1271
|
+
declare function requiresTranslation(sourceLocale: string, targetLocale: string, approvedLocales?: string[], customMapping?: CustomMapping): boolean;
|
914
1272
|
/**
|
915
1273
|
* Determines the best matching locale from the provided approved locales list.
|
916
1274
|
* @param {string | string[]} locales - A single locale or an array of locales sorted in preference order.
|
917
1275
|
* @param {string[]} [approvedLocales=this.locales] - An array of approved locales, also sorted by preference.
|
918
1276
|
* @returns {string | undefined} - The best matching locale from the approvedLocales list, or undefined if no match is found.
|
919
1277
|
*/
|
920
|
-
|
1278
|
+
declare function determineLocale(locales: string | string[], approvedLocales?: string[] | undefined, customMapping?: CustomMapping | undefined): string | undefined;
|
921
1279
|
/**
|
922
1280
|
* Get the text direction for a given locale code using the Intl.Locale API.
|
923
1281
|
*
|
924
1282
|
* @param {string} locale - A BCP-47 locale code.
|
925
1283
|
* @returns {string} - 'rtl' if the locale is right-to-left, otherwise 'ltr'.
|
926
1284
|
*/
|
927
|
-
|
1285
|
+
declare function getLocaleDirection(locale: string): 'ltr' | 'rtl';
|
928
1286
|
/**
|
929
1287
|
* Checks if a given BCP 47 locale code is valid.
|
930
1288
|
* @param {string} locale - The BCP 47 locale code to validate.
|
931
1289
|
* @param {CustomMapping} [customMapping] - The custom mapping to use for validation.
|
932
1290
|
* @returns {boolean} True if the BCP 47 code is valid, false otherwise.
|
933
1291
|
*/
|
934
|
-
|
1292
|
+
declare function isValidLocale(locale: string, customMapping?: CustomMapping): boolean;
|
935
1293
|
/**
|
936
1294
|
* Resolves the alias locale for a given locale.
|
937
1295
|
* @param {string} locale - The locale to resolve the alias locale for
|
938
1296
|
* @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the alias locale
|
939
1297
|
* @returns {string} The alias locale
|
940
1298
|
*/
|
941
|
-
|
1299
|
+
declare function resolveAliasLocale(locale: string, customMapping?: CustomMapping): string;
|
942
1300
|
/**
|
943
1301
|
* Standardizes a BCP 47 locale code to ensure correct formatting.
|
944
1302
|
* @param {string} locale - The BCP 47 locale code to standardize.
|
945
1303
|
* @returns {string} The standardized BCP 47 locale code or an empty string if it is an invalid code.
|
946
1304
|
*/
|
947
|
-
|
1305
|
+
declare function standardizeLocale(locale: string): string;
|
948
1306
|
/**
|
949
1307
|
* Checks if multiple BCP 47 locale codes represent the same dialect.
|
950
1308
|
* @param {string[]} locales - The BCP 47 locale codes to compare.
|
951
1309
|
* @returns {boolean} True if all BCP 47 codes represent the same dialect, false otherwise.
|
952
1310
|
*/
|
953
|
-
|
1311
|
+
declare function isSameDialect(...locales: (string | string[])[]): boolean;
|
954
1312
|
/**
|
955
1313
|
* Checks if multiple BCP 47 locale codes represent the same language.
|
956
1314
|
* @param {string[]} locales - The BCP 47 locale codes to compare.
|
957
1315
|
* @returns {boolean} True if all BCP 47 codes represent the same language, false otherwise.
|
958
1316
|
*/
|
959
|
-
|
1317
|
+
declare function isSameLanguage(...locales: (string | string[])[]): boolean;
|
960
1318
|
/**
|
961
1319
|
* Checks if a locale is a superset of another locale.
|
962
1320
|
* A subLocale is a subset of superLocale if it is an extension of superLocale or are otherwise identical.
|
@@ -965,5 +1323,6 @@ export declare function isSameLanguage(...locales: (string | string[])[]): boole
|
|
965
1323
|
* @param {string} subLocale - The locale to check if it is a subset of the other locale.
|
966
1324
|
* @returns {boolean} True if the first locale is a superset of the second locale, false otherwise.
|
967
1325
|
*/
|
968
|
-
|
969
|
-
|
1326
|
+
declare function isSupersetLocale(superLocale: string, subLocale: string): boolean;
|
1327
|
+
|
1328
|
+
export { GT, determineLocale, formatCurrency, formatDateTime, formatList, formatMessage, formatNum, formatRelativeTime, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, standardizeLocale };
|