Skip to content

Commit

Permalink
feat: Add Strings Exporter Settings Implemented
Browse files Browse the repository at this point in the history
Signed-off-by: OmAxiani0 <[email protected]>
  • Loading branch information
OmAximani0 committed Sep 14, 2023
1 parent f0704f2 commit 22787cc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
25 changes: 25 additions & 0 deletions crowdin_api/api_resources/projects/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
OtherFileFormatSettings,
SpecificFileFormatSettings,
ProjectFilePatchRequest,
AndroidStringsExporterSettings,
MacOSXStringsExporterSettings,
XliffStringsExporterSettings,
)


Expand Down Expand Up @@ -401,3 +404,25 @@ def list_project_strings_exporter(
path=self.get_strings_exporter_path(projectId=projectId),
params=params,
)

def add_project_strings_exporter(
self,
projectId: int,
format: str,
settings: Union[
AndroidStringsExporterSettings,
MacOSXStringsExporterSettings,
XliffStringsExporterSettings,
],
):
"""
Add Project Strings Exporter Settings.
Link to documetation:
https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.post
"""
return self.requester.request(
method="post",
path=self.get_strings_exporter_path(projectId=projectId),
request_data={"format": format, "settings": settings},
)
14 changes: 13 additions & 1 deletion crowdin_api/api_resources/projects/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Iterable, List, Union
from typing import Any, Iterable, List, Union, Dict

from crowdin_api.api_resources.enums import PatchOperation
from crowdin_api.api_resources.projects.enums import (
Expand Down Expand Up @@ -98,6 +98,18 @@ class OtherFileFormatSettings(TypedDict):
exportPattern: str


class AndroidStringsExporterSettings(TypedDict):
convertPlaceholders: bool


class MacOSXStringsExporterSettings(TypedDict):
convertPlaceholders: bool


class XliffStringsExporterSettings(TypedDict):
languagePairMapping: Dict[str, str]


class ProjectFilePatchRequest(TypedDict):
value: Union[str, List[str]]
op: PatchOperation
Expand Down

0 comments on commit 22787cc

Please sign in to comment.