3

The project I am working on has gotten pretty big. As have it's localization files. It has gotten hard to find your way around the translations.

How do you manage big localization files in your django projects? I would like to separate the *.po files by context. (e.g. email, push message, web view etc.)

That way I could add them to different translation projects at poeditor or onesky etc.

M.javid
  • 6,387
  • 3
  • 41
  • 56
David Schumann
  • 13,380
  • 9
  • 75
  • 96

2 Answers2

1

Intersting question. At the moment Django hardcodes the gettext domain to django, so you cannot rely on this namespacing capability. There is an open and active issue about this.

You may want to use alternate LOCALE_PATHS though.

zopieux
  • 2,854
  • 2
  • 25
  • 32
  • Would that help though? I would still have to write a script to split and merge the django.po files. – David Schumann Aug 14 '15 at 12:46
  • 1
    Do you mean that `makemessages` would still create a single big file? I guess so. This is not a trivial task. You may use `--ignore` to selectively create the `po` files for each source directory. This is quite hacky though. – zopieux Aug 14 '15 at 16:18
0

Use Contextual Markers.

They will add msgctxt to your .po files. You can then easily create a script which leaves only msgctxt "email" in the .po file, translate this subset and then merge the results for compilation.

Krzysztof Szularz
  • 5,151
  • 24
  • 35