Rockbox

Tasklist

FS#6574 - Lang v2 cleanup

Attached to Project: Rockbox
Opened by Dan Everton (safetydan) - Thursday, 25 January 2007, 11:58 GMT
Last edited by Nils Wallménius (nls) - Sunday, 05 August 2007, 19:22 GMT
Task Type Patches
Category Language
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Here'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, 19:22 GMT
Reason for closing:  Accepted
Additional comments about closing:  committed, finally :-)
Comment by Nils Wallménius (nls) - Thursday, 25 January 2007, 21:21 GMT
Looks good :-)

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#6387  and  FS#6403  should be comitted together with this.
Comment by Dan Everton (safetydan) - Friday, 26 January 2007, 00:28 GMT
Well I've made this a more general task for cleaning up the translation files.

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.
Comment by Dan Everton (safetydan) - Friday, 26 January 2007, 01:32 GMT
New version of the cleanup patch which includes:

* Include  FS#6403  and the lang changes from  FS#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.
Comment by Dan Everton (safetydan) - Friday, 26 January 2007, 02:34 GMT
A few more bytes saved.
Comment by Nils Wallménius (nls) - Friday, 26 January 2007, 13:55 GMT
* Fixed building for h300 and sansa.

* 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 ;-)
Comment by Chris (decayed.cell) - Saturday, 27 January 2007, 03:29 GMT
iPod Mini 2G build is broken
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?

Comment by Dan Everton (safetydan) - Saturday, 27 January 2007, 03:44 GMT
Looks like Nils version of the patch is missing the features.txt file. You should be able to take it from the v3 diff file.
Comment by Chris (decayed.cell) - Saturday, 27 January 2007, 03:57 GMT
Bugger me the two seem to conflict each other lol... could you merge V3 and V4? Cheers
Comment by Chris (decayed.cell) - Saturday, 27 January 2007, 04:07 GMT
Also, this conflicts with FS6554 >< Barry's unified bootloader patch
Comment by Dan Everton (safetydan) - Saturday, 27 January 2007, 04:25 GMT
It's going to conflict with a heck of a lot more patches than just that one. There really isn't much point in people who aren't working on it to apply this patch. It doesn't really bring that much benefit to most targets except for maybe 2K more RAM for things like buffers.
Comment by Nils Wallménius (nls) - Sunday, 28 January 2007, 12:24 GMT
Sorry, for being slow but was out during the weekend :-)
Here's a working patch, same as the previous one but now it also includes features.txt
Comment by Chris (decayed.cell) - Sunday, 28 January 2007, 20:36 GMT
Getting a stack of errors during compile for 5G Video

settings_list.c:661: 'LANG_UNPLUG' undeclared here (not in a function)
settings_list.c:662: warning: missing initialiser etc
Comment by Nils Wallménius (nls) - Sunday, 28 January 2007, 21:27 GMT
Yes, those were the same type of errors that I got for the h300 and sansa.
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.
Comment by Chris (decayed.cell) - Monday, 29 January 2007, 06:01 GMT
Hmm is there a way around this? It breaks the compile altogether
Comment by Nils Wallménius (nls) - Monday, 29 January 2007, 12:55 GMT
New patch, fixed building for ipods and ondios.

Test built OK on:
ipods: video, nano, 4G (grayscale)
iriver: h300
archos: ondiofm, ondiosp, player, recoder
sansa: e200
iaudio: x5
Comment by Nils Wallménius (nls) - Monday, 29 January 2007, 15:57 GMT
Previous patch includes features.txt twice, fixed
Unified more identical strings and excluded more unused strings for certain targets.
Cuts about 2k of binary size on a recorder v1 build :-)
Comment by Dan Everton (safetydan) - Monday, 29 January 2007, 21:09 GMT
Awesome work Nils. Haven't had as much time to work on this as I'd like. Thanks for picking it up.
Comment by Dan Everton (safetydan) - Wednesday, 31 January 2007, 10:50 GMT
Just some minor fixes to features.txt in this version. No new cleanups.
Comment by Nils Wallménius (nls) - Thursday, 01 February 2007, 21:07 GMT
It appears like I found some time :-)
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.
Comment by Nils Wallménius (nls) - Sunday, 04 February 2007, 18:59 GMT
* fix mistake by me in the last version that broke the cliplight menu.
* 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.
Comment by Nils Wallménius (nls) - Monday, 05 February 2007, 17:01 GMT
Ok doing a little testing I found that the bug with the misplaced
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 :-)
Comment by Nils Wallménius (nls) - Monday, 26 February 2007, 13:09 GMT
New version of the patch, I think this is mostly finished now.
* 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#6652  is a system for target specific
headers 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.
Comment by Nils Wallménius (nls) - Friday, 02 March 2007, 01:43 GMT
* Synced with svn.

* 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.
Comment by Nils Wallménius (nls) - Sunday, 04 March 2007, 11:50 GMT
* Synced with svn.

* Removed 2 newly deprecated strings

* Added two more feature categories, recording_swcodec, and recording_hwcodec.
Comment by Nils Wallménius (nls) - Thursday, 08 March 2007, 21:39 GMT
* sync

Comment by Nils Wallménius (nls) - Wednesday, 14 March 2007, 12:50 GMT
* sync
Comment by Marianne Arnold (pixelma) - Saturday, 17 March 2007, 12:07 GMT
Here's my contribution so far - even though it's not completely working in this stage, but I hope it helps in a way.
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
Comment by Nils Wallménius (nls) - Saturday, 17 March 2007, 16:38 GMT
Synced, included most of pixelma's changes and made some minor tweaks.
(forgot to say that it now builds fine on all targets I tested)
Comment by Dan Everton (safetydan) - Thursday, 12 April 2007, 11:02 GMT
This patch isn't forgotten, I'm working on getting it back in sync with the trunk. This may take a while though.
Comment by Dan Everton (safetydan) - Thursday, 12 April 2007, 11:43 GMT
Very rough sync to r13123. Some things may be missing, but I'm hoping it's the same as the v16 patch. Only tested one build so far.
Comment by Marianne Arnold (pixelma) - Wednesday, 09 May 2007, 08:54 GMT
I synced the v17.patch and thought I was done. Now I read the comment above again and am not so sure anymore...

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.
Comment by Dan Everton (safetydan) - Wednesday, 09 May 2007, 09:29 GMT
I think I was just saying that I wasn't sure that I'd kept all the new lang strings that had been added since the last sync. There's no easy way to diff the lang file anymore now that the strings have been sorted.
Comment by Marianne Arnold (pixelma) - Thursday, 10 May 2007, 23:33 GMT
Noticed... that's how I did to. So in addition to what I got before, I just looked through the changes to english.lang in svn since version 16 and I think there was nothing missing (nothing against another pair of eyes though).

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.
Comment by Nils Wallménius (nls) - Tuesday, 15 May 2007, 19:15 GMT
Nice work, btw bagder said he will take a look at the bug blocking this when he gets back from his vacation.
h10* is not going to work because it will also match the h100 target.
Comment by Nils Wallménius (nls) - Saturday, 26 May 2007, 12:29 GMT
* Synced with svn (r13496)

* 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
Comment by Nicolas Pennequin (nicolas_p) - Monday, 23 July 2007, 16:37 GMT
Synced with SVN r13965.
Comment by Nils Wallménius (nls) - Tuesday, 24 July 2007, 17:26 GMT
* Include a fix by Dave Chapman for the last remaining issue in  FS#6652 
which 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.
Comment by Nicolas Pennequin (nicolas_p) - Saturday, 28 July 2007, 17:02 GMT
Sync to r14042

I've added a lang_cleanup branch to the public git repo: http://repo.or.cz/w/Rockbox.git?a=shortlog;h=lang_cleanup
Comment by Nils Wallménius (nls) - Sunday, 29 July 2007, 13:57 GMT
* Merge in the patch from  FS#7215  as both patches were changing some
of the same things and really should be committed together anyway

* Fix building of voice files
Comment by Nils Wallménius (nls) - Monday, 30 July 2007, 11:10 GMT
Genlang appears to have a problem with translations not specifying the same targets as the english.lang file.

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
Comment by Marianne Arnold (pixelma) - Tuesday, 31 July 2007, 23:35 GMT
Ok, I put back the "#else" between the anti-skip buffer setting as discussed in IRC but now it doesn't build for the Ondio at all.
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...
Comment by Nils Wallménius (nls) - Wednesday, 01 August 2007, 09:23 GMT
* Synced with current svn (r14113)

fix breakage of the anti skip setting
Comment by Daniel Stenberg (bagder) - Thursday, 02 August 2007, 22:09 GMT
I committed a genlang fix just now that fixed the problems in my tests. Please check and see if it did so in your end too!
Comment by Nils Wallménius (nls) - Sunday, 05 August 2007, 18:45 GMT
Yes, the bug has been fixed and all is working fine, now to get this committed :-)
Thanks!

Loading...