Add Copy from a Similar Locale batch action#4152
Conversation
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
Enables translators working on closely related locales (eg en-GB and en-ZA) to reuse approved translations from one locale as a starting point in another as suggestions. Fixes mozilla#2255
72105c7 to
a2ed203
Compare
mathjazz
left a comment
There was a problem hiding this comment.
Thanks for the patch!
I haven't closely looked at the code yet. I'd suggest we make some changes to the UI:
Please change the section title and use the locale selector instead of the input box:

Please note that Source locale should be the default option.
Please also update the docs:
https://pontoon.mozilla.org/docs/localizer/translate/?h=batch#performing-batch-actions-on-strings
Question: is it only possible to add suggestions to strings that don't have any existing translations? If yes, why?
Yes, it's only possible to copy to strings that don't already have an active translation, because of the unique constraint on (entity_id, locale_id, active). |
The warning on top of the Batch actions editor panel says changes will be applied to all strings, which is what other actions do, too. So I'd keep that behaviour, and adapt active translations as needed. |
|
Thanks for the udpate! Could you please make the locale selector and dropdown look & feel aligned with the locale selector used elsewhere, e.g. in the Setttings and Search pages? |

Fixes #2255
Enables translators working on closely related locales (eg en-GB and en-ZA) to reuse approved translations from one locale as a starting point in another as suggestions.
How to test / how I tested:
test_copy_from_similar_localeinpontoon/batch/tests/test_utils.pySteps to reproduce