@crowdin/app-project-module 0.28.3 → 0.28.4

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.
@@ -75,6 +75,7 @@ function handle(config) {
75
75
  logo: '/logo/mt/logo.png',
76
76
  url: '/translate',
77
77
  environments: config.customMT.environments,
78
+ withContext: !!config.customMT.withContext,
78
79
  },
79
80
  ];
80
81
  }
@@ -632,12 +632,25 @@ export interface StringTranslations {
632
632
  };
633
633
  }
634
634
  export interface CustomMTLogic {
635
- translate: (client: Crowdin, context: CrowdinContextInfo, projectId: number, source: string, target: string, strings: string[]) => Promise<string[]>;
635
+ withContext?: boolean;
636
+ translate: (client: Crowdin, context: CrowdinContextInfo, projectId: number, source: string, target: string, strings: CustomMtString[]) => Promise<string[]>;
636
637
  validate?: (client: Crowdin) => Promise<void>;
637
638
  }
638
639
  export interface CustomMTRequest {
639
- strings: string[];
640
+ strings: CustomMtString[];
640
641
  }
642
+ export type CustomMtString = string | {
643
+ id: number;
644
+ projectId: number;
645
+ fileId: number;
646
+ identifier: string;
647
+ context: string;
648
+ maxLength: number;
649
+ isHidden: boolean;
650
+ text: string | SourceStringsModel.PluralText;
651
+ isPlural: boolean;
652
+ pluralForm: any;
653
+ };
641
654
  export interface UiModule {
642
655
  /**
643
656
  * Form schema for react-jsonschema-doc to be used as front-end