generaltranslation 8.2.11 → 8.2.13
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 +15 -0
- package/dist/{IntlCache-k2qfrDqB.cjs → IntlCache-CAW8tKhd.cjs} +12 -12
- package/dist/IntlCache-CAW8tKhd.cjs.map +1 -0
- package/dist/{IntlCache-Ccg_cQPR.mjs → IntlCache-WZk0rKvj.mjs} +12 -12
- package/dist/IntlCache-WZk0rKvj.mjs.map +1 -0
- package/dist/LocaleConfig.d.ts +59 -0
- package/dist/LocaleConfig.js +225 -0
- package/dist/backwards-compatability/dataConversion.d.ts +23 -0
- package/dist/backwards-compatability/dataConversion.js +207 -0
- package/dist/backwards-compatability/oldHashJsxChildren.d.ts +23 -0
- package/dist/backwards-compatability/oldHashJsxChildren.js +79 -0
- package/dist/backwards-compatability/oldTypes.d.ts +21 -0
- package/dist/backwards-compatability/oldTypes.js +1 -0
- package/dist/backwards-compatability/typeChecking.d.ts +21 -0
- package/dist/backwards-compatability/typeChecking.js +61 -0
- package/dist/{base64-CUcEPEC5.cjs → base64-2fu94Klt.cjs} +3 -3
- package/dist/base64-2fu94Klt.cjs.map +1 -0
- package/dist/{base64-C1sogiix.mjs → base64-DH0STixb.mjs} +3 -3
- package/dist/base64-DH0STixb.mjs.map +1 -0
- package/dist/cache/IntlCache.d.ts +26 -0
- package/dist/cache/IntlCache.js +84 -0
- package/dist/cache/types.d.ts +32 -0
- package/dist/cache/types.js +1 -0
- package/dist/{core-3SOQ5ND6.cjs → core-7RP541eY.cjs} +18 -20
- package/dist/core-7RP541eY.cjs.map +1 -0
- package/dist/{core-6rY3oy32.d.cts → core-I9pWGafA.d.mts} +8 -8
- package/dist/{core-BYVWty_t.d.mts → core-TLJoDpJP.d.cts} +8 -8
- package/dist/{core-Bx0m6GOp.mjs → core-isLphYAZ.mjs} +18 -20
- package/dist/core-isLphYAZ.mjs.map +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +128 -0
- package/dist/core.js +137 -0
- package/dist/core.mjs +1 -1
- package/dist/derive/condenseVars.d.ts +7 -0
- package/dist/derive/condenseVars.js +30 -0
- package/dist/derive/declareVar.d.ts +26 -0
- package/dist/derive/declareVar.js +38 -0
- package/dist/derive/decodeVars.d.ts +9 -0
- package/dist/derive/decodeVars.js +52 -0
- package/dist/derive/derive.d.ts +53 -0
- package/dist/derive/derive.js +55 -0
- package/dist/derive/extractVars.d.ts +9 -0
- package/dist/derive/extractVars.js +34 -0
- package/dist/derive/index.d.ts +7 -0
- package/dist/derive/index.js +7 -0
- package/dist/derive/indexVars.d.ts +6 -0
- package/dist/derive/indexVars.js +52 -0
- package/dist/derive/utils/constants.d.ts +2 -0
- package/dist/derive/utils/constants.js +2 -0
- package/dist/derive/utils/regex.d.ts +2 -0
- package/dist/derive/utils/regex.js +4 -0
- package/dist/derive/utils/sanitizeVar.d.ts +12 -0
- package/dist/derive/utils/sanitizeVar.js +38 -0
- package/dist/derive/utils/traverseHelpers.d.ts +4 -0
- package/dist/derive/utils/traverseHelpers.js +22 -0
- package/dist/derive/utils/traverseIcu.d.ts +20 -0
- package/dist/derive/utils/traverseIcu.js +49 -0
- package/dist/derive/utils/types.d.ts +23 -0
- package/dist/derive/utils/types.js +1 -0
- package/dist/errors/ApiError.d.ts +7 -0
- package/dist/errors/ApiError.js +33 -0
- package/dist/errors/formattingErrors.d.ts +1 -0
- package/dist/errors/formattingErrors.js +3 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +1 -0
- package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +59 -0
- package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.js +147 -0
- package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +4 -0
- package/dist/formatting/custom-formats/CutoffFormat/constants.js +30 -0
- package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +48 -0
- package/dist/formatting/custom-formats/CutoffFormat/types.js +2 -0
- package/dist/formatting/format.d.ts +1 -0
- package/dist/formatting/format.js +257 -0
- package/dist/id/hashSource.d.ts +25 -0
- package/dist/id/hashSource.js +98 -0
- package/dist/id/hashTemplate.d.ts +4 -0
- package/dist/id/hashTemplate.js +6 -0
- package/dist/id/types.d.ts +7 -0
- package/dist/id/types.js +1 -0
- package/dist/{id-COlX5v3V.cjs → id-CyiXsQrY.cjs} +9 -9
- package/dist/id-CyiXsQrY.cjs.map +1 -0
- package/dist/{id-BmOyfaug.mjs → id-DbD7K-HL.mjs} +9 -9
- package/dist/id-DbD7K-HL.mjs.map +1 -0
- package/dist/id.cjs +1 -1
- package/dist/id.d.cts +9 -9
- package/dist/id.d.mts +9 -9
- package/dist/id.d.ts +3 -0
- package/dist/id.js +3 -0
- package/dist/id.mjs +1 -1
- package/dist/index.cjs +140 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +88 -88
- package/dist/index.d.mts +88 -88
- package/dist/index.d.ts +1019 -0
- package/dist/index.js +1664 -0
- package/dist/index.mjs +140 -140
- package/dist/index.mjs.map +1 -1
- package/dist/internal.cjs +41 -26
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +38 -23
- package/dist/internal.d.mts +38 -23
- package/dist/internal.d.ts +19 -0
- package/dist/internal.js +17 -0
- package/dist/internal.mjs +41 -26
- package/dist/internal.mjs.map +1 -1
- package/dist/locales/customLocaleMapping.d.ts +11 -0
- package/dist/locales/customLocaleMapping.js +23 -0
- package/dist/locales/determineLocale.d.ts +1 -0
- package/dist/locales/determineLocale.js +72 -0
- package/dist/locales/getLocaleDirection.d.ts +1 -0
- package/dist/locales/getLocaleDirection.js +89 -0
- package/dist/locales/getLocaleEmoji.d.ts +2 -0
- package/dist/locales/getLocaleEmoji.js +319 -0
- package/dist/locales/getLocaleName.d.ts +1 -0
- package/dist/locales/getLocaleName.js +45 -0
- package/dist/locales/getLocaleProperties.d.ts +32 -0
- package/dist/locales/getLocaleProperties.js +220 -0
- package/dist/locales/getPluralForm.d.ts +9 -0
- package/dist/locales/getPluralForm.js +63 -0
- package/dist/locales/getRegionProperties.d.ts +7 -0
- package/dist/locales/getRegionProperties.js +61 -0
- package/dist/locales/isSameDialect.d.ts +1 -0
- package/dist/locales/isSameDialect.js +41 -0
- package/dist/locales/isSameLanguage.d.ts +1 -0
- package/dist/locales/isSameLanguage.js +20 -0
- package/dist/locales/isSupersetLocale.d.ts +1 -0
- package/dist/locales/isSupersetLocale.js +22 -0
- package/dist/locales/isValidLocale.d.ts +1 -0
- package/dist/locales/isValidLocale.js +75 -0
- package/dist/locales/requiresTranslation.d.ts +1 -0
- package/dist/locales/requiresTranslation.js +32 -0
- package/dist/locales/resolveAliasLocale.d.ts +8 -0
- package/dist/locales/resolveAliasLocale.js +21 -0
- package/dist/locales/resolveCanonicalLocale.d.ts +8 -0
- package/dist/locales/resolveCanonicalLocale.js +13 -0
- package/dist/logging/errors.d.ts +10 -0
- package/dist/logging/errors.js +29 -0
- package/dist/logging/logger.d.ts +121 -0
- package/dist/logging/logger.js +259 -0
- package/dist/logging/warnings.d.ts +2 -0
- package/dist/logging/warnings.js +2 -0
- package/dist/projects/getProjectData.d.ts +1 -0
- package/dist/projects/getProjectData.js +87 -0
- package/dist/settings/plurals.d.ts +3 -0
- package/dist/settings/plurals.js +14 -0
- package/dist/settings/settings.d.ts +2 -0
- package/dist/settings/settings.js +2 -0
- package/dist/settings/settingsUrls.d.ts +3 -0
- package/dist/settings/settingsUrls.js +3 -0
- package/dist/translate/api.d.ts +1 -0
- package/dist/translate/api.js +1 -0
- package/dist/translate/awaitJobs.d.ts +19 -0
- package/dist/translate/awaitJobs.js +112 -0
- package/dist/translate/checkJobStatus.d.ts +8 -0
- package/dist/translate/checkJobStatus.js +55 -0
- package/dist/translate/createBranch.d.ts +10 -0
- package/dist/translate/createBranch.js +53 -0
- package/dist/translate/createTag.d.ts +19 -0
- package/dist/translate/createTag.js +67 -0
- package/dist/translate/downloadFileBatch.d.ts +1 -0
- package/dist/translate/downloadFileBatch.js +77 -0
- package/dist/translate/enqueueFiles.d.ts +8 -0
- package/dist/translate/enqueueFiles.js +96 -0
- package/dist/translate/getOrphanedFiles.d.ts +8 -0
- package/dist/translate/getOrphanedFiles.js +97 -0
- package/dist/translate/processFileMoves.d.ts +25 -0
- package/dist/translate/processFileMoves.js +90 -0
- package/dist/translate/publishFiles.d.ts +17 -0
- package/dist/translate/publishFiles.js +56 -0
- package/dist/translate/queryBranchData.d.ts +3 -0
- package/dist/translate/queryBranchData.js +53 -0
- package/dist/translate/queryFileData.d.ts +42 -0
- package/dist/translate/queryFileData.js +71 -0
- package/dist/translate/querySourceFile.d.ts +1 -0
- package/dist/translate/querySourceFile.js +67 -0
- package/dist/translate/setupProject.d.ts +11 -0
- package/dist/translate/setupProject.js +63 -0
- package/dist/translate/submitUserEditDiffs.d.ts +12 -0
- package/dist/translate/submitUserEditDiffs.js +68 -0
- package/dist/translate/translateMany.d.ts +1 -0
- package/dist/translate/translateMany.js +103 -0
- package/dist/translate/uploadSourceFiles.d.ts +1 -0
- package/dist/translate/uploadSourceFiles.js +87 -0
- package/dist/translate/uploadTranslations.d.ts +1 -0
- package/dist/translate/uploadTranslations.js +101 -0
- package/dist/translate/utils/apiRequest.d.ts +1 -0
- package/dist/translate/utils/apiRequest.js +130 -0
- package/dist/translate/utils/batch.d.ts +52 -0
- package/dist/translate/utils/batch.js +126 -0
- package/dist/translate/utils/fetchWithTimeout.d.ts +1 -0
- package/dist/translate/utils/fetchWithTimeout.js +93 -0
- package/dist/translate/utils/generateRequestHeaders.d.ts +2 -0
- package/dist/translate/utils/generateRequestHeaders.js +26 -0
- package/dist/translate/utils/handleFetchError.d.ts +1 -0
- package/dist/translate/utils/handleFetchError.js +12 -0
- package/dist/translate/utils/validateFileFormatTransform.d.ts +16 -0
- package/dist/translate/utils/validateFileFormatTransform.js +29 -0
- package/dist/translate/utils/validateResponse.d.ts +1 -0
- package/dist/translate/utils/validateResponse.js +72 -0
- package/dist/{types-Cy8q2XZX.d.mts → types-AHtYZIP-.d.mts} +63 -40
- package/dist/{types-NKhpChvT.d.cts → types-Bf8_Apq_.d.cts} +63 -40
- package/dist/types-dir/api/branch.d.ts +10 -0
- package/dist/types-dir/api/branch.js +1 -0
- package/dist/types-dir/api/checkFileTranslations.d.ts +37 -0
- package/dist/types-dir/api/checkFileTranslations.js +1 -0
- package/dist/types-dir/api/downloadFile.d.ts +3 -0
- package/dist/types-dir/api/downloadFile.js +1 -0
- package/dist/types-dir/api/downloadFileBatch.d.ts +35 -0
- package/dist/types-dir/api/downloadFileBatch.js +1 -0
- package/dist/types-dir/api/enqueueEntries.d.ts +21 -0
- package/dist/types-dir/api/enqueueEntries.js +1 -0
- package/dist/types-dir/api/enqueueFiles.d.ts +70 -0
- package/dist/types-dir/api/enqueueFiles.js +1 -0
- package/dist/types-dir/api/entry.d.ts +39 -0
- package/dist/types-dir/api/entry.js +1 -0
- package/dist/types-dir/api/fetchTranslations.d.ts +12 -0
- package/dist/types-dir/api/fetchTranslations.js +1 -0
- package/dist/types-dir/api/file.d.ts +57 -0
- package/dist/types-dir/api/file.js +1 -0
- package/dist/types-dir/api/json.d.ts +5 -0
- package/dist/types-dir/api/json.js +1 -0
- package/dist/types-dir/api/project.d.ts +7 -0
- package/dist/types-dir/api/project.js +1 -0
- package/dist/types-dir/api/translate.d.ts +34 -0
- package/dist/types-dir/api/translate.js +1 -0
- package/dist/types-dir/api/translateMany.d.ts +5 -0
- package/dist/types-dir/api/translateMany.js +1 -0
- package/dist/types-dir/api/translationStatus.d.ts +9 -0
- package/dist/types-dir/api/translationStatus.js +1 -0
- package/dist/types-dir/api/uploadFiles.d.ts +44 -0
- package/dist/types-dir/api/uploadFiles.js +1 -0
- package/dist/types-dir/jsx/content.d.ts +61 -0
- package/dist/types-dir/jsx/content.js +11 -0
- package/dist/types-dir/jsx/variables.d.ts +9 -0
- package/dist/types-dir/jsx/variables.js +1 -0
- package/dist/types-dir/transformations.d.ts +8 -0
- package/dist/types-dir/transformations.js +1 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +129 -0
- package/dist/types.js +2 -0
- package/dist/types.mjs.map +1 -1
- package/dist/utils/base64.d.ts +2 -0
- package/dist/utils/base64.js +28 -0
- package/dist/utils/isSupportedFileFormatTransform.d.ts +8 -0
- package/dist/utils/isSupportedFileFormatTransform.js +26 -0
- package/dist/utils/isVariable.d.ts +2 -0
- package/dist/utils/isVariable.js +22 -0
- package/dist/utils/minify.d.ts +2 -0
- package/dist/utils/minify.js +10 -0
- package/dist/utils/stableStringify.d.ts +1 -0
- package/dist/utils/stableStringify.js +40 -0
- package/package.json +5 -6
- package/dist/IntlCache-Ccg_cQPR.mjs.map +0 -1
- package/dist/IntlCache-k2qfrDqB.cjs.map +0 -1
- package/dist/base64-C1sogiix.mjs.map +0 -1
- package/dist/base64-CUcEPEC5.cjs.map +0 -1
- package/dist/core-3SOQ5ND6.cjs.map +0 -1
- package/dist/core-Bx0m6GOp.mjs.map +0 -1
- package/dist/id-BmOyfaug.mjs.map +0 -1
- package/dist/id-COlX5v3V.cjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as standardizeLocale, c as CutoffFormatOptions, i as resolveCanonicalLocale, n as formatMessage, o as LocaleConfig, r as isValidLocale, s as LocaleConfigConstructorParams, t as formatCutoff } from "./core-
|
|
2
|
-
import { $ as FileReference, A as BranchDataResult, B as FileUpload, C as ProcessMovesOptions, D as FileDataQuery, F as DownloadFileOptions, H as UploadFilesResponse, I as PublishFileEntry, J as DownloadFileBatchOptions, L as PublishFilesResult, M as TranslationError,
|
|
1
|
+
import { a as standardizeLocale, c as CutoffFormatOptions, i as resolveCanonicalLocale, n as formatMessage, o as LocaleConfig, r as isValidLocale, s as LocaleConfigConstructorParams, t as formatCutoff } from "./core-I9pWGafA.mjs";
|
|
2
|
+
import { $ as FileReference, A as BranchDataResult, B as FileUpload, C as ProcessMovesOptions, D as FileDataQuery, F as DownloadFileOptions, Ft as LocaleProperties, H as UploadFilesResponse, I as PublishFileEntry, It as CustomMapping, J as DownloadFileBatchOptions, L as PublishFilesResult, M as TranslationError, N as TranslationResult, O as FileDataResult, T as GetOrphanedFilesResult, U as CreateTagOptions, V as UploadFilesOptions, W as CreateTagResult, X as DownloadFileBatchResult, Y as DownloadFileBatchRequest, _ as AwaitJobsResult, _t as TranslateManyEntry, at as CheckFileTranslationsOptions, et as FileReferenceIds, g as AwaitJobsOptions, h as SubmitUserEditDiffsPayload, j as TranslateManyResult, jt as StringFormat, k as BranchQuery, n as FormatVariables, ot as FileQuery, rt as EnqueueFilesResult, st as FileQueryResult, vt as TranslateOptions, w as ProcessMovesResponse, x as MoveMapping, y as CheckJobStatusResult } from "./types-AHtYZIP-.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/translate/setupProject.d.ts
|
|
5
5
|
type SetupProjectResult = {
|
|
@@ -148,14 +148,14 @@ declare class GT {
|
|
|
148
148
|
* Queries branch information from the API.
|
|
149
149
|
*
|
|
150
150
|
* @param {BranchQuery} query - Object mapping the current branch and incoming branches
|
|
151
|
-
* @returns {Promise<BranchDataResult>} The branch information
|
|
151
|
+
* @returns {Promise<BranchDataResult>} The branch information.
|
|
152
152
|
*/
|
|
153
153
|
queryBranchData(query: BranchQuery): Promise<BranchDataResult>;
|
|
154
154
|
/**
|
|
155
155
|
* Creates a new branch in the API. If the branch already exists, it will be returned.
|
|
156
156
|
*
|
|
157
157
|
* @param {CreateBranchQuery} query - Object mapping the branch name and default branch flag
|
|
158
|
-
* @returns {Promise<CreateBranchResult>} The created branch information
|
|
158
|
+
* @returns {Promise<CreateBranchResult>} The created branch information.
|
|
159
159
|
*/
|
|
160
160
|
createBranch(query: CreateBranchQuery): Promise<CreateBranchResult>;
|
|
161
161
|
/**
|
|
@@ -164,7 +164,7 @@ declare class GT {
|
|
|
164
164
|
*
|
|
165
165
|
* @param {MoveMapping[]} moves - Array of move mappings (old fileId to new fileId)
|
|
166
166
|
* @param {ProcessMovesOptions} options - Options including branchId and timeout
|
|
167
|
-
* @returns {Promise<ProcessMovesResponse>} The move processing results
|
|
167
|
+
* @returns {Promise<ProcessMovesResponse>} The move processing results.
|
|
168
168
|
*
|
|
169
169
|
* @example
|
|
170
170
|
* const result = await gt.processFileMoves([
|
|
@@ -177,10 +177,10 @@ declare class GT {
|
|
|
177
177
|
* but whose fileIds are not in the provided list.
|
|
178
178
|
* Used for move detection.
|
|
179
179
|
*
|
|
180
|
-
* @param {string} branchId - The branch to check for orphaned files
|
|
180
|
+
* @param {string} branchId - The branch to check for orphaned files.
|
|
181
181
|
* @param {string[]} fileIds - List of current file IDs (files that are NOT orphaned)
|
|
182
|
-
* @param {Object} options - Options including timeout
|
|
183
|
-
* @returns {Promise<GetOrphanedFilesResult>} The orphaned files
|
|
182
|
+
* @param {Object} options - Options including timeout.
|
|
183
|
+
* @returns {Promise<GetOrphanedFilesResult>} The orphaned files.
|
|
184
184
|
*
|
|
185
185
|
* @example
|
|
186
186
|
* const result = await gt.getOrphanedFiles('branch-id', ['file-1', 'file-2']);
|
|
@@ -197,7 +197,7 @@ declare class GT {
|
|
|
197
197
|
* for processing and will generate a project setup based on the source files.
|
|
198
198
|
*
|
|
199
199
|
* @param {FileReference[]} files - Array of file references containing IDs of previously uploaded source files
|
|
200
|
-
* @param {SetupProjectOptions} [options] - Optional settings for target locales and timeout
|
|
200
|
+
* @param {SetupProjectOptions} [options] - Optional settings for target locales and timeout.
|
|
201
201
|
* @returns {Promise<SetupProjectResult>} Object containing the jobId and status
|
|
202
202
|
*/
|
|
203
203
|
setupProject(files: FileReference[], options?: SetupProjectOptions): Promise<SetupProjectResult>;
|
|
@@ -207,9 +207,9 @@ declare class GT {
|
|
|
207
207
|
* This method polls the API to determine whether one or more jobs are still running,
|
|
208
208
|
* have completed successfully, or have failed. Jobs are created after calling either enqueueFiles or setupProject.
|
|
209
209
|
*
|
|
210
|
-
* @param {string[]} jobIds - The unique identifiers of the jobs to check
|
|
211
|
-
* @param {number} [timeoutMs] - Optional timeout in milliseconds for the API request
|
|
212
|
-
* @returns {Promise<CheckJobStatusResult>} Object containing the job status
|
|
210
|
+
* @param {string[]} jobIds - The unique identifiers of the jobs to check.
|
|
211
|
+
* @param {number} [timeoutMs] - Optional timeout in milliseconds for the API request.
|
|
212
|
+
* @returns {Promise<CheckJobStatusResult>} Object containing the job status.
|
|
213
213
|
*
|
|
214
214
|
* @example
|
|
215
215
|
* const result = await gt.checkJobStatus([
|
|
@@ -223,9 +223,9 @@ declare class GT {
|
|
|
223
223
|
/**
|
|
224
224
|
* Polls job statuses until all jobs from enqueueFiles are finished or the timeout is reached.
|
|
225
225
|
*
|
|
226
|
-
* @param {EnqueueFilesResult} enqueueResult - The result returned from enqueueFiles
|
|
227
|
-
* @param {AwaitJobsOptions} [options] - Polling configuration (interval, timeout)
|
|
228
|
-
* @returns {Promise<AwaitJobsResult>} The final status of all jobs and whether they all completed
|
|
226
|
+
* @param {EnqueueFilesResult} enqueueResult - The result returned from enqueueFiles.
|
|
227
|
+
* @param {AwaitJobsOptions} [options] - Polling configuration (interval, timeout).
|
|
228
|
+
* @returns {Promise<AwaitJobsResult>} The final status of all jobs and whether they all completed.
|
|
229
229
|
*/
|
|
230
230
|
awaitJobs(enqueueResult: EnqueueFilesResult, options?: AwaitJobsOptions): Promise<AwaitJobsResult>;
|
|
231
231
|
/**
|
|
@@ -238,8 +238,8 @@ declare class GT {
|
|
|
238
238
|
* generate translated content based on the source files and target locales provided.
|
|
239
239
|
*
|
|
240
240
|
* @param {FileReferenceIds[]} files - Array of file references containing IDs of previously uploaded source files
|
|
241
|
-
* @param {EnqueueOptions} options - Configuration options including source locale, target locales, and job settings
|
|
242
|
-
* @returns {Promise<EnqueueFilesResult>} Result containing job IDs, queue status, and processing information
|
|
241
|
+
* @param {EnqueueOptions} options - Configuration options including source locale, target locales, and job settings.
|
|
242
|
+
* @returns {Promise<EnqueueFilesResult>} Result containing job IDs, queue status, and processing information.
|
|
243
243
|
*/
|
|
244
244
|
enqueueFiles(files: FileReferenceIds[], options: EnqueueOptions): Promise<EnqueueFilesResult>;
|
|
245
245
|
/**
|
|
@@ -247,7 +247,7 @@ declare class GT {
|
|
|
247
247
|
* with a user-defined tag ID and optional message.
|
|
248
248
|
*
|
|
249
249
|
* @param {CreateTagOptions} options - Tag creation options including tagId, sourceFileIds, and optional message
|
|
250
|
-
* @returns {Promise<CreateTagResult>} The created or updated tag
|
|
250
|
+
* @returns {Promise<CreateTagResult>} The created or updated tag.
|
|
251
251
|
*/
|
|
252
252
|
createTag(options: CreateTagOptions): Promise<CreateTagResult>;
|
|
253
253
|
/**
|
|
@@ -416,8 +416,8 @@ declare class GT {
|
|
|
416
416
|
* translations through the translation workflow.
|
|
417
417
|
*
|
|
418
418
|
* @param {Array<{source: FileUpload}>} files - Array of objects containing source file data to upload
|
|
419
|
-
* @param {UploadFilesOptions} options - Configuration options including source locale and other upload settings
|
|
420
|
-
* @returns {Promise<UploadFilesResponse>} Upload result containing file IDs, version information, and upload status
|
|
419
|
+
* @param {UploadFilesOptions} options - Configuration options including source locale and other upload settings.
|
|
420
|
+
* @returns {Promise<UploadFilesResponse>} Upload result containing file IDs, version information, and upload status.
|
|
421
421
|
*/
|
|
422
422
|
uploadSourceFiles(files: {
|
|
423
423
|
source: FileUpload;
|
|
@@ -431,10 +431,10 @@ declare class GT {
|
|
|
431
431
|
* that you want to upload directly rather than generating them through the translation service.
|
|
432
432
|
*
|
|
433
433
|
* @param {Array<{source: FileUpload, translations: FileUpload[]}>} files - Array of file objects where:
|
|
434
|
-
* - `source`: Reference to the existing source file (contains IDs but no content)
|
|
434
|
+
* - `source`: Reference to the existing source file (contains IDs but no content).
|
|
435
435
|
* - `translations`: Array of translated files, each containing content, locale, and reference IDs
|
|
436
|
-
* @param {UploadFilesOptions} options - Configuration options including source locale and upload settings
|
|
437
|
-
* @returns {Promise<UploadFilesResponse>} Upload result containing translation IDs, status, and processing information
|
|
436
|
+
* @param {UploadFilesOptions} options - Configuration options including source locale and upload settings.
|
|
437
|
+
* @returns {Promise<UploadFilesResponse>} Upload result containing translation IDs, status, and processing information.
|
|
438
438
|
*/
|
|
439
439
|
uploadTranslations(files: {
|
|
440
440
|
source: FileUpload;
|
|
@@ -496,11 +496,11 @@ declare class GT {
|
|
|
496
496
|
/**
|
|
497
497
|
* Formats a number according to the specified locales and options.
|
|
498
498
|
*
|
|
499
|
-
* @param {number} number - The number to format
|
|
500
|
-
* @param {Object} [options] - Additional options for number formatting
|
|
501
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
502
|
-
* @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options
|
|
503
|
-
* @returns {string} The formatted number
|
|
499
|
+
* @param {number} number - The number to format.
|
|
500
|
+
* @param {Object} [options] - Additional options for number formatting.
|
|
501
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
502
|
+
* @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options.
|
|
503
|
+
* @returns {string} The formatted number.
|
|
504
504
|
*
|
|
505
505
|
* @example
|
|
506
506
|
* gt.formatNum(1234.56, { style: 'currency', currency: 'USD' });
|
|
@@ -512,11 +512,11 @@ declare class GT {
|
|
|
512
512
|
/**
|
|
513
513
|
* Formats a date according to the specified locales and options.
|
|
514
514
|
*
|
|
515
|
-
* @param {Date} date - The date to format
|
|
516
|
-
* @param {Object} [options] - Additional options for date formatting
|
|
517
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
518
|
-
* @param {Intl.DateTimeFormatOptions} [options] - Additional Intl.DateTimeFormat options
|
|
519
|
-
* @returns {string} The formatted date
|
|
515
|
+
* @param {Date} date - The date to format.
|
|
516
|
+
* @param {Object} [options] - Additional options for date formatting.
|
|
517
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
518
|
+
* @param {Intl.DateTimeFormatOptions} [options] - Additional Intl.DateTimeFormat options.
|
|
519
|
+
* @returns {string} The formatted date.
|
|
520
520
|
*
|
|
521
521
|
* @example
|
|
522
522
|
* gt.formatDateTime(new Date(), { dateStyle: 'full', timeStyle: 'long' });
|
|
@@ -528,12 +528,12 @@ declare class GT {
|
|
|
528
528
|
/**
|
|
529
529
|
* Formats a currency value according to the specified locales and options.
|
|
530
530
|
*
|
|
531
|
-
* @param {number} value - The currency value to format
|
|
531
|
+
* @param {number} value - The currency value to format.
|
|
532
532
|
* @param {string} currency - The currency code (e.g., 'USD', 'EUR')
|
|
533
|
-
* @param {Object} [options] - Additional options for currency formatting
|
|
534
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
535
|
-
* @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options
|
|
536
|
-
* @returns {string} The formatted currency value
|
|
533
|
+
* @param {Object} [options] - Additional options for currency formatting.
|
|
534
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
535
|
+
* @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options.
|
|
536
|
+
* @returns {string} The formatted currency value.
|
|
537
537
|
*
|
|
538
538
|
* @example
|
|
539
539
|
* gt.formatCurrency(1234.56, 'USD', { style: 'currency' });
|
|
@@ -545,11 +545,11 @@ declare class GT {
|
|
|
545
545
|
/**
|
|
546
546
|
* Formats a list of items according to the specified locales and options.
|
|
547
547
|
*
|
|
548
|
-
* @param {Array<string | number>} array - The list of items to format
|
|
549
|
-
* @param {Object} [options] - Additional options for list formatting
|
|
550
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
551
|
-
* @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options
|
|
552
|
-
* @returns {string} The formatted list
|
|
548
|
+
* @param {Array<string | number>} array - The list of items to format.
|
|
549
|
+
* @param {Object} [options] - Additional options for list formatting.
|
|
550
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
551
|
+
* @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options.
|
|
552
|
+
* @returns {string} The formatted list.
|
|
553
553
|
*
|
|
554
554
|
* @example
|
|
555
555
|
* gt.formatList(['apple', 'banana', 'orange'], { type: 'conjunction' });
|
|
@@ -560,11 +560,11 @@ declare class GT {
|
|
|
560
560
|
} & Intl.ListFormatOptions): string;
|
|
561
561
|
/**
|
|
562
562
|
* Formats a list of items according to the specified locales and options.
|
|
563
|
-
* @param {Array<T>} array - The list of items to format
|
|
564
|
-
* @param {Object} [options] - Additional options for list formatting
|
|
565
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
566
|
-
* @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options
|
|
567
|
-
* @returns {Array<T | string>} The formatted list parts
|
|
563
|
+
* @param {Array<T>} array - The list of items to format.
|
|
564
|
+
* @param {Object} [options] - Additional options for list formatting.
|
|
565
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
566
|
+
* @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options.
|
|
567
|
+
* @returns {Array<T | string>} The formatted list parts.
|
|
568
568
|
*
|
|
569
569
|
* @example
|
|
570
570
|
* gt.formatListToParts(['apple', 42, { foo: 'bar' }], { type: 'conjunction', style: 'short', locales: ['en'] });
|
|
@@ -576,12 +576,12 @@ declare class GT {
|
|
|
576
576
|
/**
|
|
577
577
|
* Formats a relative time value according to the specified locales and options.
|
|
578
578
|
*
|
|
579
|
-
* @param {number} value - The relative time value to format
|
|
579
|
+
* @param {number} value - The relative time value to format.
|
|
580
580
|
* @param {Intl.RelativeTimeFormatUnit} unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year')
|
|
581
|
-
* @param {Object} options - Additional options for relative time formatting
|
|
582
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
583
|
-
* @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options
|
|
584
|
-
* @returns {string} The formatted relative time string
|
|
581
|
+
* @param {Object} options - Additional options for relative time formatting.
|
|
582
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
583
|
+
* @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options.
|
|
584
|
+
* @returns {string} The formatted relative time string.
|
|
585
585
|
*
|
|
586
586
|
* @example
|
|
587
587
|
* gt.formatRelativeTime(-1, 'day', { locales: ['en-US'], numeric: 'auto' });
|
|
@@ -593,9 +593,9 @@ declare class GT {
|
|
|
593
593
|
/**
|
|
594
594
|
* Formats a relative time string from a Date, automatically selecting the best unit.
|
|
595
595
|
*
|
|
596
|
-
* @param {Date} date - The date to format relative to now
|
|
597
|
-
* @param {Object} [options] - Additional options for relative time formatting
|
|
598
|
-
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
596
|
+
* @param {Date} date - The date to format relative to now.
|
|
597
|
+
* @param {Object} [options] - Additional options for relative time formatting.
|
|
598
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting.
|
|
599
599
|
* @returns {string} The formatted relative time string (e.g., "2 hours ago", "in 3 days")
|
|
600
600
|
*
|
|
601
601
|
* @example
|
|
@@ -609,9 +609,9 @@ declare class GT {
|
|
|
609
609
|
/**
|
|
610
610
|
* Retrieves the display name of a locale code using Intl.DisplayNames, returning an empty string if no name is found.
|
|
611
611
|
*
|
|
612
|
-
* @param {string} [locale=this.targetLocale] - A BCP-47 locale code
|
|
613
|
-
* @returns {string} The display name corresponding to the code
|
|
614
|
-
* @throws {Error} If no target locale is provided
|
|
612
|
+
* @param {string} [locale=this.targetLocale] - A BCP-47 locale code.
|
|
613
|
+
* @returns {string} The display name corresponding to the code.
|
|
614
|
+
* @throws {Error} If no target locale is provided.
|
|
615
615
|
*
|
|
616
616
|
* @example
|
|
617
617
|
* gt.getLocaleName('es-ES');
|
|
@@ -623,8 +623,8 @@ declare class GT {
|
|
|
623
623
|
* Uses the locale's region (if present) to select an emoji or falls back on default emojis.
|
|
624
624
|
*
|
|
625
625
|
* @param {string} [locale=this.targetLocale] - A BCP-47 locale code (e.g., 'en-US', 'fr-CA')
|
|
626
|
-
* @returns {string} The emoji representing the locale or its region
|
|
627
|
-
* @throws {Error} If no target locale is provided
|
|
626
|
+
* @returns {string} The emoji representing the locale or its region.
|
|
627
|
+
* @throws {Error} If no target locale is provided.
|
|
628
628
|
*
|
|
629
629
|
* @example
|
|
630
630
|
* gt.getLocaleEmoji('es-ES');
|
|
@@ -709,12 +709,12 @@ declare class GT {
|
|
|
709
709
|
/**
|
|
710
710
|
* Determines whether a translation is required based on the source and target locales.
|
|
711
711
|
*
|
|
712
|
-
* @param {string} [sourceLocale=this.sourceLocale] - The locale code for the original content
|
|
713
|
-
* @param {string} [targetLocale=this.targetLocale] - The locale code to translate into
|
|
714
|
-
* @param {string[]} [approvedLocales=this.locales] - Optional array of approved target locales
|
|
712
|
+
* @param {string} [sourceLocale=this.sourceLocale] - The locale code for the original content.
|
|
713
|
+
* @param {string} [targetLocale=this.targetLocale] - The locale code to translate into.
|
|
714
|
+
* @param {string[]} [approvedLocales=this.locales] - Optional array of approved target locales.
|
|
715
715
|
* @returns {boolean} True if translation is required, false otherwise
|
|
716
|
-
* @throws {Error} If no source locale is provided
|
|
717
|
-
* @throws {Error} If no target locale is provided
|
|
716
|
+
* @throws {Error} If no source locale is provided.
|
|
717
|
+
* @throws {Error} If no target locale is provided.
|
|
718
718
|
*
|
|
719
719
|
* @example
|
|
720
720
|
* gt.requiresTranslation('en-US', 'es-ES');
|
|
@@ -724,9 +724,9 @@ declare class GT {
|
|
|
724
724
|
/**
|
|
725
725
|
* Determines the best matching locale from the provided approved locales list.
|
|
726
726
|
*
|
|
727
|
-
* @param {string | string[]} locales - A single locale or array of locales in preference order
|
|
728
|
-
* @param {string[]} [approvedLocales=this.locales] - Array of approved locales in preference order
|
|
729
|
-
* @returns {string | undefined} The best matching locale or undefined if no match is found
|
|
727
|
+
* @param {string | string[]} locales - A single locale or array of locales in preference order.
|
|
728
|
+
* @param {string[]} [approvedLocales=this.locales] - Array of approved locales in preference order.
|
|
729
|
+
* @returns {string | undefined} The best matching locale, or undefined if no match is found.
|
|
730
730
|
*
|
|
731
731
|
* @example
|
|
732
732
|
* gt.determineLocale(['fr-CA', 'fr-FR'], ['en-US', 'fr-FR', 'es-ES']);
|
|
@@ -736,9 +736,9 @@ declare class GT {
|
|
|
736
736
|
/**
|
|
737
737
|
* Gets the text direction for a given locale code.
|
|
738
738
|
*
|
|
739
|
-
* @param {string} [locale=this.targetLocale] - A BCP-47 locale code
|
|
740
|
-
* @returns {'ltr' | 'rtl'} 'rtl' if the locale is right-to-left
|
|
741
|
-
* @throws {Error} If no target locale is provided
|
|
739
|
+
* @param {string} [locale=this.targetLocale] - A BCP-47 locale code.
|
|
740
|
+
* @returns {'ltr' | 'rtl'} 'rtl' if the locale is right-to-left; otherwise 'ltr'.
|
|
741
|
+
* @throws {Error} If no target locale is provided.
|
|
742
742
|
*
|
|
743
743
|
* @example
|
|
744
744
|
* gt.getLocaleDirection('ar-SA');
|
|
@@ -748,10 +748,10 @@ declare class GT {
|
|
|
748
748
|
/**
|
|
749
749
|
* Checks if a given BCP 47 locale code is valid.
|
|
750
750
|
*
|
|
751
|
-
* @param {string} [locale=this.targetLocale] - The BCP 47 locale code to validate
|
|
752
|
-
* @param {
|
|
751
|
+
* @param {string} [locale=this.targetLocale] - The BCP 47 locale code to validate.
|
|
752
|
+
* @param {CustomMapping} [customMapping=this.customMapping] - The custom mapping to use for validation.
|
|
753
753
|
* @returns {boolean} True if the locale code is valid, false otherwise
|
|
754
|
-
* @throws {Error} If no target locale is provided
|
|
754
|
+
* @throws {Error} If no target locale is provided.
|
|
755
755
|
*
|
|
756
756
|
* @example
|
|
757
757
|
* gt.isValidLocale('en-US');
|
|
@@ -762,22 +762,22 @@ declare class GT {
|
|
|
762
762
|
* Resolves the canonical locale for a given locale.
|
|
763
763
|
* @param locale - The locale to resolve the canonical locale for
|
|
764
764
|
* @param customMapping - The custom mapping to use for resolving the canonical locale
|
|
765
|
-
* @returns The canonical locale
|
|
765
|
+
* @returns The canonical locale, or the input locale when no canonical mapping exists.
|
|
766
766
|
*/
|
|
767
767
|
resolveCanonicalLocale(locale?: string | undefined, customMapping?: CustomMapping | undefined): string;
|
|
768
768
|
/**
|
|
769
769
|
* Resolves the alias locale for a given locale.
|
|
770
770
|
* @param locale - The locale to resolve the alias locale for
|
|
771
771
|
* @param customMapping - The custom mapping to use for resolving the alias locale
|
|
772
|
-
* @returns The alias locale
|
|
772
|
+
* @returns The configured alias for a canonical locale, or the input locale when already an alias or no alias mapping exists.
|
|
773
773
|
*/
|
|
774
774
|
resolveAliasLocale(locale: string, customMapping?: CustomMapping | undefined): string;
|
|
775
775
|
/**
|
|
776
776
|
* Standardizes a BCP 47 locale code to ensure correct formatting.
|
|
777
777
|
*
|
|
778
|
-
* @param {string} [locale=this.targetLocale] - The BCP 47 locale code to standardize
|
|
779
|
-
* @returns {string} The standardized locale code or
|
|
780
|
-
* @throws {Error} If no target locale is provided
|
|
778
|
+
* @param {string} [locale=this.targetLocale] - The BCP 47 locale code to standardize.
|
|
779
|
+
* @returns {string} The standardized locale code, or the input string if it cannot be standardized.
|
|
780
|
+
* @throws {Error} If no target locale is provided.
|
|
781
781
|
*
|
|
782
782
|
* @example
|
|
783
783
|
* gt.standardizeLocale('en_us');
|
|
@@ -787,7 +787,7 @@ declare class GT {
|
|
|
787
787
|
/**
|
|
788
788
|
* Checks if multiple BCP 47 locale codes represent the same dialect.
|
|
789
789
|
*
|
|
790
|
-
* @param {...(string | string[])} locales - The BCP 47 locale codes to compare
|
|
790
|
+
* @param {...(string | string[])} locales - The BCP 47 locale codes to compare.
|
|
791
791
|
* @returns {boolean} True if all codes represent the same dialect, false otherwise
|
|
792
792
|
*
|
|
793
793
|
* @example
|
|
@@ -801,7 +801,7 @@ declare class GT {
|
|
|
801
801
|
/**
|
|
802
802
|
* Checks if multiple BCP 47 locale codes represent the same language.
|
|
803
803
|
*
|
|
804
|
-
* @param {...(string | string[])} locales - The BCP 47 locale codes to compare
|
|
804
|
+
* @param {...(string | string[])} locales - The BCP 47 locale codes to compare.
|
|
805
805
|
* @returns {boolean} True if all codes represent the same language, false otherwise
|
|
806
806
|
*
|
|
807
807
|
* @example
|
|
@@ -872,11 +872,11 @@ declare function formatList(array: Array<string | number>, options: {
|
|
|
872
872
|
} & Intl.ListFormatOptions): string;
|
|
873
873
|
/**
|
|
874
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
|
|
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
880
|
*/
|
|
881
881
|
declare function formatListToParts<T>(array: Array<T>, options?: {
|
|
882
882
|
locales?: string | string[];
|
|
@@ -1024,7 +1024,7 @@ declare function determineLocale(locales: string | string[], approvedLocales?: s
|
|
|
1024
1024
|
* Get the text direction for a given locale code using the Intl.Locale API.
|
|
1025
1025
|
*
|
|
1026
1026
|
* @param {string} locale - A BCP-47 locale code.
|
|
1027
|
-
* @returns {string}
|
|
1027
|
+
* @returns {string} 'rtl' if the locale is right-to-left; otherwise 'ltr'.
|
|
1028
1028
|
*/
|
|
1029
1029
|
declare function getLocaleDirection(locale: string): 'ltr' | 'rtl';
|
|
1030
1030
|
/**
|