Module crowdin_api.api_resources.translation_memory.resource
Classes
class TranslationMemoryResource (requester: APIRequester, project_id: Optional[int] = None, page_size=25)-
Resource for Translation Memory.
Translation Memory (TM) is a vault of translations that were previously made in other projects. Those translations can be reused to speed up the translation process. Every translation made in the project is automatically added to the project Translation Memory.
Use API to create, upload, download, or remove specific TM. Translation Memory export and import are asynchronous operations and shall be completed with sequence of API methods.
Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/Translation-Memory
Ancestors
Methods
def add_tm(self, name: str, languageId: str, isShared: Optional[bool] = None, groupId: Optional[int] = None)-
Add TM.
:param isShared: Whether the TM should be shared to all projects within the account (Crowdin) or within the group (Crowdin Enterprise). :param groupId: Group Identifier. If 0 – the TM will be available for all projects and groups in the workspace. Crowdin Enterprise only.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.post
def check_tm_export_status(self, tmId: int, exportId: str)-
Check TM Export Status.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.exports.get
def check_tm_import_status(self, tmId: int, importId: str)-
Check TM Import Status.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.imports.get
def clear_tm(self, tmId: int)-
Clear TM.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.clear
def concordance_search_in_tms(self, sourceLanguageId: str, targetLanguageId: str, autoSubstitution: bool, minRelevant: int, expressions: Iterable[str], projectId: Optional[int] = None)-
Concordance search in TMs
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.projects.tms.concordance.post
def create_tm_segment(self, tmId: int, records: Iterable[TranslationMemorySegmentRecord])-
Create TM Segment.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.post
def delete_tm(self, tmId: int)-
Delete TM.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.delete
def delete_tm_segment(self, tmId: int, segmentId: int)-
Delete TM Segment.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.delete
def download_tm(self, tmId: int, exportId: str)-
Download TM.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.exports.download.download
def edit_tm(self, tmId: int, data: Iterable[TranslationMemoryPatchRequest])-
Edit TM.
TranslationMemoryPatchPath.GROUP_ID(/groupId) is Crowdin Enterprise only.Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.patch
def edit_tm_segment(self, tmId: int, segmentId: int, data: Iterable[Union[TranslationMemorySegmentRecordOperationAdd, TranslationMemorySegmentRecordOperationReplace, TranslationMemorySegmentRecordOperationRemove]])-
Edit TM Segment.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.patch
def export_tm(self, tmId: int, sourceLanguageId: Optional[str] = None, targetLanguageId: Optional[str] = None, format: Union[TranslationMemoryExportFormat, ExportFormat, None] = None)-
Export TM.
:param format: TM file format:
tmx(default),csvorxlsx. UseTranslationMemoryExportFormat.Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.exports.post
def get_tm(self, tmId: int)-
Get TM.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.get
def get_tm_export_path(self, tmId: int, exportId: Optional[str] = None)def get_tm_segment(self, tmId: int, segmentId: int)-
Get TM Segment.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.get
def get_tm_segments_path(self, tmId: int, segmentId: Optional[int] = None)def get_tms_path(self, tmId: Optional[int] = None)def import_tm(self, tmId: int, storageId: int, scheme: Optional[Dict[~KT, ~VT]] = None, firstLineContainsHeader: Optional[bool] = None)-
Import TM.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.imports.post
def list_tm_segments(self, tmId: int, orderBy: Optional[Sorting] = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None, croql: Optional[str] = None)-
List TM Segments.
:param croql: Filter segments by CroQL.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.getMany
def list_tms(self, orderBy: Optional[Sorting] = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None, filter: Optional[str] = None, userId: Optional[int] = None, groupId: Optional[int] = None)-
List TMs.
:param filter: Filter TMs by
name. :param userId: Project Member Identifier. Crowdin only. :param groupId: Group Identifier. Set 0 to see TMs of root group. Crowdin Enterprise only.Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.getMany
def organization_concordance_search(self, request_data: OrganizationConcordanceSearchRequest)-
Concordance search in organization TMs.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.concordance.post
Link to documentation for enterprise: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.concordance.post
def tm_segment_batch_operations(self, tmId: int, data: Iterable[Union[TranslationMemorySegmentBatchOperationAdd, TranslationMemorySegmentBatchOperationReplace, TranslationMemorySegmentBatchOperationRemove]])-
TM Segment Batch Operations.
Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.patchBatch