Prepare OpenREM for multilingual interface

Issue #512 resolved
Ed McDonagh created an issue

See the Django docs on internationalization and translation.

In summary, I think the task is to

  • go through the code, importing ugettext or ugettext_lazy as _,
  • then wrapping all the strings that might be translated with _("text") for python, and
  • <title>{% trans "This is the title." %}</title> or <title>{% trans myvar %}</title> in templates
  • then running a utility that scoops up all these strings into a .po message file
  • then passing this to translators to populate with different language versions.

Django will then magically display the web interface in the right language on the fly.

Relates to issue #513

Comments (21)

  1. Ed McDonagh reporter

    Disappointed to find that you can’t use f-strings where translations are required! Will have to use the format() approach instead.

  2. Ed McDonagh reporter

    Added locale folder and defined it. Added translatable string to home page template and export status (Python). Created .po file for German. Refs #512

    → <<cset e1ad6f15c60a>>

  3. Ed McDonagh reporter

    Set both rtd yml file and config on the site to use the rtdrequirements.txt file, now can remove docs/requirements.txt. Refs #512 [skip ci] docs only

    → <<cset 05cb58e8c254>>

  4. Ed McDonagh reporter

    Missed code-block. Also not respecting new regex for PS in German version - wiped to see if it starts working. Refs #512 [skip ci] docs only

    → <<cset 93d288a8179d>>

  5. Log in to comment