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: What function loads a .lang file?

Re: What function loads a .lang file?

From: TP Diffenbach <rockbox_at_diffenbach.org>
Date: Sat, 26 Apr 2003 20:38:00 -0400

Well, I'm thinking I'll do it another way anyhow.

But we do have code that assigns pointers to the language strings. For example, in settings.c, function set_time, line 1687:
    char *dayname[] = {str(LANG_WEEKDAY_SUNDAY),
                       str(LANG_WEEKDAY_MONDAY),
                       str(LANG_WEEKDAY_TUESDAY),
                       str(LANG_WEEKDAY_WEDNESDAY),
                       str(LANG_WEEKDAY_THURSDAY),
                       str(LANG_WEEKDAY_FRIDAY),
                       str(LANG_WEEKDAY_SATURDAY)};

I wanted to maintain arrays that were subsets of the language_strings array, and change mine whenver language_strings was changed. Instead I'm thinking of indexing directly into language_strings. Admittly, that fails if the strings in english.lang are reorderd, but it doesn't seem to be too much of a burden on maintainers to insist that like strings be kept together, and in a certain order.

Quoting Linus Nielsen Feltzing <linus_at_haxx.se>:

> TP Diffenbach wrote:
> > I have code that wants to know when a .lang file is loaded, so it
> can
> > update its pointers to the language strings it cares about.
>
> Then your code does the wrong thing. You should not assign pointers
>
> directly to the language strings.
>
> /Linus
>
>


-- 
Archos FM needs a Rockbox!
Received on 2003-04-27

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy