Module crowdin_api.api_resources.source_strings.resource

Classes

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

Resource for Source Strings (Crowdin Enterprise).

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#tag/Source-Strings

Ancestors

Methods

def build_reviewed_source_files(self, projectId: Optional[int] = None, branchId: Optional[int] = None)

Build Reviewed Source Files.

File-based projects only.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.post

def check_reviewed_source_files_build_status(self, buildId: int, projectId: Optional[int] = None)

Check Reviewed Source Files Build Status.

File-based projects only.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.get

def download_reviewed_source_files(self, buildId: int, projectId: Optional[int] = None)

Download Reviewed Source Files.

File-based projects only.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.download.download

def get_reviewed_builds_path(self, projectId: int, buildId: Optional[int] = None)
def list_reviewed_source_files_builds(self, projectId: Optional[int] = None, branchId: Optional[int] = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None)

List Reviewed Source Files Builds.

File-based projects only.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.getMany

Inherited members

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

Resource for Source Strings.

Source strings are the text units for translation. Instead of modifying source files, you can manage source strings one by one.

Use API to add, edit, or delete some specific strings in the source-based and files-based projects (available only for the following file formats: CSV, RESX, JSON, Android XML, iOS strings, PROPERTIES, XLIFF).

Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/Source-Strings

Ancestors

Subclasses

Methods

def add_string(self, text: Union[str, Dict[str, str]], projectId: Optional[int] = None, identifier: Optional[str] = None, fileId: Optional[int] = None, context: Optional[str] = None, isHidden: Optional[bool] = None, maxLength: Optional[int] = None, labelIds: Optional[Iterable[int]] = None, branchId: Optional[int] = None, fields: Optional[Dict[str, Any]] = None)

Add String.

:param text: Text for translation. Use a dict (e.g. {"one": "…", "other": "…"}) for plural strings. :param fileId: File Identifier (file-based projects only). :param branchId: Branch Identifier (string-based projects only). :param fields: Fields values, keys get via List Fields (Crowdin Enterprise only).

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

def delete_string(self, stringId: int, projectId: Optional[int] = None)
def edit_string(self, stringId: int, data: Iterable[SourceStringsPatchRequest], projectId: Optional[int] = None, updateOption: Optional[StringUpdateOption] = None)

Edit String.

:param updateOption: Defines whether to keep existing translations and approvals for the updated string. Applied only when text or identifier is changed.

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

def get_source_strings_path(self, projectId: int, stringId: Optional[int] = None)
def get_string(self, stringId: int, projectId: Optional[int] = None, denormalizePlaceholders: Optional[DenormalizePlaceholders] = None)
def get_strings_uploads_path(self, projectId: int, uploadId: Optional[str] = None)
def list_strings(self, projectId: Optional[int] = None, orderBy: Optional[Sorting] = None, fileId: Optional[int] = None, branchId: Optional[int] = None, denormalizePlaceholders: Optional[DenormalizePlaceholders] = None, labelIds: Optional[Iterable[int]] = None, taskId: Optional[int] = None, croql: Optional[str] = None, filter: Optional[str] = None, scope: Optional[ScopeFilter] = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None, directoryId: Optional[int] = None)

List Strings.

:param directoryId: Directory Identifier (file-based projects only). Can't be used with taskId, fileId or branchId in the same request.

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

def search_strings(self, filter: str, projectIds: Optional[Iterable[int]] = None, userId: Optional[int] = None, scope: Optional[ScopeFilter] = None, denormalizePlaceholders: Optional[DenormalizePlaceholders] = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None)
def string_batch_operation(self, data: Iterable[StringBatchOperationPatchRequest], projectId: Optional[int] = None, updateOption: Optional[StringUpdateOption] = None)

String Batch Operations.

:param updateOption: Defines whether to keep existing translations and approvals for updated strings. Applied only when text or identifier is changed.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.projects.strings.batchPatch

def upload_strings(self, storageId: int, branchId: int, projectId: Optional[int] = None, type: Optional[UploadStringsType] = None, parserVersion: Optional[int] = None, labelIds: Optional[Iterable[int]] = None, updateStrings: Optional[bool] = None, cleanupMode: Optional[bool] = None, importOptions: Union[UploadStringsSpreadsheetImportOptions, UploadStringsStringCatalogImportOptions, UploadStringsOtherImportOptions, None] = None, updateOption: Optional[StringUpdateOption] = None)
def upload_strings_status(self, uploadId: str, projectId: Optional[int] = None)