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: .lang files

Re: .lang files

From: Björn Stenberg <bjorn_at_haxx.se>
Date: Mon, 16 Sep 2002 14:05:11 +0200

Florian Mösch wrote:
> Aren't those defines resulting in simple text substitutions by the
> preprocessor ?

No. In the code it will look something like this:

---language.h---

#define LANG_VERSION 0
#define LANG_BROWSE 1

#define str(_x_) lang_strings[_x_]

extern unsigned char* lang_strings[];

---language.c---

unsigned char* lang_strings[] = {
 "Version",
 "Browse"
};

---apps/main.c---

 lcd_puts(0,0,str(LANG_VERSION));


> How do you plan to implement a run-time version of your design ?

We simply link several different arrays (lang_sv, lang_en, lang_fr, lang_de) and then assign the lang_strings pointer to the currently selected one.

-- 
Björn
Received on 2002-09-16

Page template was last modified "Mon Jun 14 16:30:06 2021" The Rockbox Crew -- Privacy Policy