I have checked in (in revision [4934]) a change to compile-messages.py
so that it now checks to make sure the format specifiers in Python
strings are correct in the translated strings. We should have been doing
this all along.
Can everybody please run
bin/compile-messages.py -l XX
(where XX is your locale) and then fix any errors.
It is very easy to mess up the format strings. For example, in es_AR
(which is the case that prompted this change), one example is
msgid "Change password: %s"
msgstr "Cambiar contraseña: %S"
We can see here that a capital 'S' is used in the msgstr. Sadly, %S is
not a Python format string. Only %s is. So this would lead to a crash in
Django. Similarly, in the same file:
msgid "The %(verbose_name)s was created successfully."
msgstr "Se creó con éxito %(verbose_name)."
Here, the 's' at the end of "%(verbose_name)s" has been accidentally
left off. This, again, causes a crash because it generates a syntax
error when this string is used in the code.
I'm not picking on es_AR here. It's by no means the worst offender. It
was just the example we noticed. These errors are not trivial problems.
They will actually cause Django to stop working, much to the
disappointment of the users you are trying to help.
So can everybody please check your files and upload patches to Trac to
fix the problems.
Thanks,
Malcolm
bin/compile-messages.py -l es
works for me.
>
To be a bit more specific, the following locales have errors right now:
1 ca
1 cy
1 el
2 es_AR
1 fr
3 kn
3 no
1 pl
4 pt
18 te
1 zh_TW
where the first number is the number of errors related to format
string.
Regards,
Malcolm
On Apr 5, 6:00 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
>
> I am unable to correct the warnings ...I hope someone would help me
> with correction of the warnings ..
It looks like you are not using an up-to-date checkout of the code.
Those warnings were all fixed a while ago (and they're just warnings,
not errors).
However, the problem I was pointing to in my original post is shown when
you run compile-messages.py (not make-messages.py).
So, please ensure that
(a) you are running the latest subversion checkout of the code. When you
run "svn update" it should report that you are at something like
revision 4970, which is the latest as I type this sentence.
(b) That you also look at the error messages returned by running
bin/compile-messages.py -l te, which shows a *lot* of errors where you
have not copied the format strings correct (anything that looks like "%
s" or "%(something)s" has to be copied precisely and the 's' may be a
'd' or 'x' or 'i', possibly).
Regards,
Malcolm