generaltranslation 8.2.13 → 8.2.14
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 +11 -0
- package/dist/{ApiError-IYfaOR30.mjs → ApiError-0DxxIHLp.mjs} +1 -1
- package/dist/{ApiError-CZ45tkW6.cjs.map → ApiError-0DxxIHLp.mjs.map} +1 -1
- package/dist/{ApiError-CZ45tkW6.cjs → ApiError-D-IBuHj6.cjs} +1 -1
- package/dist/{ApiError-IYfaOR30.mjs.map → ApiError-D-IBuHj6.cjs.map} +1 -1
- package/dist/LocaleConfig.d.ts +1 -59
- package/dist/LocaleConfig.js +1 -225
- package/dist/{base64-2fu94Klt.cjs → base64-C6BHySOc.cjs} +17 -1
- package/dist/base64-C6BHySOc.cjs.map +1 -0
- package/dist/{base64-DH0STixb.mjs → base64-CWITCfhU.mjs} +6 -2
- package/dist/base64-CWITCfhU.mjs.map +1 -0
- package/dist/core.cjs +9 -8
- package/dist/core.d.cts +1 -2
- package/dist/core.d.mts +1 -2
- package/dist/core.d.ts +1 -128
- package/dist/core.js +1 -137
- package/dist/core.mjs +2 -2
- package/dist/derive/indexVars.d.ts +1 -1
- package/dist/errors.cjs +1 -1
- package/dist/errors.mjs +1 -1
- package/dist/id/types.d.ts +1 -1
- package/dist/{id-CyiXsQrY.cjs → id-C2orn1MA.cjs} +2 -2
- package/dist/{id-CyiXsQrY.cjs.map → id-C2orn1MA.cjs.map} +1 -1
- package/dist/{id-DbD7K-HL.mjs → id-DEaFhGqX.mjs} +2 -2
- package/dist/{id-DbD7K-HL.mjs.map → id-DEaFhGqX.mjs.map} +1 -1
- package/dist/id.cjs +1 -1
- package/dist/id.d.cts +1 -1
- package/dist/id.d.mts +1 -1
- package/dist/id.mjs +1 -1
- package/dist/index.cjs +368 -385
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -242
- package/dist/index.d.mts +4 -242
- package/dist/index.d.ts +5 -238
- package/dist/index.js +3 -322
- package/dist/index.mjs +215 -352
- package/dist/index.mjs.map +1 -1
- package/dist/internal.cjs +6 -6
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +6 -5
- package/dist/internal.d.mts +6 -5
- package/dist/internal.mjs +4 -4
- package/dist/internal.mjs.map +1 -1
- package/dist/{isVariable-B08mggBy.cjs → isVariable-Ba1gLXdB.cjs} +1 -1
- package/dist/{isVariable-B08mggBy.cjs.map → isVariable-Ba1gLXdB.cjs.map} +1 -1
- package/dist/{isVariable-CYsKFHvR.mjs → isVariable-fAKEB7gF.mjs} +1 -1
- package/dist/{isVariable-CYsKFHvR.mjs.map → isVariable-fAKEB7gF.mjs.map} +1 -1
- package/dist/locales/getPluralForm.js +2 -2
- package/dist/logging/logger.d.ts +0 -3
- package/dist/logging/logger.js +0 -3
- package/dist/{types-AHtYZIP-.d.mts → types-73XFwmhH.d.mts} +7 -106
- package/dist/{types-Bf8_Apq_.d.cts → types-YrrGRHBP.d.cts} +7 -106
- package/dist/types-dir/api/enqueueEntries.d.ts +1 -1
- package/dist/types-dir/api/enqueueFiles.d.ts +1 -1
- package/dist/types-dir/api/fetchTranslations.d.ts +1 -1
- package/dist/types-dir/api/file.d.ts +1 -1
- package/dist/types-dir/api/translate.d.ts +1 -1
- package/dist/types-dir/api/uploadFiles.d.ts +1 -1
- package/dist/types.cjs +7 -16
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +10 -12
- package/dist/types.js +1 -2
- package/dist/types.mjs +1 -15
- package/package.json +3 -2
- package/dist/IntlCache-CAW8tKhd.cjs +0 -212
- package/dist/IntlCache-CAW8tKhd.cjs.map +0 -1
- package/dist/IntlCache-WZk0rKvj.mjs +0 -195
- package/dist/IntlCache-WZk0rKvj.mjs.map +0 -1
- package/dist/base64-2fu94Klt.cjs.map +0 -1
- package/dist/base64-DH0STixb.mjs.map +0 -1
- package/dist/cache/IntlCache.d.ts +0 -26
- package/dist/cache/IntlCache.js +0 -84
- package/dist/cache/types.d.ts +0 -32
- package/dist/cache/types.js +0 -1
- package/dist/core-7RP541eY.cjs +0 -1677
- package/dist/core-7RP541eY.cjs.map +0 -1
- package/dist/core-I9pWGafA.d.mts +0 -209
- package/dist/core-TLJoDpJP.d.cts +0 -209
- package/dist/core-isLphYAZ.mjs +0 -1498
- package/dist/core-isLphYAZ.mjs.map +0 -1
- package/dist/errors/formattingErrors.d.ts +0 -1
- package/dist/errors/formattingErrors.js +0 -3
- package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +0 -59
- package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.js +0 -147
- package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +0 -4
- package/dist/formatting/custom-formats/CutoffFormat/constants.js +0 -30
- package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +0 -48
- package/dist/formatting/custom-formats/CutoffFormat/types.js +0 -2
- package/dist/formatting/format.d.ts +0 -1
- package/dist/formatting/format.js +0 -257
- package/dist/locales/customLocaleMapping.d.ts +0 -11
- package/dist/locales/customLocaleMapping.js +0 -23
- package/dist/locales/determineLocale.d.ts +0 -1
- package/dist/locales/determineLocale.js +0 -72
- package/dist/locales/getLocaleDirection.d.ts +0 -1
- package/dist/locales/getLocaleDirection.js +0 -89
- package/dist/locales/getLocaleEmoji.d.ts +0 -2
- package/dist/locales/getLocaleEmoji.js +0 -319
- package/dist/locales/getLocaleName.d.ts +0 -1
- package/dist/locales/getLocaleName.js +0 -45
- package/dist/locales/getLocaleProperties.d.ts +0 -32
- package/dist/locales/getLocaleProperties.js +0 -220
- package/dist/locales/getRegionProperties.d.ts +0 -7
- package/dist/locales/getRegionProperties.js +0 -61
- package/dist/locales/isSameDialect.d.ts +0 -1
- package/dist/locales/isSameDialect.js +0 -41
- package/dist/locales/isSameLanguage.d.ts +0 -1
- package/dist/locales/isSameLanguage.js +0 -20
- package/dist/locales/isSupersetLocale.d.ts +0 -1
- package/dist/locales/isSupersetLocale.js +0 -22
- package/dist/locales/isValidLocale.d.ts +0 -1
- package/dist/locales/isValidLocale.js +0 -75
- package/dist/locales/requiresTranslation.d.ts +0 -1
- package/dist/locales/requiresTranslation.js +0 -32
- package/dist/locales/resolveAliasLocale.d.ts +0 -8
- package/dist/locales/resolveAliasLocale.js +0 -21
- package/dist/locales/resolveCanonicalLocale.d.ts +0 -8
- package/dist/locales/resolveCanonicalLocale.js +0 -13
- package/dist/logging/warnings.d.ts +0 -2
- package/dist/logging/warnings.js +0 -2
- package/dist/types-dir/jsx/content.d.ts +0 -61
- package/dist/types-dir/jsx/content.js +0 -11
- package/dist/types-dir/jsx/variables.d.ts +0 -9
- package/dist/types-dir/jsx/variables.js +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.mjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { $ as TranslationResult, Ct as EnqueueFilesResult, Dt as FileQueryResult, Et as FileQuery, F as SubmitUserEditDiffsPayload, G as GetOrphanedFilesResult, I as AwaitJobsOptions, J as FileDataResult, L as AwaitJobsResult, Lt as TranslateManyEntry, Q as TranslationError, Rt as TranslateOptions, Tt as CheckFileTranslationsOptions, U as ProcessMovesOptions, V as MoveMapping, W as ProcessMovesResponse, X as BranchDataResult, Y as BranchQuery, Z as TranslateManyResult, bt as FileReferenceIds, ct as UploadFilesResponse, gt as DownloadFileBatchResult, ht as DownloadFileBatchRequest, lt as CreateTagOptions, mt as DownloadFileBatchOptions, nt as PublishFileEntry, ot as FileUpload, q as FileDataQuery, rt as PublishFilesResult, st as UploadFilesOptions, tt as DownloadFileOptions, ut as CreateTagResult, yt as FileReference, z as CheckJobStatusResult } from "./types-YrrGRHBP.cjs";
|
|
2
|
+
import { LocaleConfig, LocaleConfig as LocaleConfig$1, LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale } from "@generaltranslation/format";
|
|
3
|
+
import { CustomMapping, CustomRegionMapping, CutoffFormatOptions, FormatVariables, LocaleProperties, StringFormat } from "@generaltranslation/format/types";
|
|
3
4
|
|
|
4
5
|
//#region src/translate/setupProject.d.ts
|
|
5
6
|
type SetupProjectResult = {
|
|
@@ -24,15 +25,6 @@ type EnqueueOptions = {
|
|
|
24
25
|
timeout?: number;
|
|
25
26
|
};
|
|
26
27
|
//#endregion
|
|
27
|
-
//#region src/locales/getRegionProperties.d.ts
|
|
28
|
-
type CustomRegionMapping = {
|
|
29
|
-
[region: string]: {
|
|
30
|
-
name?: string;
|
|
31
|
-
emoji?: string;
|
|
32
|
-
locale?: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
//#endregion
|
|
36
28
|
//#region src/types-dir/api/project.d.ts
|
|
37
29
|
type ProjectData = {
|
|
38
30
|
id: string;
|
|
@@ -115,7 +107,7 @@ declare class GT {
|
|
|
115
107
|
/** Runtime-safe locale and formatting helpers (backing field) */
|
|
116
108
|
private _localeConfig;
|
|
117
109
|
/** Runtime-safe locale and formatting helpers */
|
|
118
|
-
get localeConfig(): LocaleConfig;
|
|
110
|
+
get localeConfig(): LocaleConfig$1;
|
|
119
111
|
/**
|
|
120
112
|
* Constructs an instance of the GT class.
|
|
121
113
|
*
|
|
@@ -825,236 +817,6 @@ declare class GT {
|
|
|
825
817
|
*/
|
|
826
818
|
isSupersetLocale(superLocale: string, subLocale: string): boolean;
|
|
827
819
|
}
|
|
828
|
-
/**
|
|
829
|
-
* Formats a number according to the specified locales and options.
|
|
830
|
-
* @param {Object} params - The parameters for the number formatting.
|
|
831
|
-
* @param {number} params.value - The number to format.
|
|
832
|
-
* @param {Intl.NumberFormatOptions} [params.options] - Additional options for number formatting.
|
|
833
|
-
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
|
834
|
-
* @returns {string} The formatted number.
|
|
835
|
-
*/
|
|
836
|
-
declare function formatNum(number: number, options: {
|
|
837
|
-
locales: string | string[];
|
|
838
|
-
} & Intl.NumberFormatOptions): string;
|
|
839
|
-
/**
|
|
840
|
-
* Formats a date according to the specified languages and options.
|
|
841
|
-
* @param {Object} params - The parameters for the date formatting.
|
|
842
|
-
* @param {Date} params.value - The date to format.
|
|
843
|
-
* @param {Intl.DateTimeFormatOptions} [params.options] - Additional options for date formatting.
|
|
844
|
-
* @param {string | string[]} [params.options.locales] - The languages to use for formatting.
|
|
845
|
-
* @returns {string} The formatted date.
|
|
846
|
-
*/
|
|
847
|
-
declare function formatDateTime(date: Date, options?: {
|
|
848
|
-
locales?: string | string[];
|
|
849
|
-
} & Intl.DateTimeFormatOptions): string;
|
|
850
|
-
/**
|
|
851
|
-
* Formats a currency value according to the specified languages, currency, and options.
|
|
852
|
-
* @param {Object} params - The parameters for the currency formatting.
|
|
853
|
-
* @param {number} params.value - The currency value to format.
|
|
854
|
-
* @param {string} params.currency - The currency code (e.g., 'USD').
|
|
855
|
-
* @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.
|
|
856
|
-
* @param {string | string[]} [params.options.locales] - The locale codes to use for formatting.
|
|
857
|
-
* @returns {string} The formatted currency value.
|
|
858
|
-
*/
|
|
859
|
-
declare function formatCurrency(value: number, currency: string, options: {
|
|
860
|
-
locales: string | string[];
|
|
861
|
-
} & Intl.NumberFormatOptions): string;
|
|
862
|
-
/**
|
|
863
|
-
* Formats a list of items according to the specified locales and options.
|
|
864
|
-
* @param {Object} params - The parameters for the list formatting.
|
|
865
|
-
* @param {Array<string | number>} params.value - The list of items to format.
|
|
866
|
-
* @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.
|
|
867
|
-
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
|
868
|
-
* @returns {string} The formatted list.
|
|
869
|
-
*/
|
|
870
|
-
declare function formatList(array: Array<string | number>, options: {
|
|
871
|
-
locales: string | string[];
|
|
872
|
-
} & Intl.ListFormatOptions): string;
|
|
873
|
-
/**
|
|
874
|
-
* Formats a list of items according to the specified locales and options.
|
|
875
|
-
* @param {Array<T>} array - The list of items to format.
|
|
876
|
-
* @param {Object} [options] - Additional options for list formatting.
|
|
877
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
878
|
-
* @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options.
|
|
879
|
-
* @returns {Array<T | string>} The formatted list parts.
|
|
880
|
-
*/
|
|
881
|
-
declare function formatListToParts<T>(array: Array<T>, options?: {
|
|
882
|
-
locales?: string | string[];
|
|
883
|
-
} & Intl.ListFormatOptions): Array<T | string>;
|
|
884
|
-
/**
|
|
885
|
-
* Formats a relative time value according to the specified locales and options.
|
|
886
|
-
* @param {Object} params - The parameters for the relative time formatting.
|
|
887
|
-
* @param {number} params.value - The relative time value to format.
|
|
888
|
-
* @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').
|
|
889
|
-
* @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.
|
|
890
|
-
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
|
891
|
-
* @returns {string} The formatted relative time string.
|
|
892
|
-
*/
|
|
893
|
-
declare function formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options: {
|
|
894
|
-
locales: string | string[];
|
|
895
|
-
} & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
|
|
896
|
-
/**
|
|
897
|
-
* Formats a relative time string from a Date, automatically selecting the best unit.
|
|
898
|
-
* @param {Date} date - The date to format relative to now.
|
|
899
|
-
* @param {Object} options - Formatting options.
|
|
900
|
-
* @param {string | string[]} options.locales - The locales to use for formatting.
|
|
901
|
-
* @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options.
|
|
902
|
-
* @returns {string} The formatted relative time string (e.g., "2 hours ago", "in 3 days").
|
|
903
|
-
*/
|
|
904
|
-
declare function formatRelativeTimeFromDate(date: Date, options: {
|
|
905
|
-
locales: string | string[];
|
|
906
|
-
baseDate?: Date;
|
|
907
|
-
} & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
|
|
908
|
-
/**
|
|
909
|
-
* Retrieves the display name of locale code using Intl.DisplayNames.
|
|
910
|
-
*
|
|
911
|
-
* @param {string} locale - A BCP-47 locale code.
|
|
912
|
-
* @param {string} [defaultLocale] - The default locale to use for formatting.
|
|
913
|
-
* @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
|
|
914
|
-
* @returns {string} The display name corresponding to the code.
|
|
915
|
-
*/
|
|
916
|
-
declare function getLocaleName(locale: string, defaultLocale?: string, customMapping?: CustomMapping): string;
|
|
917
|
-
/**
|
|
918
|
-
* Retrieves an emoji based on a given locale code, taking into account region, language, and specific exceptions.
|
|
919
|
-
*
|
|
920
|
-
* This function uses the locale's region (if present) to select an emoji or falls back on default emojis for certain languages.
|
|
921
|
-
*
|
|
922
|
-
* @param locale - A string representing the locale code (e.g., 'en-US', 'fr-CA').
|
|
923
|
-
* @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
|
|
924
|
-
* @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.
|
|
925
|
-
*/
|
|
926
|
-
declare function getLocaleEmoji(locale: string, customMapping?: CustomMapping): string;
|
|
927
|
-
/**
|
|
928
|
-
* Generates linguistic details for a given locale code.
|
|
929
|
-
*
|
|
930
|
-
* This function returns information about the locale,
|
|
931
|
-
* script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).
|
|
932
|
-
* The function provides these names in both your default language and native forms, and an associated emoji.
|
|
933
|
-
*
|
|
934
|
-
* @param {string} locale - The locale code to get properties for (e.g., "de-AT").
|
|
935
|
-
* @param {string} [defaultLocale] - The default locale to use for formatting.
|
|
936
|
-
* @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
|
|
937
|
-
* @returns {LocaleProperties} - An object containing detailed information about the locale.
|
|
938
|
-
*
|
|
939
|
-
* @property {string} code - The full locale code, e.g., "de-AT".
|
|
940
|
-
* @property {string} name - Language name in the default display language, e.g., "Austrian German".
|
|
941
|
-
* @property {string} nativeName - Language name in the locale's native language, e.g., "Österreichisches Deutsch".
|
|
942
|
-
* @property {string} languageCode - The base language code, e.g., "de".
|
|
943
|
-
* @property {string} languageName - The language name in the default display language, e.g., "German".
|
|
944
|
-
* @property {string} nativeLanguageName - The language name in the native language, e.g., "Deutsch".
|
|
945
|
-
* @property {string} nameWithRegionCode - Language name with region in the default language, e.g., "German (AT)".
|
|
946
|
-
* @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., "Deutsch (AT)".
|
|
947
|
-
* @property {string} regionCode - The region code from maximization, e.g., "AT".
|
|
948
|
-
* @property {string} regionName - The region name in the default display language, e.g., "Austria".
|
|
949
|
-
* @property {string} nativeRegionName - The region name in the native language, e.g., "Österreich".
|
|
950
|
-
* @property {string} scriptCode - The script code from maximization, e.g., "Latn".
|
|
951
|
-
* @property {string} scriptName - The script name in the default display language, e.g., "Latin".
|
|
952
|
-
* @property {string} nativeScriptName - The script name in the native language, e.g., "Lateinisch".
|
|
953
|
-
* @property {string} maximizedCode - The maximized locale code, e.g., "de-Latn-AT".
|
|
954
|
-
* @property {string} maximizedName - Maximized locale name with likely script in the default language, e.g., "Austrian German (Latin)".
|
|
955
|
-
* @property {string} nativeMaximizedName - Maximized locale name in the native language, e.g., "Österreichisches Deutsch (Lateinisch)".
|
|
956
|
-
* @property {string} minimizedCode - Minimized locale code, e.g., "de-AT" (or "de" for "de-DE").
|
|
957
|
-
* @property {string} minimizedName - Minimized language name in the default language, e.g., "Austrian German".
|
|
958
|
-
* @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., "Österreichisches Deutsch".
|
|
959
|
-
* @property {string} emoji - The emoji associated with the locale's region, if applicable.
|
|
960
|
-
*/
|
|
961
|
-
declare function getLocaleProperties(locale: string, defaultLocale?: string, customMapping?: CustomMapping): LocaleProperties;
|
|
962
|
-
/**
|
|
963
|
-
* Retrieves multiple properties for a given region code, including:
|
|
964
|
-
* - `code`: the original region code
|
|
965
|
-
* - `name`: the localized display name
|
|
966
|
-
* - `emoji`: the associated flag or symbol
|
|
967
|
-
*
|
|
968
|
-
* Behavior:
|
|
969
|
-
* - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `"US"`, `"FR"`, `"419"`).
|
|
970
|
-
* - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.
|
|
971
|
-
* - Otherwise, uses `Intl.DisplayNames` to get the localized region name in the given `defaultLocale`,
|
|
972
|
-
* falling back to `libraryDefaultLocale`.
|
|
973
|
-
* - Falls back to the region code as `name` if display name resolution fails.
|
|
974
|
-
* - Falls back to `defaultEmoji` if no emoji mapping is found in `emojis` or `customMapping`.
|
|
975
|
-
*
|
|
976
|
-
* @param {string} region - The region code to look up (e.g., `"US"`, `"GB"`, `"DE"`).
|
|
977
|
-
* @param {string} [defaultLocale=libraryDefaultLocale] - The locale to use when localizing the region name.
|
|
978
|
-
* @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.
|
|
979
|
-
* @returns {{ code: string, name: string, emoji: string }} An object containing:
|
|
980
|
-
* - `code`: the input region code
|
|
981
|
-
* - `name`: the localized or custom region name
|
|
982
|
-
* - `emoji`: the matching emoji flag or symbol
|
|
983
|
-
*
|
|
984
|
-
* @example
|
|
985
|
-
* getRegionProperties('US', 'en');
|
|
986
|
-
* // => { code: 'US', name: 'United States', emoji: '🇺🇸' }
|
|
987
|
-
*
|
|
988
|
-
* @example
|
|
989
|
-
* getRegionProperties('US', 'fr');
|
|
990
|
-
* // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }
|
|
991
|
-
*
|
|
992
|
-
* @example
|
|
993
|
-
* getRegionProperties('US', 'en', { US: { name: 'USA', emoji: '🗽' } });
|
|
994
|
-
* // => { code: 'US', name: 'USA', emoji: '🗽' }
|
|
995
|
-
*/
|
|
996
|
-
declare function getRegionProperties(region: string, defaultLocale?: string, customMapping?: CustomRegionMapping): {
|
|
997
|
-
code: string;
|
|
998
|
-
name: string;
|
|
999
|
-
emoji: string;
|
|
1000
|
-
};
|
|
1001
|
-
/**
|
|
1002
|
-
* Determines whether a translation is required based on the source and target locales.
|
|
1003
|
-
*
|
|
1004
|
-
* - If the target locale is not specified, the function returns `false`, as translation is not needed.
|
|
1005
|
-
* - If the source and target locale are the same, returns `false`, indicating that no translation is necessary.
|
|
1006
|
-
* - If the `approvedLocales` array is provided, and the target locale is not within that array, the function also returns `false`.
|
|
1007
|
-
* - Otherwise, it returns `true`, meaning that a translation is required.
|
|
1008
|
-
*
|
|
1009
|
-
* @param {string} sourceLocale - The locale code for the original content (BCP 47 locale code).
|
|
1010
|
-
* @param {string} targetLocale - The locale code of the language to translate the content into (BCP 47 locale code).
|
|
1011
|
-
* @param {string[]} [approvedLocale] - An optional array of approved target locales.
|
|
1012
|
-
*
|
|
1013
|
-
* @returns {boolean} - Returns `true` if translation is required, otherwise `false`.
|
|
1014
|
-
*/
|
|
1015
|
-
declare function requiresTranslation(sourceLocale: string, targetLocale: string, approvedLocales?: string[], customMapping?: CustomMapping): boolean;
|
|
1016
|
-
/**
|
|
1017
|
-
* Determines the best matching locale from the provided approved locales list.
|
|
1018
|
-
* @param {string | string[]} locales - A single locale or an array of locales sorted in preference order.
|
|
1019
|
-
* @param {string[]} [approvedLocales=this.locales] - An array of approved locales, also sorted by preference.
|
|
1020
|
-
* @returns {string | undefined} - The best matching locale from the approvedLocales list, or undefined if no match is found.
|
|
1021
|
-
*/
|
|
1022
|
-
declare function determineLocale(locales: string | string[], approvedLocales?: string[] | undefined, customMapping?: CustomMapping | undefined): string | undefined;
|
|
1023
|
-
/**
|
|
1024
|
-
* Get the text direction for a given locale code using the Intl.Locale API.
|
|
1025
|
-
*
|
|
1026
|
-
* @param {string} locale - A BCP-47 locale code.
|
|
1027
|
-
* @returns {string} 'rtl' if the locale is right-to-left; otherwise 'ltr'.
|
|
1028
|
-
*/
|
|
1029
|
-
declare function getLocaleDirection(locale: string): 'ltr' | 'rtl';
|
|
1030
|
-
/**
|
|
1031
|
-
* Resolves the alias locale for a given locale.
|
|
1032
|
-
* @param {string} locale - The locale to resolve the alias locale for
|
|
1033
|
-
* @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the alias locale
|
|
1034
|
-
* @returns {string} The alias locale
|
|
1035
|
-
*/
|
|
1036
|
-
declare function resolveAliasLocale(locale: string, customMapping?: CustomMapping): string;
|
|
1037
|
-
/**
|
|
1038
|
-
* Checks if multiple BCP 47 locale codes represent the same dialect.
|
|
1039
|
-
* @param {string[]} locales - The BCP 47 locale codes to compare.
|
|
1040
|
-
* @returns {boolean} True if all BCP 47 codes represent the same dialect, false otherwise.
|
|
1041
|
-
*/
|
|
1042
|
-
declare function isSameDialect(...locales: (string | string[])[]): boolean;
|
|
1043
|
-
/**
|
|
1044
|
-
* Checks if multiple BCP 47 locale codes represent the same language.
|
|
1045
|
-
* @param {string[]} locales - The BCP 47 locale codes to compare.
|
|
1046
|
-
* @returns {boolean} True if all BCP 47 codes represent the same language, false otherwise.
|
|
1047
|
-
*/
|
|
1048
|
-
declare function isSameLanguage(...locales: (string | string[])[]): boolean;
|
|
1049
|
-
/**
|
|
1050
|
-
* Checks if a locale is a superset of another locale.
|
|
1051
|
-
* A subLocale is a subset of superLocale if it is an extension of superLocale or are otherwise identical.
|
|
1052
|
-
*
|
|
1053
|
-
* @param {string} superLocale - The locale to check if it is a superset of the other locale.
|
|
1054
|
-
* @param {string} subLocale - The locale to check if it is a subset of the other locale.
|
|
1055
|
-
* @returns {boolean} True if the first locale is a superset of the second locale, false otherwise.
|
|
1056
|
-
*/
|
|
1057
|
-
declare function isSupersetLocale(superLocale: string, subLocale: string): boolean;
|
|
1058
820
|
declare const API_VERSION = "2026-03-06.v1";
|
|
1059
821
|
//#endregion
|
|
1060
822
|
export { API_VERSION, GT, LocaleConfig, type LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { $ as TranslationResult, Ct as EnqueueFilesResult, Dt as FileQueryResult, Et as FileQuery, F as SubmitUserEditDiffsPayload, G as GetOrphanedFilesResult, I as AwaitJobsOptions, J as FileDataResult, L as AwaitJobsResult, Lt as TranslateManyEntry, Q as TranslationError, Rt as TranslateOptions, Tt as CheckFileTranslationsOptions, U as ProcessMovesOptions, V as MoveMapping, W as ProcessMovesResponse, X as BranchDataResult, Y as BranchQuery, Z as TranslateManyResult, bt as FileReferenceIds, ct as UploadFilesResponse, gt as DownloadFileBatchResult, ht as DownloadFileBatchRequest, lt as CreateTagOptions, mt as DownloadFileBatchOptions, nt as PublishFileEntry, ot as FileUpload, q as FileDataQuery, rt as PublishFilesResult, st as UploadFilesOptions, tt as DownloadFileOptions, ut as CreateTagResult, yt as FileReference, z as CheckJobStatusResult } from "./types-73XFwmhH.mjs";
|
|
2
|
+
import { LocaleConfig, LocaleConfig as LocaleConfig$1, LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale } from "@generaltranslation/format";
|
|
3
|
+
import { CustomMapping, CustomRegionMapping, CutoffFormatOptions, FormatVariables, LocaleProperties, StringFormat } from "@generaltranslation/format/types";
|
|
3
4
|
|
|
4
5
|
//#region src/translate/setupProject.d.ts
|
|
5
6
|
type SetupProjectResult = {
|
|
@@ -24,15 +25,6 @@ type EnqueueOptions = {
|
|
|
24
25
|
timeout?: number;
|
|
25
26
|
};
|
|
26
27
|
//#endregion
|
|
27
|
-
//#region src/locales/getRegionProperties.d.ts
|
|
28
|
-
type CustomRegionMapping = {
|
|
29
|
-
[region: string]: {
|
|
30
|
-
name?: string;
|
|
31
|
-
emoji?: string;
|
|
32
|
-
locale?: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
//#endregion
|
|
36
28
|
//#region src/types-dir/api/project.d.ts
|
|
37
29
|
type ProjectData = {
|
|
38
30
|
id: string;
|
|
@@ -115,7 +107,7 @@ declare class GT {
|
|
|
115
107
|
/** Runtime-safe locale and formatting helpers (backing field) */
|
|
116
108
|
private _localeConfig;
|
|
117
109
|
/** Runtime-safe locale and formatting helpers */
|
|
118
|
-
get localeConfig(): LocaleConfig;
|
|
110
|
+
get localeConfig(): LocaleConfig$1;
|
|
119
111
|
/**
|
|
120
112
|
* Constructs an instance of the GT class.
|
|
121
113
|
*
|
|
@@ -825,236 +817,6 @@ declare class GT {
|
|
|
825
817
|
*/
|
|
826
818
|
isSupersetLocale(superLocale: string, subLocale: string): boolean;
|
|
827
819
|
}
|
|
828
|
-
/**
|
|
829
|
-
* Formats a number according to the specified locales and options.
|
|
830
|
-
* @param {Object} params - The parameters for the number formatting.
|
|
831
|
-
* @param {number} params.value - The number to format.
|
|
832
|
-
* @param {Intl.NumberFormatOptions} [params.options] - Additional options for number formatting.
|
|
833
|
-
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
|
834
|
-
* @returns {string} The formatted number.
|
|
835
|
-
*/
|
|
836
|
-
declare function formatNum(number: number, options: {
|
|
837
|
-
locales: string | string[];
|
|
838
|
-
} & Intl.NumberFormatOptions): string;
|
|
839
|
-
/**
|
|
840
|
-
* Formats a date according to the specified languages and options.
|
|
841
|
-
* @param {Object} params - The parameters for the date formatting.
|
|
842
|
-
* @param {Date} params.value - The date to format.
|
|
843
|
-
* @param {Intl.DateTimeFormatOptions} [params.options] - Additional options for date formatting.
|
|
844
|
-
* @param {string | string[]} [params.options.locales] - The languages to use for formatting.
|
|
845
|
-
* @returns {string} The formatted date.
|
|
846
|
-
*/
|
|
847
|
-
declare function formatDateTime(date: Date, options?: {
|
|
848
|
-
locales?: string | string[];
|
|
849
|
-
} & Intl.DateTimeFormatOptions): string;
|
|
850
|
-
/**
|
|
851
|
-
* Formats a currency value according to the specified languages, currency, and options.
|
|
852
|
-
* @param {Object} params - The parameters for the currency formatting.
|
|
853
|
-
* @param {number} params.value - The currency value to format.
|
|
854
|
-
* @param {string} params.currency - The currency code (e.g., 'USD').
|
|
855
|
-
* @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.
|
|
856
|
-
* @param {string | string[]} [params.options.locales] - The locale codes to use for formatting.
|
|
857
|
-
* @returns {string} The formatted currency value.
|
|
858
|
-
*/
|
|
859
|
-
declare function formatCurrency(value: number, currency: string, options: {
|
|
860
|
-
locales: string | string[];
|
|
861
|
-
} & Intl.NumberFormatOptions): string;
|
|
862
|
-
/**
|
|
863
|
-
* Formats a list of items according to the specified locales and options.
|
|
864
|
-
* @param {Object} params - The parameters for the list formatting.
|
|
865
|
-
* @param {Array<string | number>} params.value - The list of items to format.
|
|
866
|
-
* @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.
|
|
867
|
-
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
|
868
|
-
* @returns {string} The formatted list.
|
|
869
|
-
*/
|
|
870
|
-
declare function formatList(array: Array<string | number>, options: {
|
|
871
|
-
locales: string | string[];
|
|
872
|
-
} & Intl.ListFormatOptions): string;
|
|
873
|
-
/**
|
|
874
|
-
* Formats a list of items according to the specified locales and options.
|
|
875
|
-
* @param {Array<T>} array - The list of items to format.
|
|
876
|
-
* @param {Object} [options] - Additional options for list formatting.
|
|
877
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
878
|
-
* @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options.
|
|
879
|
-
* @returns {Array<T | string>} The formatted list parts.
|
|
880
|
-
*/
|
|
881
|
-
declare function formatListToParts<T>(array: Array<T>, options?: {
|
|
882
|
-
locales?: string | string[];
|
|
883
|
-
} & Intl.ListFormatOptions): Array<T | string>;
|
|
884
|
-
/**
|
|
885
|
-
* Formats a relative time value according to the specified locales and options.
|
|
886
|
-
* @param {Object} params - The parameters for the relative time formatting.
|
|
887
|
-
* @param {number} params.value - The relative time value to format.
|
|
888
|
-
* @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').
|
|
889
|
-
* @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.
|
|
890
|
-
* @param {string | string[]} [params.options.locales] - The locales to use for formatting.
|
|
891
|
-
* @returns {string} The formatted relative time string.
|
|
892
|
-
*/
|
|
893
|
-
declare function formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options: {
|
|
894
|
-
locales: string | string[];
|
|
895
|
-
} & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
|
|
896
|
-
/**
|
|
897
|
-
* Formats a relative time string from a Date, automatically selecting the best unit.
|
|
898
|
-
* @param {Date} date - The date to format relative to now.
|
|
899
|
-
* @param {Object} options - Formatting options.
|
|
900
|
-
* @param {string | string[]} options.locales - The locales to use for formatting.
|
|
901
|
-
* @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options.
|
|
902
|
-
* @returns {string} The formatted relative time string (e.g., "2 hours ago", "in 3 days").
|
|
903
|
-
*/
|
|
904
|
-
declare function formatRelativeTimeFromDate(date: Date, options: {
|
|
905
|
-
locales: string | string[];
|
|
906
|
-
baseDate?: Date;
|
|
907
|
-
} & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
|
|
908
|
-
/**
|
|
909
|
-
* Retrieves the display name of locale code using Intl.DisplayNames.
|
|
910
|
-
*
|
|
911
|
-
* @param {string} locale - A BCP-47 locale code.
|
|
912
|
-
* @param {string} [defaultLocale] - The default locale to use for formatting.
|
|
913
|
-
* @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
|
|
914
|
-
* @returns {string} The display name corresponding to the code.
|
|
915
|
-
*/
|
|
916
|
-
declare function getLocaleName(locale: string, defaultLocale?: string, customMapping?: CustomMapping): string;
|
|
917
|
-
/**
|
|
918
|
-
* Retrieves an emoji based on a given locale code, taking into account region, language, and specific exceptions.
|
|
919
|
-
*
|
|
920
|
-
* This function uses the locale's region (if present) to select an emoji or falls back on default emojis for certain languages.
|
|
921
|
-
*
|
|
922
|
-
* @param locale - A string representing the locale code (e.g., 'en-US', 'fr-CA').
|
|
923
|
-
* @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
|
|
924
|
-
* @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.
|
|
925
|
-
*/
|
|
926
|
-
declare function getLocaleEmoji(locale: string, customMapping?: CustomMapping): string;
|
|
927
|
-
/**
|
|
928
|
-
* Generates linguistic details for a given locale code.
|
|
929
|
-
*
|
|
930
|
-
* This function returns information about the locale,
|
|
931
|
-
* script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).
|
|
932
|
-
* The function provides these names in both your default language and native forms, and an associated emoji.
|
|
933
|
-
*
|
|
934
|
-
* @param {string} locale - The locale code to get properties for (e.g., "de-AT").
|
|
935
|
-
* @param {string} [defaultLocale] - The default locale to use for formatting.
|
|
936
|
-
* @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
|
|
937
|
-
* @returns {LocaleProperties} - An object containing detailed information about the locale.
|
|
938
|
-
*
|
|
939
|
-
* @property {string} code - The full locale code, e.g., "de-AT".
|
|
940
|
-
* @property {string} name - Language name in the default display language, e.g., "Austrian German".
|
|
941
|
-
* @property {string} nativeName - Language name in the locale's native language, e.g., "Österreichisches Deutsch".
|
|
942
|
-
* @property {string} languageCode - The base language code, e.g., "de".
|
|
943
|
-
* @property {string} languageName - The language name in the default display language, e.g., "German".
|
|
944
|
-
* @property {string} nativeLanguageName - The language name in the native language, e.g., "Deutsch".
|
|
945
|
-
* @property {string} nameWithRegionCode - Language name with region in the default language, e.g., "German (AT)".
|
|
946
|
-
* @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., "Deutsch (AT)".
|
|
947
|
-
* @property {string} regionCode - The region code from maximization, e.g., "AT".
|
|
948
|
-
* @property {string} regionName - The region name in the default display language, e.g., "Austria".
|
|
949
|
-
* @property {string} nativeRegionName - The region name in the native language, e.g., "Österreich".
|
|
950
|
-
* @property {string} scriptCode - The script code from maximization, e.g., "Latn".
|
|
951
|
-
* @property {string} scriptName - The script name in the default display language, e.g., "Latin".
|
|
952
|
-
* @property {string} nativeScriptName - The script name in the native language, e.g., "Lateinisch".
|
|
953
|
-
* @property {string} maximizedCode - The maximized locale code, e.g., "de-Latn-AT".
|
|
954
|
-
* @property {string} maximizedName - Maximized locale name with likely script in the default language, e.g., "Austrian German (Latin)".
|
|
955
|
-
* @property {string} nativeMaximizedName - Maximized locale name in the native language, e.g., "Österreichisches Deutsch (Lateinisch)".
|
|
956
|
-
* @property {string} minimizedCode - Minimized locale code, e.g., "de-AT" (or "de" for "de-DE").
|
|
957
|
-
* @property {string} minimizedName - Minimized language name in the default language, e.g., "Austrian German".
|
|
958
|
-
* @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., "Österreichisches Deutsch".
|
|
959
|
-
* @property {string} emoji - The emoji associated with the locale's region, if applicable.
|
|
960
|
-
*/
|
|
961
|
-
declare function getLocaleProperties(locale: string, defaultLocale?: string, customMapping?: CustomMapping): LocaleProperties;
|
|
962
|
-
/**
|
|
963
|
-
* Retrieves multiple properties for a given region code, including:
|
|
964
|
-
* - `code`: the original region code
|
|
965
|
-
* - `name`: the localized display name
|
|
966
|
-
* - `emoji`: the associated flag or symbol
|
|
967
|
-
*
|
|
968
|
-
* Behavior:
|
|
969
|
-
* - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `"US"`, `"FR"`, `"419"`).
|
|
970
|
-
* - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.
|
|
971
|
-
* - Otherwise, uses `Intl.DisplayNames` to get the localized region name in the given `defaultLocale`,
|
|
972
|
-
* falling back to `libraryDefaultLocale`.
|
|
973
|
-
* - Falls back to the region code as `name` if display name resolution fails.
|
|
974
|
-
* - Falls back to `defaultEmoji` if no emoji mapping is found in `emojis` or `customMapping`.
|
|
975
|
-
*
|
|
976
|
-
* @param {string} region - The region code to look up (e.g., `"US"`, `"GB"`, `"DE"`).
|
|
977
|
-
* @param {string} [defaultLocale=libraryDefaultLocale] - The locale to use when localizing the region name.
|
|
978
|
-
* @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.
|
|
979
|
-
* @returns {{ code: string, name: string, emoji: string }} An object containing:
|
|
980
|
-
* - `code`: the input region code
|
|
981
|
-
* - `name`: the localized or custom region name
|
|
982
|
-
* - `emoji`: the matching emoji flag or symbol
|
|
983
|
-
*
|
|
984
|
-
* @example
|
|
985
|
-
* getRegionProperties('US', 'en');
|
|
986
|
-
* // => { code: 'US', name: 'United States', emoji: '🇺🇸' }
|
|
987
|
-
*
|
|
988
|
-
* @example
|
|
989
|
-
* getRegionProperties('US', 'fr');
|
|
990
|
-
* // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }
|
|
991
|
-
*
|
|
992
|
-
* @example
|
|
993
|
-
* getRegionProperties('US', 'en', { US: { name: 'USA', emoji: '🗽' } });
|
|
994
|
-
* // => { code: 'US', name: 'USA', emoji: '🗽' }
|
|
995
|
-
*/
|
|
996
|
-
declare function getRegionProperties(region: string, defaultLocale?: string, customMapping?: CustomRegionMapping): {
|
|
997
|
-
code: string;
|
|
998
|
-
name: string;
|
|
999
|
-
emoji: string;
|
|
1000
|
-
};
|
|
1001
|
-
/**
|
|
1002
|
-
* Determines whether a translation is required based on the source and target locales.
|
|
1003
|
-
*
|
|
1004
|
-
* - If the target locale is not specified, the function returns `false`, as translation is not needed.
|
|
1005
|
-
* - If the source and target locale are the same, returns `false`, indicating that no translation is necessary.
|
|
1006
|
-
* - If the `approvedLocales` array is provided, and the target locale is not within that array, the function also returns `false`.
|
|
1007
|
-
* - Otherwise, it returns `true`, meaning that a translation is required.
|
|
1008
|
-
*
|
|
1009
|
-
* @param {string} sourceLocale - The locale code for the original content (BCP 47 locale code).
|
|
1010
|
-
* @param {string} targetLocale - The locale code of the language to translate the content into (BCP 47 locale code).
|
|
1011
|
-
* @param {string[]} [approvedLocale] - An optional array of approved target locales.
|
|
1012
|
-
*
|
|
1013
|
-
* @returns {boolean} - Returns `true` if translation is required, otherwise `false`.
|
|
1014
|
-
*/
|
|
1015
|
-
declare function requiresTranslation(sourceLocale: string, targetLocale: string, approvedLocales?: string[], customMapping?: CustomMapping): boolean;
|
|
1016
|
-
/**
|
|
1017
|
-
* Determines the best matching locale from the provided approved locales list.
|
|
1018
|
-
* @param {string | string[]} locales - A single locale or an array of locales sorted in preference order.
|
|
1019
|
-
* @param {string[]} [approvedLocales=this.locales] - An array of approved locales, also sorted by preference.
|
|
1020
|
-
* @returns {string | undefined} - The best matching locale from the approvedLocales list, or undefined if no match is found.
|
|
1021
|
-
*/
|
|
1022
|
-
declare function determineLocale(locales: string | string[], approvedLocales?: string[] | undefined, customMapping?: CustomMapping | undefined): string | undefined;
|
|
1023
|
-
/**
|
|
1024
|
-
* Get the text direction for a given locale code using the Intl.Locale API.
|
|
1025
|
-
*
|
|
1026
|
-
* @param {string} locale - A BCP-47 locale code.
|
|
1027
|
-
* @returns {string} 'rtl' if the locale is right-to-left; otherwise 'ltr'.
|
|
1028
|
-
*/
|
|
1029
|
-
declare function getLocaleDirection(locale: string): 'ltr' | 'rtl';
|
|
1030
|
-
/**
|
|
1031
|
-
* Resolves the alias locale for a given locale.
|
|
1032
|
-
* @param {string} locale - The locale to resolve the alias locale for
|
|
1033
|
-
* @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the alias locale
|
|
1034
|
-
* @returns {string} The alias locale
|
|
1035
|
-
*/
|
|
1036
|
-
declare function resolveAliasLocale(locale: string, customMapping?: CustomMapping): string;
|
|
1037
|
-
/**
|
|
1038
|
-
* Checks if multiple BCP 47 locale codes represent the same dialect.
|
|
1039
|
-
* @param {string[]} locales - The BCP 47 locale codes to compare.
|
|
1040
|
-
* @returns {boolean} True if all BCP 47 codes represent the same dialect, false otherwise.
|
|
1041
|
-
*/
|
|
1042
|
-
declare function isSameDialect(...locales: (string | string[])[]): boolean;
|
|
1043
|
-
/**
|
|
1044
|
-
* Checks if multiple BCP 47 locale codes represent the same language.
|
|
1045
|
-
* @param {string[]} locales - The BCP 47 locale codes to compare.
|
|
1046
|
-
* @returns {boolean} True if all BCP 47 codes represent the same language, false otherwise.
|
|
1047
|
-
*/
|
|
1048
|
-
declare function isSameLanguage(...locales: (string | string[])[]): boolean;
|
|
1049
|
-
/**
|
|
1050
|
-
* Checks if a locale is a superset of another locale.
|
|
1051
|
-
* A subLocale is a subset of superLocale if it is an extension of superLocale or are otherwise identical.
|
|
1052
|
-
*
|
|
1053
|
-
* @param {string} superLocale - The locale to check if it is a superset of the other locale.
|
|
1054
|
-
* @param {string} subLocale - The locale to check if it is a subset of the other locale.
|
|
1055
|
-
* @returns {boolean} True if the first locale is a superset of the second locale, false otherwise.
|
|
1056
|
-
*/
|
|
1057
|
-
declare function isSupersetLocale(superLocale: string, subLocale: string): boolean;
|
|
1058
820
|
declare const API_VERSION = "2026-03-06.v1";
|
|
1059
821
|
//#endregion
|
|
1060
822
|
export { API_VERSION, GT, LocaleConfig, type LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale };
|