mozilla / wagtail-localize-smartling

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

Duplicate jobs when converting to alias and back #22

Open zerolab opened 3 months ago

zerolab commented 3 months ago

Working down the TODO list

  1. start off with a translation (with mark for Smartling). We have a Job object
  2. convert the translation to alias. This removes the translation object, leaving the Job object without a reference to translations
  3. translate (with mark for Smartling). This creates a new translation object, as well as a new Job object

When we translate and mark for Smartling we could check existing jobs for the matching translation source that don't have any translations

This works best for a Job with one target locale. If there are multiple this gets more complicated in that we need to check how many have recreated etc

--

The alternative - look at disabling "convert to alias" if the translation has a Job that is either unsynced or in progress in Smartling. And I leaning towards this

stevejalim commented 3 months ago

I think it's more likely that pages will have more than one target locale (typically ~8 at a guess), so we'd certainly be in the "more complicated" zone here.

FWIW with mozilla/bedrock, one thing we've got built in is middleware that falls back to the next-best-fit locale if any page (from Wagtail or just Django) isn't available in the requested locale -- this behaviour should mean that we won't need to use alias pages in reality.

As such, I think the alternative approach - simply don't allow this situation to come to pass - is probably the wise one right now.

(We could keep this ticket around as a closed Issue as a reminder of an approach to cope with things if we did need to allow aliases to exist.)