This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10992 - Translating <untagged> in Database Viewer
Attached to Project:
Rockbox
Opened by Rui Araújo (Akur) - Tuesday, 09 February 2010, 23:56 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Thursday, 20 May 2010, 15:25 GMT+2
Opened by Rui Araújo (Akur) - Tuesday, 09 February 2010, 23:56 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Thursday, 20 May 2010, 15:25 GMT+2
|
DetailsThis is a patch so that the string <untagged> can be translated.
It does that simply by checking for tag matches "<untagged>" and if it does substituting the tag with a translation. The patch already includes the addition for the english and portuguese version. This was reported on |
This task depends upon
Closed by Jonathan Gordon (jdgordon)
Thursday, 20 May 2010, 15:25 GMT+2
Reason for closing: Accepted
Additional comments about closing: thanks! in r26192.
Thursday, 20 May 2010, 15:25 GMT+2
Reason for closing: Accepted
Additional comments about closing: thanks! in r26192.
1) use straight strcmp() because the <Untagged> string is hardcoded so it wont ever be any other case, and you want to compare the full string, comparing against MAX_PATH is just wrong!
2) move the "<Untagged>" #define into a .h if you want to use it in more than 1 .c
3) I'm not entirely sure where tcs.result comes from, but what you are doing is almost certainly overwriting something, double check that you arnt please.
About the tcs, as I understood from the code, it is a struct which contains the data from a tagcache search. As I just want to change the name "<untagged>", every time it finds a new tag to process, I checked if it is a positive match and if it is, I overwrite the name and the name length according to the translation.
As this struct will be rewritten at the beginning of the loop, I think there isn't a problem with me overwriting it.
Besides while trying to understand the code I made logf's of every single variable to be sure I wasn't screwing anything.. ;)
But here's a new patch with just a new check for this situation. If the translated string is too big it won't translate.
Furthermore if this ever happens I would say that the translation should be reviewed...
/me wonders what result_len is needed for