[MPlayer-dev-eng] New translation system
uoti.urpala at pp1.inet.fi
Thu Nov 30 02:05:47 CET 2006
The most important reason to replace the current translation system is
that the language must be chosen at compile time. This makes the
translations very impractical for binary distributions, eliminating much
of the potential audience for translated versions.
Some features I consider important:
1 Must allow selecting language at runtime (as above).
2 Should leave the English versions visible in the source and find the
translation based on those (plus optional context argument for non-unique
strings that might need to be translated differently in different places).
3 Should allow loading translations from separate files and replacing them
without recompiling, both to make updating them easier and because including
all possible languages in the main binary would make it noticeably bigger.
4 Should work without extra work with formats that might differ between
machines such as PRId64.
5 Outdated, broken or intentionally harmful translation files should not
cause crashes or security holes.
It might be possible to wrap gettext in a way that achieves these (at
least it seems setting the locale should be avoidable by using
bind_textdomain_codeset() and dcgettext() instead of plain gettext()).
Writing basic text lookup functions fulfilling the above conditions from
scratch would be relatively easy too, and would avoid a dependency on
gettext and any problems with its API. OTOH if a similar code-side
interface can be implemented by wrapping gettext then all the details
and tools it implements would probably make life easier for translators.
More information about the MPlayer-dev-eng