Problem with placeholder

500 views
Skip to first unread message

sve...@gmail.com

unread,
Mar 15, 2013, 9:03:52 AM3/15/13
to python...@googlegroups.com
Hi,

I'm not sure this has to be here, but i'm getting troubles with placeholder on extracted messages.

In the extracted POT file i have :

#: sources/templates/index.html:267
#, python-format
msgid "High grade 30% fiber charged nylon plastic parts"
msgstr ""

This is the only one that have been detected has "python-format", but i have many other message that contains "%" in the same way like :

#: sources/templates/index.html:99
msgid ""
"Fly more with the high density battery with 50% additional power this "
"long lasting battery will never let you down when going out for a flight "
"session."
msgstr ""

I made translations but when i compile it, it return warnings for some lang :

$ pybabel compile -f -d locale
error: locale/es_ES/LC_MESSAGES/messages.po:620: incompatible format for placeholder 1: 'f' and 'd' are not compatible
compiling catalog 'locale/es_ES/LC_MESSAGES/messages.po' to 'locale/es_ES/LC_MESSAGES/messages.mo'
compiling catalog 'locale/en_US/LC_MESSAGES/messages.po' to 'locale/en_US/LC_MESSAGES/messages.mo'
error: locale/it_IT/LC_MESSAGES/messages.po:618: incompatible format for placeholder 1: 'f' and 'd' are not compatible                                                                                                                      
compiling catalog 'locale/it_IT/LC_MESSAGES/messages.po' to 'locale/it_IT/LC_MESSAGES/messages.mo'                                                                                                                                          
compiling catalog 'locale/de_DE/LC_MESSAGES/messages.po' to 'locale/de_DE/LC_MESSAGES/messages.mo'                                                                                                                                          
error: locale/zh_CN/LC_MESSAGES/messages.po:592: placeholders are incompatible                                                                                                                                                              
compiling catalog 'locale/zh_CN/LC_MESSAGES/messages.po' to 'locale/zh_CN/LC_MESSAGES/messages.mo'                                                                                                                                          
compiling catalog 'locale/fr_FR/LC_MESSAGES/messages.po' to 'locale/fr_FR/LC_MESSAGES/messages.mo'                                                                                                                                          
error: locale/ja_JP/LC_MESSAGES/messages.po:592: placeholders are incompatible                                                                                                                                                              
compiling catalog 'locale/ja_JP/LC_MESSAGES/messages.po' to 'locale/ja_JP/LC_MESSAGES/messages.mo'

All my message catalogs are well compiled and it doesn't make problem with my app to use them to translate my page. But these warnings are annoying me, it seems to cause trouble with some other tools like "transifex".

I didn't find any clear explanation and no solution to correct this. I'm using the last stable Babel version from PyPi with Jinja2 here is my mapping file :

[jinja2: sources/templates/**.html]
encoding = utf-8
extensions = webassets.ext.jinja2.AssetsExtension

In my templates, all my strings to translation are specified with the "{% trans %}...{% endtrans %}", and i never use placeholder or variables.

Any ideas ?

Reply all
Reply to author
Forward
0 new messages