简体   繁体   English

Django翻译-Makemessages注释条目

[英]Django translation - makemessages commenting out entries

I am adding entries from .jinja templates to the django.po file for translation, and when I add the entries and reload the page the translations run fine. 我正在将.jinja模板中的条目添加到django.po文件中进行翻译,当我添加条目并重新加载页面时,翻译运行正常。

However, when I run makemessages my new entries get commented out. 但是,当我运行makemessages时,我的新条目将被注释掉。 Any ideas? 有任何想法吗?

This is similar to the following, but since that hasn't been active in a year I was wondering if anyone has had any progress/new ideas: 这类似于以下内容,但是由于那一年没有活跃,所以我想知道是否有人有任何进步/新想法:

How to properly add entries for computed values to the django internationalization messages file? 如何正确地将计算值的条目添加到django国际化消息文件中?

I found the answer, my .jinja templates weren't being included in the makemessages script. 我找到了答案,我的.jinja模板未包含在makemessages脚本中。 To enable them, you have to add --extension=jinja to the script. 要启用它们,您必须在脚本中添加--extension=jinja

I found answers telling me to run python manage.py makemessages -e jinja , but this did not work. 我找到了告诉我运行python manage.py makemessages -e jinja答案,但这没有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM