@@ -172,6 +172,8 @@ export class Translations extends CrowdinApi {
172172 }
173173
174174 /**
175+ * @deprecated
176+ *
175177 * @param projectId project identifier
176178 * @param languageId language identifier
177179 * @param request request body
@@ -186,6 +188,9 @@ export class Translations extends CrowdinApi {
186188 return this . post ( url , request , this . defaultConfig ( ) ) ;
187189 }
188190
191+ /**
192+ * @deprecated
193+ */
189194 uploadTranslationStrings (
190195 projectId : number ,
191196 languageId : string ,
@@ -237,6 +242,61 @@ export class Translations extends CrowdinApi {
237242 const url = `${ this . url } /projects/${ projectId } /translations/exports` ;
238243 return this . post ( url , request , this . defaultConfig ( ) ) ;
239244 }
245+
246+ /**
247+ * @param projectId project identifier
248+ * @param request request body
249+ * @see https://support.crowdin.com/developer/api/v2/#tag/Translations/operation/api.projects.translations.imports
250+ */
251+ importTranslations (
252+ projectId : number ,
253+ request : TranslationsModel . ImportTranslationsRequest | TranslationsModel . ImportTranslationsStringsRequest ,
254+ ) : Promise <
255+ ResponseObject <
256+ Status <
257+ | TranslationsModel . ImportTranslationsStatusAttributes
258+ | TranslationsModel . ImportTranslationsStringsStatusAttributes
259+ >
260+ >
261+ > {
262+ const url = `${ this . url } /projects/${ projectId } /translations/imports` ;
263+ return this . post ( url , request , this . defaultConfig ( ) ) ;
264+ }
265+
266+ /**
267+ * @param projectId project identifier
268+ * @param importId import identifier
269+ * @see https://support.crowdin.com/developer/api/v2/#tag/Translations/operation/api.projects.translations.imports.get
270+ */
271+ importTranslationsStatus (
272+ projectId : number ,
273+ importId : string ,
274+ ) : Promise <
275+ ResponseObject <
276+ Status <
277+ | TranslationsModel . ImportTranslationsStatusAttributes
278+ | TranslationsModel . ImportTranslationsStringsStatusAttributes
279+ >
280+ >
281+ > {
282+ const url = `${ this . url } /projects/${ projectId } /translations/imports/${ importId } ` ;
283+ return this . get ( url , this . defaultConfig ( ) ) ;
284+ }
285+
286+ /**
287+ * @param projectId project identifier
288+ * @param importId import identifier
289+ * @see https://support.crowdin.com/developer/api/v2/#tag/Translations/operation/api.projects.translations.imports.report.get
290+ */
291+ importTranslationsReport (
292+ projectId : number ,
293+ importId : string ,
294+ ) : Promise <
295+ ResponseObject < TranslationsModel . ImportTranslationsReport | TranslationsModel . ImportTranslationsStringsReport >
296+ > {
297+ const url = `${ this . url } /projects/${ projectId } /translations/imports/${ importId } /report` ;
298+ return this . get ( url , this . defaultConfig ( ) ) ;
299+ }
240300}
241301
242302export namespace TranslationsModel {
@@ -447,7 +507,7 @@ export namespace TranslationsModel {
447507 }
448508
449509 export interface TargetLanguageFile {
450- id : string ;
510+ id : number ;
451511 statistics : TargetLanguageFileStatistics ;
452512 }
453513
@@ -459,4 +519,101 @@ export namespace TranslationsModel {
459519 export interface SkippedInfo {
460520 [ key : string ] : any ;
461521 }
522+
523+ /* Import Translations START */
524+
525+ export interface ImportTranslationsRequest {
526+ storageId : number ;
527+ languageIds ?: string [ ] ;
528+ fileId ?: number ;
529+ importEqSuggestions ?: boolean ;
530+ autoApproveImported ?: boolean ;
531+ translateHidden ?: boolean ;
532+ addToTm ?: boolean ;
533+ }
534+
535+ export interface ImportTranslationsStringsRequest {
536+ storageId : number ;
537+ languageIds ?: string [ ] ;
538+ branchId : number ;
539+ importEqSuggestions ?: boolean ;
540+ autoApproveImported ?: boolean ;
541+ translateHidden ?: boolean ;
542+ addToTm ?: boolean ;
543+ importOptions ?: {
544+ scheme ?: {
545+ none ?: number ;
546+ identifier ?: number ;
547+ sourceOrTranslation ?: number ;
548+ translation ?: number ;
549+ [ languageCode : string ] : number | undefined ;
550+ } ;
551+ } ;
552+ }
553+
554+ export interface ImportTranslationsStatusAttributes {
555+ storageId : number ;
556+ fileId : number ;
557+ importEqSuggestions : boolean ;
558+ autoApproveImported : boolean ;
559+ translateHidden : boolean ;
560+ addToTm : boolean ;
561+ languageIds : string [ ] ;
562+ }
563+
564+ export interface ImportTranslationsStringsStatusAttributes {
565+ storageId : number ;
566+ branchId : number ;
567+ importEqSuggestions : boolean ;
568+ autoApproveImported : boolean ;
569+ translateHidden : boolean ;
570+ addToTm : boolean ;
571+ languageIds : string [ ] ;
572+ }
573+
574+ export interface ImportTranslationsReport {
575+ languages : {
576+ id : string ;
577+ files : {
578+ id : number ;
579+ statistics : {
580+ phrases : number ;
581+ words : number ;
582+ } ;
583+ } [ ] ;
584+ skipped : {
585+ translationEqSource : number ;
586+ hiddenStrings : number ;
587+ qaCheck : number ;
588+ } ;
589+ skippedQaCheckCategories : {
590+ size : number ;
591+ duplicate : number ;
592+ } ;
593+ } [ ] ;
594+ }
595+
596+ export interface ImportTranslationsStringsReport {
597+ languages : {
598+ id : string ;
599+ branches : {
600+ id : number ;
601+ statistics : {
602+ phrases : number ;
603+ words : number ;
604+ } ;
605+ } [ ] ;
606+ skipped : {
607+ translationEqSource : number ;
608+ hiddenStrings : number ;
609+ qaCheck : number ;
610+ } ;
611+ skippedQaCheckCategories : {
612+ size : number ;
613+ duplicate : number ;
614+ } ;
615+ } [ ] ;
616+ }
617+
618+ /* Import Translations END */
462619}
0 commit comments