wagtail / wagtail-localize

Translation plugin for Wagtail CMS
https://wagtail-localize.org/
Other
222 stars 84 forks source link

ParentalManyToManyFields do not sync #820

Open zemogle opened 2 weeks ago

zemogle commented 2 weeks ago

I have a model which includes references to several snippets. All of the snippets which is referenced by ForeignKey sync when translating the page. Any which are referenced by ParentalManyToManyField do not sync. e.g.

@register_snippet
class Age(TranslatableMixin):
    name = models.CharField(max_length=255)
    order = models.PositiveSmallIntegerField()
    def __str__(self):
        return self.name

    class Meta:
        unique_together = ('translation_key', 'locale')

@register_snippet
class Time(TranslatableMixin):
    name = models.CharField(max_length=255)
    order = models.PositiveSmallIntegerField()
    def __str__(self):
        return self.name

    class Meta:
        unique_together = ('translation_key', 'locale')

class Activity(Page):
    age = ParentalManyToManyField('activities.Age')
    time = models.ForeignKey(Time, on_delete=models.SET_NULL, blank=True, null=True)

The age values will appear as the English language version (i.e. the primary language) when the page has been translated.

The only way I can set the translations is to "stop synced translation", edit the affected fields, publish, then switch translation sync back on.

Wagtail = 5.2 Django = 4.1 Wagtail-localize = 1.9.2 Python = 3.8