dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Language cleanup (aka lang v2 cleanup)

Language cleanup (aka lang v2 cleanup)

From: Nils <>
Date: Sun, 29 Jul 2007 16:05:00 +0200

The lang v2 cleanup patch (FS#6574) that Dan Everton posted back in January
has now gone
through 23 revisions and finally feels ready to commit. Since this is a
pretty big patch and affects
a lot of stuff in rockbox I wanted to give everyone a chance to take a look
at it and comment on it
before commit.
The lang cleanup patch has been merged with FS#7215 (Make .lng and .voice
files target specific).
as they really should be committed together anyway and both patches change
things in the same
places so it was becoming a PITA to maintain them.

So what does it do?

Let's start with FS#7215.
It changes the format header of .lng and.voice files to contain a target ID
and alters respective
loader code to check for the correct ID in the loaded file. .lng files are
already different for different
targets and .voice files will be so this avoids some potential confusion for
What about FS#6574 then?
Well, it does many things:
1) The start of it all was the "features" mechanism invented by Daniel
A file named features.txt in apps/ controls which strings are included when
rockbox for a specific target. Those features are defined based on #defines
in config.h
and related target config-*.h files (as well as button.h).
An example feature looks like this:
#if defined(HAVE_DIRCACHE)
the 'dircache' feature is included for all targets that #define
And an example phrase in the .lang file looks like this
  desc: in directory cache settings
    *: none
    dircache: "Directory Cache"
    *: none
    dircache: "Directory Cache"
     *: none
     dircache: "Directory Cache"
The string will only be included for targets with the 'dircache' feature.
An important note about the features.txt file is that if features are
enabled for new targets or defines
changed around, there  is a good chance that it will break binary back
compatibility with .lng and .voice files
2) in english.lang
    * all deprecated strings have been deleted
    * strings that were not marked as 'deprecated' but were unused anyway
have been deleted
    * duplicate strings have been removed
    * some strings have changed ID to be more logical and in some cases more
    * strings are sorted into groups of related strings to make them easier
to find
    * lots of minor tweaks to comments
3) apps code
Here most changes are because of changed string IDs but also some #ifdefs
for player specific
strings have been cleaned out
The latest version of the patch can be found
What's next, then?
The translations will need some work, all the changed IDs make translations
seem worse than
they are but IMHO this can wait for a while.
Automatically generated voice files would be nice...
the decrease in voice file size opens up possibilities for more voicing :-)
Received on 2007-07-29

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