Module crowdin_api.api_resources.glossaries.resource

Classes

class GlossariesResource (requester: APIRequester, project_id: Optional[int] = None, page_size=25)

Resource for Glossaries.

Glossaries help to explain some specific terms or the ones often used in the project so that they can be properly and consistently translated.

Use API to manage glossaries or specific terms. Glossary 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/Glossaries

Ancestors

Methods

def add_glossary(self, name: str, languageId: str, isShared: Optional[bool] = None, groupId: Optional[int] = None)

Add Glossary.

:param isShared: Whether the glossary should be shared to all projects within the account (Crowdin) or within the group (Crowdin Enterprise). :param groupId: Group Identifier. If 0 – the glossary 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.glossaries.post

def add_term(self, glossaryId: int, languageId: str, text: str, description: Optional[str] = None, partOfSpeech: Optional[TermPartOfSpeech] = None, status: Optional[TermStatus] = None, type: Optional[TermType] = None, gender: Optional[TermGender] = None, note: Optional[str] = None, url: Optional[str] = None, conceptId: Optional[int] = None, fields: Optional[Dict[str, Any]] = None)

Add Term.

:param conceptId: Defines whether to add translation to the existing term. If not specified, a new concept will be automatically created for the term. :param fields: Custom fields values. Keys get via List Fields. Crowdin Enterprise only.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.glossaries.terms.post

def check_glossary_export_status(self, glossaryId: int, exportId: str)
def check_glossary_import_status(self, glossaryId: int, importId: str)
def clear_glossary(self, glossaryId: int, languageId: Optional[str] = None, conceptId: Optional[int] = None, translationOfTermId: Optional[int] = None)

Clear Glossary.

Without a filter every term is deleted.

:param translationOfTermId: Defines whether to delete specific term along with its translations.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.glossaries.terms.deleteMany

def concordance_search_in_glossaries(self, sourceLanguageId: str, targetLanguageId: str, expressions: Iterable[str], projectId: Optional[int] = None)
def delete_concept(self, glossaryId: int, conceptId: int)
def delete_glossary(self, glossaryId: int)
def delete_term(self, glossaryId: int, termId: int)
def download_glossary(self, glossaryId: int, exportId: str)
def edit_glossary(self, glossaryId: int, data: Iterable[GlossaryPatchRequest])

Edit Glossary.

GlossaryPatchPath.GROUP_ID (/groupId) is Crowdin Enterprise only.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.glossaries.patch

def edit_term(self, glossaryId: int, termId: int, data: Iterable[TermPatchRequest])

Edit Term.

TermPatchPath.FIELDS (/fields) is Crowdin Enterprise only. A replace on /fields writes the whole set of custom field values.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.glossaries.terms.patch

def export_glossary(self, glossaryId: int, data: Optional[GlossarySchemaRequest] = None)
def get_concept(self, glossaryId: int, conceptId: int)
def get_concepts_path(self, glossaryId: int, conceptId: Optional[int] = None)
def get_glossaries_path(self, glossaryId: Optional[int] = None)
def get_glossary(self, glossaryId: int)
def get_glossary_export_path(self, glossaryId: int, exportId: Optional[str] = None)
def get_term(self, glossaryId: int, termId: int)
def get_terms_path(self, glossaryId: int, termId: Optional[int] = None)
def import_glossary(self, glossaryId: int, storageId: int, scheme: Optional[Dict[~KT, ~VT]] = None, firstLineContainsHeader: Optional[bool] = None)
def list_concepts(self, glossaryId: int, orderBy: Optional[Sorting] = None, offset: Optional[int] = None, limit: Optional[int] = None)
def list_glossaries(self, orderBy: Optional[Sorting] = None, groupId: Optional[int] = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None, userId: Optional[int] = None, filter: Optional[str] = None)

List Glossaries.

:param groupId: Group Identifier. Set 0 to see glossaries of root group. Crowdin Enterprise only. :param userId: List user glossaries. Crowdin only. :param filter: Filter glossaries by name.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.glossaries.getMany

def list_terms(self, glossaryId: int, orderBy: Optional[Sorting] = None, userId: Optional[int] = None, languageId: Optional[str] = None, conceptId: Optional[int] = None, croql: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, translationOfTermId: Optional[int] = None)

List Terms.

:param translationOfTermId: Filter terms by termId. Use for terms that have translations. :param croql: Filter terms by CroQL. Can be used only with orderBy, offset and limit.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.glossaries.terms.getMany

def update_concept(self, glossaryId: int, conceptId: int, languagesDetails: Optional[Iterable[LanguagesDetails]] = None, subject: Optional[str] = None, definition: Optional[str] = None, note: Optional[str] = None, url: Optional[str] = None, figure: Optional[str] = None, translatable: Optional[bool] = None, fields: Optional[Dict[str, Any]] = None)

Update Concept.

:param fields: Custom fields values. Keys get via List Fields. Writes the whole set of custom field values. Crowdin Enterprise only.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.glossaries.concepts.put