|
Rockbox mail archiveSubject: Re: What function loads a .lang file?Re: What function loads a .lang file?
From: <for_spam_at_gmx.de>
Date: Sun, 27 Apr 2003 18:39:06 +0200 (MEST) hello, i have often came accross mixed up menus, i.e. completly wrong strings at completly wrong positions which nearly made me going crazy. for me, it seems, the current implementation of language_strings isn`t really bullet proof. I also find it annoying, that entries in .lang-files can occur at completely different positions for each language, and if you want to do some changes you constantly have to use your editor`s search feature. I really would like it, if english and other langfiles would be in "sync." - line by line. regards roland > > Quoting Linus Nielsen Feltzing <linus_at_haxx.se>: > > > > [Your] current concept depends on the order of the strings. Use the > > str() > > macro and stay out of trouble. > > > And admittedly that's safer. But by using str() exclusively, I find that I > repeat the same code in many functions to copy pointers from > language_strings to a local array. It's tedious, and error-prone, and it bloats the > code. I think we code save a non-trivial amount of code by insisting the lang > strings be ordered. > > My first thought was to do the copying, in one function, into static > arrays, and call that function whenever a new lang file was loaded. My code > would then refer to my static arrays. You objected to that as well, as it means > keeping pointers to the internationalized strings. (Which is bad why? Will > those strings be relocated at any tme other than when a lang file is > loaded?) > > > Below is the code that gets repeated; note that even with what I'm doing, > I can't remove the first ("chop_option") because "YES" comes before "NO" in > language_strings: > > char* chop_option[] = { > str( LANG_SET_BOOL_NO ), > str( LANG_SET_BOOL_YES ) > } ; > > char* display_option[] = { > str( LANG_FILE_PREFIX_OFFSET_AT ), > str( LANG_FILE_PREFIX_OFFSET_AFTER ) > } ; > > char* character_class_option[] = { > str( LANG_FILE_PREFIX_CHAR_CLASS_SPACE ), > str( LANG_FILE_PREFIX_CHAR_CLASS_PUNC ), > str( LANG_FILE_PREFIX_CHAR_CLASS_LETTER ), > str( LANG_FILE_PREFIX_CHAR_CLASS_DIGIT ), > str( LANG_FILE_PREFIX_CHAR_CLASS_LETTER_OR_DIGIT ) > } ; > -- > Archos FM needs a Rockbox! > -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!Received on 2003-04-27 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |