首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Django .po翻译

Django .po翻译
EN

Stack Overflow用户
提问于 2016-05-09 11:23:44
回答 1查看 490关注 0票数 0

我在Poedit中使用了下面的.po文件在django应用程序(locale\el\LC_MESSAGES\django.po)中使用模板中的希腊语字符。

一些描述性的标题。 版权(C)年 此文件在与包相同的许可证下分发。 第一作者,年份。 msgid“msgstr "”Project-Id-Version: Apografi\n“报告-Msgid-Bugs-To:\n”创建锅-日期: 2016-05-04 11:27+0300\n“PO-修订日期: 2016-05-09 09:51+0200\n”“Last: Kostas \n”" LANGUAGE -Team: LANGUAGE \n“"MIME-Version: 1.0\n”内容-类型:文本/普通;charset=UTF-8\n“内容-传输-编码:8位\n”“复数形式: nplurals=2;plural=(n != 1);\n“X-生成器:PoEd1.6.4\n”“:UTF-8\n”“语言: el_GR\n” :.\templates\widgets\tables\tables.html:69 msgid“%(计数)s%(总计)s”msgstr %(计数)sαπό%(总计)s“ :.\templates\category\create.html:16 .\templates\authority\create.html:16 :.\templates\division\create.html:16 msgid "Create“msgstr "Δημιουργία” :.\templates\category\update.html:17 .\templates\authority\update.html:17 ::.\templates\division\update.html:16 msgid "Update“msgstr "Ενημέρωση” :.\templates\category\delete.html:15 .\templates\authority\delete.html:15 ::.\templates\division\delete.html:15 msgid“删除”msgstr "Διαγραφή“ :.\templates\category\delete.html:18 .\templates\authority\delete.html:18 :.\templates\division\delete.html:18 msgid“您确定要删除选定的”msgstr“Θέλετεναδιαγράψετετηνεπιλεγνένη吗? εγγραφή“ ::.\templates\widgets\form.html:18 msgid "Save“msgstr "Αποθήκευση” :.\templates\authority\detail.html:34 .\templates\division\detail.html:34 :.\templates\category\detail.html:34 msgid "pedio“msgstr”ΌνομαΠεδίου“ :.\templates\authority\detail.html:35 .\templates\division\detail.html:35 :.\templates\category\detail.html:35 msgid "timh“msgstr”ΤιμήΠεδίου“ :.\templates\division\list.html:15 .\templates\authority\list.html:15 :.\templates\category\list.html:15 msgid添加msgstr "Προσθήκη“ :.\templates\division\list.html:25 .\templates\authority\list.html:25 :.\templates\category\list.html:25 msgid "Search“msgstr "Αναζήτηση” msgid "apografi“msgstr "Απογραφή” msgid“类别”msgstr "Κατηγορία“ msgid“权威”msgstr "Διεύθυνση“ msgid“除法”msgstr "Τμήμα“

使用Poedit的验证告诉我没有错误,验证是可以的,应该使用翻译文件。

这个.po文件对我来说可以工作90%,但是当我试图在这些引导标记中使用trans时,我不会得到翻译结果,而是源代码:

1.

表class=“表边框”>头tr _t{% trans "pedio“%}/th th{{ _("timh") }/th /tr /thead

2.

class="btn -主拉-右“> {{ _(”更新“) }} /a class="btn -主拉-右”> {{ _(“删除”) }} /a

EN

回答 1

Stack Overflow用户

发布于 2016-05-09 12:00:24

这些引导标签在哪里?不应将模板标记(ie {% trans "text" %})与函数(即_("text"))混合使用。反式和块反式模板标记应该在模板中使用,ugettext (别名为_)用于您的python代码。

因此,例如,您应该使用{{ _("Update") }}而不是{% trans "Update" %}

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37114544

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档