This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#6574 - Lang v2 cleanup
Attached to Project:
Rockbox
Opened by Dan Everton (safetydan) - Thursday, 25 January 2007, 12:58 GMT+1
Last edited by Nils Wallménius (nls) - Sunday, 05 August 2007, 21:22 GMT+1
Opened by Dan Everton (safetydan) - Thursday, 25 January 2007, 12:58 GMT+1
Last edited by Nils Wallménius (nls) - Sunday, 05 August 2007, 21:22 GMT+1
|
DetailsHere's my first pass at removing lang strings from targets that don't actually use them. Many things left to do yet. Uses the "lang features" approach that Bagder was working on. See apps/features.txt in the patch.
Currently this saves about 1000 bytes from rombox builds for Recorder. Other targets don't seem to benefit as much. |
Closed by Nils Wallménius (nls)
Sunday, 05 August 2007, 21:22 GMT+1
Reason for closing: Accepted
Additional comments about closing: committed, finally :-)
Sunday, 05 August 2007, 21:22 GMT+1
Reason for closing: Accepted
Additional comments about closing: committed, finally :-)
A few comments though...
* The reason that "Mic" was "Internal Mic" for iriver h1xx/h3xx is because those have an actual
internal mic, the other targets which used just "Mic" have mic input for external mic's.
* To remain consistant in the code i guess "colourlcd" should be called "colorlcd"
(code -> American spelling, UI -> Brittish spelling)
* Backdrop is supported on iriver h1xx which doesn't have color lcd.
* AGC is iriver h1xx/h3xx only right now but could probably be left in for other swcodec
targets, however I'm not sure AGC will ever be available for Hwcodec...
And the "sysfont" version of the AGC strings are only included for those irivers
but the other non sysfont string is included for "recording"
Possibly
FS#6387andFS#6403should be comitted together with this.In addition to what Nils said above, there's some other things that should be changed.
* LANG_UNPLUG_* and friends should be LANG_HEADPHONE_UNPLUG_* as it's a little unclear what feature they're for without that.
* The strings should be sorted and grouped by feature.
And of course, other things as I think of them.
* Include
FS#6403and the lang changes fromFS#6387.* AGC feature added for AGC related strings
* colourlcd feature renamed to lcd_color
* A whole bunch of new feature strings
* Renamed LANG_UNPLUG_* to LANG_HEADPHONE_UNPLUG_*
With this patch, plain recorder rombox builds are only 1280 too large.
* Unified a couple of *_RECORDER and *_PLAYER strings into just *
* Removed a few duplicates of identical strings
* Renamed a couple of strings with confusing names.
* Changed lcd_charcell: strings into player:
* This patch is turning into a monster ;-)
make[1]: *** No rule to make target 'features.txt', needed by '/rockbox/ipodmini/apps/features'. Stop.
iPod Color 4G and iPod Video 5G builds also broken, same error. Perhaps you should move the features.txt to this flyspray instead? Or was the last .diff file not a full patch?
Here's a working patch, same as the previous one but now it also includes features.txt
settings_list.c:661: 'LANG_UNPLUG' undeclared here (not in a function)
settings_list.c:662: warning: missing initialiser etc
The problem is that the settings list uses LANG id's for the settings but
they aren't properly #ifdefe'd out so settings for features that are unsupported
on a target are still included.
Test built OK on:
ipods: video, nano, 4G (grayscale)
iriver: h300
archos: ondiofm, ondiosp, player, recoder
sansa: e200
iaudio: x5
Unified more identical strings and excluded more unused strings for certain targets.
Cuts about 2k of binary size on a recorder v1 build :-)
More unification of identical strings in this one
and added a bit to the comment in the top of english.lang
as well as some other string specific comments.
Renamed a couple more strings to more logical/gneric names.
* remove some unused strings
* excluded target specific strings from builds where they weren't needed.
* Ifdefed out some code in recording.c that was only used for remote lcd
and made it possblie exclude two strings from non remote lcd targets,
also saves about 500 bytes extra on archos (maybe this should be in a seperate patch?)
* Found one problem that I haven't investigated -- when a .lng file is loaded from disk
the strings are in the place, as if they were in the wrong order in the .lng file
Edit: forgot to mention that when english.lng is loaded this behaviour occurs.
That the other .lng files will be broken is expected.
strings is triggered by using the : NONE thing.
It is already the case with the current SVN code, but : NONE is not
currently being used in SVN. This goes beyond my understanding of the
lang build system and thus I need to find a lang wizard somewhere :-)
* Regrouped the strings in english.lang (it's quite difficult to
get a good structure but I don't think I can do it any better)
* Removed lots more unused strings that wreren't marked as deprecated
What is neede now except closing
FS#6652is a system for target specificheaders for the lng and voice files. And it would be nice to have a script
that would reorganize the translations in the same way as english.lang as
well as take care of the changed ID strings to help translators as much as
possible.
* Removed new duplicate strings added with the root menu commit.
* Removed one string that was now unused
* Fixed "alarm" in features.txt to use the new define.
I also now include the entire patched english.lang as most of the file
is changed anyway and patch doesn't handle failed hunks very nicely when
they are as big as this. The patch also includes the changes to english.lang
but will fail to apply after even the smallest change.
* Removed 2 newly deprecated strings
* Added two more feature categories, recording_swcodec, and recording_hwcodec.
The work isn't lost and someone more knowledgeable can take it from here (as I don't have much time during the weekend.
I'll attach a english_lang.txt that contains comments on _corresponding_ lines to english.lang and explains the changes I made - there were I didn't change something it's blanked out.
- synced to the guisplash changes
- invented a few more categories - pitily I haven't done all the work to the new categries yet (some only exists in the lang file, some are already in the features.txt but probably need also changes somewhere else - hope the commented text helps to figure out)
- moved a few things back for pending features (is commented)
- in the lang.txt: the paragraphs that are inside html-style comments are to be found in the english.lang already - if not it's a suggestion or a question what to do with it
(forgot to say that it now builds fine on all targets I tested)
I think I can look into comparing with v16 later today. Just want to ask if there's anything in particular that I have to keep an eye on? Is it just english.lang where something could be missing or also somewhere else? Would help me a lot if you could answer that, safetydan.
Attached is the synced patch (to r13369) - a few notes:
- I couldn't decide where to put the new strings "Context Menu", "Playlist Viewer Menu" and the "Menu Set Rating" that was already the last one from the previous sync. These three are at the end for the moment, please move it to a more appropriate place.
- fixed a few strings regarding keymaps (some that had "x5" were missing the "m5"; exchanged "gigabeat" with "gigabeatf" like in svn, I think the new button lights settings would only be needed for the F series but I don't know whether it's necessary to make an exception for the X series just for this; also added h10_5gb to it like in svn - maybe it's possible to use "h10*" in this case (?), I haven't tried but could be replaced easily now)
- removed the "LANG_PLAYLIST_MENU" and used "LANG_PLAYLIST" instead, because it only contained the string "Playlist" in svn anyways. I discovered that there are still two almost similar strings "LANG_PLAYLIST" and "LANG_PLAYLISTS" - Do we need both?
- Successfully testcompiled a few sims plus M5 and OndioFM target... the patch saves about 2500 bytes bin size for the latter.
h10* is not going to work because it will also match the h100 target.
* Sorted newly added strings, and made some tweaks here and there
* features.txt is now included with the patch, it was missing from v17 and v18
FS#6652which caused .lng files being generated without the features list
* Use -imacros in the makefile to include button.h to avoid having the
function prototypes in the features list.
* Added comment to the top of features.txt about that backwards
compatibility with .lng and .voice files will probably break if that file is changed.
* Make all occurrences of NONE -> none to make genlang output correct string
id numbers (it doesn't like NONE )
* synced, sorted new strings etc...
Please test and comment on this so that any issue can be worked out and the patch committed.
I've added a lang_cleanup branch to the public git repo: http://repo.or.cz/w/Rockbox.git?a=shortlog;h=lang_cleanup
FS#7215as both patches were changing someof the same things and really should be committed together anyway
* Fix building of voice files
in the attached file englishtest.lang the "No" sting is specified only for the target 'recorder' but in translationtest.lang
it is specified for the '*' target.
running genlang with these switches.
./genlang -b=test.lng -e=englishtest.lang -t=h300 translationtes.lang
this yields a .lng file with both the "Yes" and "No" strings having the same id 0. because the "Yes" sting is first and already had id 0
When compiling I get the following error which leads to the following definitions being wrong too.:
settings_list.c:638: error: 'LANG_MP3BUFFER_MARGIN' undeclared here (not in a function)
I think that it has to do witch the exclusion of "Anti-skip buffer" for Ondios that is introduced with this patch (and is correct).
Probably it needs some other ifdef'ing or an addition to the features.txt - but it seems I'm unable to figure that one out ATM...
fix breakage of the anti skip setting
Thanks!