J'utilise les blocktrans suivants:Utilisation blocktrans pour la traduction
{% blocktrans with item|gender_text as gendertext %}
This is {{gendertext}} item
{% endblocktrans %}
Dans mon fichier .po j'ai
msgid "This is %(gendertext)s item"
msgstr "Some translation ... %(gendertext)s"
Pour toute autre langue que l'anglais, je ne voudrais pas utiliser le gendertext
variable. Je ne voudrais donc avoir
msgstr "Some translation ..."
Cependant, quand j'enlève le %(gendertext)s
de de msgstr
, django_admin cris (lors de la compilation des messages):
'msgstr' is not a valid Python format string, unlike 'msgid'. Reason: The string ends in the middle of a directive.
msgfmt: found 1 fatal error
solutions de contournement pour ce cas?
Meir
Mettre une condition dans votre modèle n'est pas bon pour vous? – sahid