0
votes

I have used the following .po file in Poedit to use it in a django app (locale\el\LC_MESSAGES\django.po) for greek characters in templates.

SOME DESCRIPTIVE TITLE.

Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER

This file is distributed under the same license as the PACKAGE package.

FIRST AUTHOR , YEAR.

msgid "" msgstr "" "Project-Id-Version: Apografi\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-04

11:27+0300\n" "PO-Revision-Date: 2016-05-09 09:51+0200\n" "Last-Translator: Kostas \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.6.4\n" "X-Poedit-SourceCharset: UTF-8\n" "Language: el_GR\n"

: .\templates\widgets\tables\tables.html:69 msgid "%(count)s of %(total)s" msgstr "%(count)s από %(total)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 "Delete" msgstr "Διαγραφή"

: .\templates\category\delete.html:18 .\templates\authority\delete.html:18

: .\templates\division\delete.html:18 msgid "Are you sure you want to delete the selected" 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 "Add" msgstr "Προσθήκη"

: .\templates\division\list.html:25 .\templates\authority\list.html:25

: .\templates\category\list.html:25 msgid "Search" msgstr "Αναζήτηση"

msgid "apografi" msgstr "Απογραφή"

msgid "category" msgstr "Κατηγορία"

msgid "authority" msgstr "Διεύθυνση"

msgid "division" msgstr "Τμήμα"

Using the validation of Poedit showed me No erros that validation is OK and translation file should be used. Poedit validation result This .po file works for 90% OK for me but when i try to use trans inside these bootstrap tags i do not get translated result but the source:

1.

table class="table table-bordered"> thead tr th{% trans "pedio" %}/th th{{ _("timh") }}/th /tr /thead

2.

a class="btn btn-primary pull-right"> {{ _("Update") }} /a a class="btn btn-primary pull-right"> {{ _("Delete") }} /a

1

1 Answers

0
votes

Where are these bootstrap tags ? You shouldn't mix template tags (ie {% trans "text" %}) with functions (ie _("text")). The trans and blocktrans template tags should be used in your templates, the ugettext (aliased as _) to your python code.

So, for example instead of {{ _("Update") }} you should use {% trans "Update" %}.