[MPlayer-dev-eng] Translations again (was: Re: [PATCH] multi language part 2/2)

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Dec 13 23:28:17 CET 2008


On Tue, 2008-12-09 at 15:10 +0100, Ötvös Attila wrote:
> This patch support multi language in 1 binary file.

I thought about language support again and I don't think this is a
viable approach. The system should at be compatible with the gettext
translator tools at least.

Fixing the translation system is a fairly important issue IMO. The
current system doesn't work for Linux distributions whose users are
likely the ones who would need translations the most.

To get something done in practice I think the following would be the
best approach:

1. Implement a simple wrapper that relies on system libintl to provide
the functionality of the gettext API. It is OK even if this is ugly,
hacky and nonportable as long as it works decently on at least recent
Linux distributions and the hacks in MPlayer are limited to one
relatively small wrapper. The main thing is to allow moving quickly to
using the translation system in the rest of the code. Working on even
some Linux distributions is likely to make the translations useful to
more people than the current system, and I think there's pretty good
chance that after all the translations use the system other people will
appear to do any needed porting to their platforms.

2. Decide the basic API used in MPlayer sources. Probably something like
mp_msg_t() which translates its first argument. Some details could be
decided later depending on how often various features are needed and
whether they should have convenience wrappers or use generic gettext API
(features like additional context strings for short messages whose
translation depends on the context or plural handling).

3. Do some coordination with translators about moving to gettext API.

4. Go through the sources to use the new API. Most changes would
probably be straightforward: replace macros with their corresponding
strings, go checking through the changed places and in most cases
replace mp_msg with mp_msg_t.

5. Once some parts of the sources are converted start doing translations
with gettext tools.


I think this doesn't require anything particularly hard. I could
probably set up a git branch with enough functionality to get things
started pretty easily. The main question is coordinating things with
translators.




More information about the MPlayer-dev-eng mailing list