[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[D-I] Checking variables substitutions

After a short discussion in -i18n and -boot, Denis Barbier wrote a
script named check_vars.pl which can check PO files for correct
variable substitution.

Most of you know that the correct translation of this:

msgid "This is an example of a ${VARIABLE} substitution."

Should be translated to that:

msgstr "Ceci est un exemple de substitution de ${VARIABLE}."

However, any error in the variable syntax or name may lead to horrible
messages presented to users.

Denis scripts checks this and report any inconsistencies. It is very
useful and I commited it in the D-I repository, under scripts/l10n

Then, I ran it over ALL D-I translations....and, as Denis said, I
found lots of errors. I made my best for correcting all these today.

Denis, you could enhance the script by not checking the variable order
of appearance. So, having:

msgid "blah blah ${VAR1} blah blah ${VAR2}"


msgstr "blah blah ${VAR2} blah blah ${VAR1}"

would not be reported. Such inversion often happens because of
differences in languages syntax and this gives a lot of false
positives in some languages.

Reply to: