找到你要的答案

Q:Organizing .po localization files for Django

Q:Django宝定位文件组织。

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.

我正在做的这个项目已经相当大了。有它的本地化文件。它已经很难找到你的方式周围的翻译。

你如何在你的Django项目管理大定位文件?我想按上下文分隔文件。(如电子邮件,推送信息,网络浏览等)

那样我就可以将它们添加到不同的翻译项目poeditor或一天等等。

answer1: 回答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.

有趣的问题。目前,Django的硬编码gettext域Django,所以你不能依赖此命名空间的能力。有一个开放和活跃的问题。

你可能想利用交替locale_paths虽然。

answer2: 回答2:

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.

使用上下文标记。

他们将msgctxt PO文件你。你可以很容易地创建一个脚本,只留下msgctxt“电子邮件”中。PO文件,翻译这个子集,然后合并编译结果。

python  django  localization  po  django-multilingual