On 03/22/2012 07:02 PM, John Dennis wrote:
[resending because I originally sent this to the wrong list]

This addresses tickets 2044 and 1958. Ticket 2044 was on my short list
but the code had already been written for ticket 1958 (validation of
substitution variables). It had been sitting in my home directory
waiting for integration so since the original 2044 ticket required me to
update test_i18n.py it seemed like a perfect opportunity to get ticket
1958 done as well, it only added 2 hours of additional work.


In the install/po directory you can now do this:

% make test
% make validate

Details (aside from what is in the commit message):

Also attached (to prevent line wrapping) is an example of validating the
Spanish translation. It gives a good example of the type of errors it's
capable of finding. This is not abstract, mistakes like these caused us
to throw errors in different locales and since we normally test only
with English it's important to assure the other languages do not cause
Python errors.

We should consider adding the i18n validation to our top level
validation logic so don't allow problems to creep in (our original
non-translated strings are checked too and are just as capable of having
errors as the translated strings).

When I ran the validation on our complete set of files a lot of errors
were reported for

msgid has whitespace between $ and variable in '$ ipa '

This is due to a doc string with shell command examples, the $
is the shell prompt. The validation code looks for $ followed by a word
token (these are template substitutions). We have a lot of variable and
template substitutions in our strings, any of which could be malformed
and cause serious run-time problems. I don't know of any way to have the
validation logic ignore the use of $ as a shell prompt without adding a
special case exception. Since shell prompts are rarity in strings my
suggestion would be to pick a different shell prompt character,
something other than $ and be done with the issue and not try to
over-engineer the validation logic.

One more nitpick: Please add the generated po file & locale directory to .gitignore


Freeipa-devel mailing list

Reply via email to