diff --git a/crowdin_api/api_resources/string_translations/resource.py b/crowdin_api/api_resources/string_translations/resource.py index 0a31dc5..ffefc97 100644 --- a/crowdin_api/api_resources/string_translations/resource.py +++ b/crowdin_api/api_resources/string_translations/resource.py @@ -249,6 +249,7 @@ def add_translation( text: str, projectId: Optional[int] = None, pluralCategoryName: Optional[PluralCategoryName] = None, + addToTm: Optional[bool] = None, ): """ Add Translation. @@ -256,7 +257,6 @@ def add_translation( Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.translations.post """ - projectId = projectId or self.get_project_id() return self.requester.request( @@ -267,6 +267,7 @@ def add_translation( "languageId": languageId, "text": text, "pluralCategoryName": pluralCategoryName, + "addToTm": addToTm, }, ) diff --git a/crowdin_api/api_resources/string_translations/tests/test_string_translations_resources.py b/crowdin_api/api_resources/string_translations/tests/test_string_translations_resources.py index 35872b2..90cbdec 100644 --- a/crowdin_api/api_resources/string_translations/tests/test_string_translations_resources.py +++ b/crowdin_api/api_resources/string_translations/tests/test_string_translations_resources.py @@ -339,6 +339,7 @@ def test_list_string_translations(self, m_request, in_params, request_params, ba "languageId": "ua", "text": "text", "pluralCategoryName": None, + "addToTm": None, }, ), ( @@ -353,6 +354,7 @@ def test_list_string_translations(self, m_request, in_params, request_params, ba "languageId": "ua", "text": "text", "pluralCategoryName": "some name", + "addToTm": None, }, ), ), @@ -362,7 +364,7 @@ def test_add_translation(self, m_request, in_params, request_data, base_absolut_ m_request.return_value = "response" resource = self.get_resource(base_absolut_url) - assert resource.add_translation(projectId=1, **request_data) == "response" + assert resource.add_translation(projectId=1, **in_params) == "response" m_request.assert_called_once_with( method="post", path=resource.get_translations_path(projectId=1),