2

So I have a website which is using the Wagtailtrans extension for Wagtail. I basically enables multi language by duplicating the page tree. So the url gets fixed with the language-code at the start.

I can translate all my content which I define through my models perfectly fine. Here's an example of how that works:

class ServicesPage(MetadataPageMixin, TranslatablePage):
    description              = models.CharField(max_length=255, blank=True,)

    content_panels           = Page.content_panels + [
                            FieldPanel('description', classname="full")
                            ]

Instead of Page you define it as TranslatablePage in your model. All is working fine, however I still need some additional strings which I don't define in my models to be translated. I just use Django's translation feature with {% load i18n %} and then the strings wrapped inside {% trans "String" %}.

So far so good, I defined my two languages in Wagtail admin (Wagtail trans creates an option for that) which in this case is English and Dutch. I set English as the main language so the strings are in english.

I use ./manage.py makemessages and it creates a .po file for me, with all the tagged strings in there. At last I use ./manage.py compilemessages.

But translated strings are not showing up when I switch to Dutch language, it still displays the english strings. So I suspect it needs some additional tweaking to work with Wagtailtrans, but I can't seem to figure out how this set-up should be. Can anyone help me out?

Raf Rasenberg
  • 534
  • 2
  • 14
  • 27

0 Answers0