simple_translation.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. .. _simple_translation:
  2. Simple translation
  3. ==================
  4. The simple_translation module provides a user interface that allows users to copy pages and translatable snippets into another language.
  5. - Copies are created in the source language (not translated)
  6. - Copies of pages are in draft status
  7. Content editors need to translate the content and publish the pages.
  8. .. note::
  9. Simple Translation is optional. It can be switched out by third-party packages. Like the more advanced `wagtail-localize <https://github.com/wagtail/wagtail-localize>`_.
  10. Basic configuration
  11. ~~~~~~~~~~~~~~~~~~~
  12. Add ``"wagtail.contrib.simple_translation"`` to INSTALLED_APPS in your settings file:
  13. .. code-block:: python
  14. INSTALLED_APPS = [
  15. ...
  16. "wagtail.contrib.simple_translation",
  17. ]
  18. Run ``python manage.py migrate`` to create the necessary permissions.
  19. In the Wagtail admin, go to settings and give some users or groups the "Can submit translations" permission.
  20. Page tree synchronisation
  21. ~~~~~~~~~~~~~~~~~~~~~~~~~
  22. Depending on your use case, it may be useful to keep the page trees in sync between different locales.
  23. You can enable this feature by setting `WAGTAILSIMPLETRANSLATION_SYNC_PAGE_TREE` to `True`.
  24. .. code-block:: python
  25. WAGTAILSIMPLETRANSLATION_SYNC_PAGE_TREE = True
  26. When this feature is turned on, every time an editor creates a page, Wagtail creates an alias for that page under the page trees of all the other locales.
  27. For example, when an editor creates the page "/en/blog/my-blog-post/", Wagtail creates an alias of that page at "/fr/blog/my-blog-post/" and "/de/blog/my-blog-post/".