Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: multi-language rockbox version
From: Daniel Stenberg (daniel_at_haxx.se)
Date: 2002-09-03


On Tue, 3 Sep 2002, JOSE MARIA GARCIA VALDECASAS BERNAL wrote:

> I believe there are multiple ways of choosing the language, but i thought
> that using macros instead of text strings could be a good idea. I mean,
> using the configure script we can define some macros that will let us
> choose some code files that are just for the recorder or the player.

You mean in the style...

 get_string(HELLO_WORLD_ID)

...that returns the translated string for "hello world" ? Yes, I believe that
is the way to do it.

This could be fixed right now, and have the get_string() a macro similar to
something like this:

#define get_string(x) x
#define HELLO_WORLD_ID "hello world"
#define BYE_BYTE_WORLD_ID "bye bye world"

It would prepare the code and add no additional run-time penalty.

(Yes, they should probably have better names but you might get my drift
anyway.)

> The same way, i have changed all text strings at the code into macros, and
> have defined this macros in a header file for each language.

My opinion:

The translated strings should be in in some kind of meta-data file that the
translators hack on, patch, diff, etc. Then we have tools that generate the
arrays and lists of defines or whatever we deem necessary.

I've already suggested my meta-file format.

> Changing each string (just those that need to be translated)

All strings (that are not pure debug strings) that are english today should
of course be possible to translate. Otherwise we wouldn't do a complete job.

> in the code is a really *boring* work, but once you've done it, you can add
> all languages, just by writing a new header file and changing the english
> text with the translated text, and including the option at the language
> selection conditional.

The changed code should be language-agnostic and again, we should not write
translations in source files. I've been involved in too many projects when
translations are done that way and it never turns out like a good way. It
gives us more work and a worse end-result.

-- 
Daniel "Bagder" Stenberg -- http://rockbox.haxx.se/



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa