mozilla / wagtail-localize-smartling

Integration between wagtail-localize and Smartling's API
Mozilla Public License 2.0
1 stars 1 forks source link

Add a callback setting for locale mapping #6

Closed zerolab closed 2 months ago

zerolab commented 2 months ago

Fixes #5.

Allows providing a callback, or a settings dict. Under the hood, it will use the defined WAGTAIL_CONTENT_LANGUAGES to either run them through the callback, or fill up the provided mapping

To-Do:

zerolab commented 2 months ago

Related question: up until the point that callback's transformation is triggered, I'm assuming all lang codes used are those defined in settings.WAGTAIL_CONTENT_LANGUAGES and that the transformation happens basically at the point data goes to / returns from Smartling. Is that right?

The mapping happens when creating the job initially at the moment. But that doesn't account for the return (i.e. in _download_and_apply_translations() which receives the translated POs as "{localeId}/{fileUri}".po. Will look at addressing a bit later today.

zerolab commented 2 months ago

Will merge and make a new release for ease of use. And will follow up with a few more tests