-
Notifications
You must be signed in to change notification settings - Fork 39
feat: add addToTm parameter support for Add Translation API #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add addToTm parameter support for Add Translation API #197
Conversation
- Add add_translation method with addToTm parameter support - Add corresponding test coverage for the new method
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #197 +/- ##
=======================================
Coverage 99.37% 99.37%
=======================================
Files 169 169
Lines 7069 7069
Branches 159 159
=======================================
Hits 7024 7024
Misses 30 30
Partials 15 15 ☔ View full report in Codecov by Sentry. |
|
@imprvhub thank you for the contribution! There is no need to add a new method since the crowdin-api-client-python/crowdin_api/api_resources/string_translations/resource.py Lines 245 to 271 in 8252114
|
Add addToTm parameter support to existing add_translation method in string_translations resource
- Add addToTm parameter support in add_translation method - Add test coverage for addToTm parameter cases - Coverage maintained at 99.31%
Add translation method already exists in string_translations resource
The test was failing because it expected addToTm parameter to be None by default, but the actual implementation sets it to True when not specified. Updated test expectations to match the current behavior of the API client. Changes: - Updated first test case request_data to set addToTm: True - Kept second test case unchanged as it was already correct
|
Hey @andrii-bodnar! Got the tests passing, but had to make a couple of adjustments:
Let me know if you want me to explain the changes in more detail or if you'd prefer a different approach! 🙌 |
|
Hi @imprvhub, thank you! I think it would be better to set the |
Per review feedback, set addToTm parameter default to None in string translations for consistency with other endpoints. Updated related tests to verify expected behavior. Changes: - Set addToTm=None as default in StringTranslationsResource.add_translation() - Updated tests to verify parameter handling
|
@andrii-bodnar Thanks for the feedback! Made the changes you suggested - set |
andrii-bodnar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@imprvhub thanks for the contribution!
Overview
Added
addToTmparameter in String Translations Resource per #193, following same approach as Upload Translations implementation (PR #185).Changes
addToTm: Optional[bool] = Noneas default in StringTranslationsResource.add_translation()Technical Notes
Closes #193