Checking Translations (was: default text direction; mistranslations)



On Wed, 2006-07-26 at 10:34 -0400, Matthias Clasen wrote:
> gtk20.pot contains this comment, which explains how
> to translate default:LTR.
> 
> #. Translate to default:RTL if you want your widgets
> #. * to be RTL, otherwise translate to default:LTR.
> #. * Do *not* translate it to "predefinito:LTR", if it
> #. * it isn't default:LTR or default:RTL it will not work
> #.
> #: gtk/gtkmain.c:500
> msgid "default:LTR"
> 
> but, running this little command
> 
> grep -A 1 "msgid \"default:LTR\"" *.po | grep msgstr | grep -v
> "default:LTR" | grep -v "default:RTL"
> 
> yields a number of languages which have mistranslated that string:

Something I've been thinking about for a while is a system for
checking translated strings.  Strings often have to conform to
some syntax, whether it's selecting values from an enumeration,
making a format string, writing well-formed XML, or whatever
else.  In many of these cases, having incorrect translations
can cause the program not to function correctly, or can break
the build.

So what if we had a way for developers to write tests for each
string?  We could put those tests in a file in the po directory,
and intltool could have a tool that would run them.  Translators
would then be expected to check their translations before they
commit.  We should also have 'make check' perform the tests on
all languages.

The tests could just be shell scripts, and we could keep them
inside a special po file, like CHECKS.po.  Each string could
be "translated" to a shell script.  That shell script would
be run with the translated string on stdin or in an envar.

One thing that would be useful is a global string that is
always run first for each check.  This could be used to set
some aliases that could be used throughout the checks.  Many
modules will probably do the same check on a lot of strings.

I love test frameworks.  Anybody up for it?

--
Shaun




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