Rockbox Technical Forums

Support and General Use => Audio Playback, Database and Playlists => Topic started by: iPodVT on November 30, 2022, 07:40:38 PM

Title: Database alphabetic sorting order?
Post by: iPodVT on November 30, 2022, 07:40:38 PM
Is there a way to make the DB sort such that 'András' comes before 'Andrew', as it does with 'Andras', rather than after?  I looked in Settings and also in the Manual but I didn't find anything (although, knowing me, it's probably in there somewhere).

Thanks.
Title: Re: Database alphabetic sorting order?
Post by: amachronic on December 01, 2022, 01:10:45 PM
Rockbox seems not to have any ability to do locale aware sorting, unfortunately.
Title: Re: Database alphabetic sorting order?
Post by: iPodVT on December 01, 2022, 11:12:44 PM
Thanks for your reply.

I guess it was somewhat of a U.S. english-centric expectation for me to assume that Rockbox would (or could) sort the same way that macOS, Windows, and iTunes all do for me.  It hadn't occurred to me that it would be a custom/localization situation.  Still, doesn't the in-use font usually dictate the way systems handle language manipulations?  Is right-to-left Hebrew available/useable in Rockbox?

So does Rockbox just sort on raw numeric character codes?
Title: Re: Database alphabetic sorting order?
Post by: Bilgus on December 02, 2022, 08:41:13 AM
its more of a code size thing but yes its done by character code

https://github.com/Rockbox/rockbox/blob/master/firmware/libc/strcmp.c#L73=  (https://github.com/Rockbox/rockbox/blob/master/firmware/libc/strcmp.c#L73=)

we support many languages for display and RTL works as well but the core isn't Unicode aware
just Unicode tolerant

We support many different devices with varying amounts of ram every thing you mentioned has more raw power memory and storage space available than probably all the targets combined
Title: Re: Database alphabetic sorting order?
Post by: iPodVT on December 02, 2022, 08:51:20 PM
Understood.  Thanks very much for taking the time to reply and explain.
Title: Re: Database alphabetic sorting order?
Post by: speachy on December 03, 2022, 05:48:56 PM
Is right-to-left Hebrew available/useable in Rockbox?

The short version is Yes. 

The longer answer that we have not received any reports of problems with RTL languages.  however, we don't know if it's because there are no problems, or no users -- we've not had an active developer (or known users) in some time that uses RTL languages, so I consider it likely there are lurking UI glitches or other problems.

Morevover, the Hebrew translation is (at best) about 70% complete, with ~400 untranslated strings.  If you speak Hebrew, we'd certainly appreciate help improving that.
Title: Re: Database alphabetic sorting order?
Post by: Bilgus on December 03, 2022, 06:21:08 PM
I have converted a lot of the formatting functions to be RTL aware its been a few years so ditto on any bugs you might happen across we and I would appreciate hearing about them so we can fix it
Title: Re: Database alphabetic sorting order?
Post by: iPodVT on December 03, 2022, 06:56:39 PM
In general I can read everyday Hebrew very slowly (without understanding much/any of what I'm reading) and my vocabulary is probably 25 - 50 words that I (might still) remember from my after-school childhood religious training which was more than 50 years ago.  I inquired about Hebrew in Rockbox only to get a sense of how far beyond english and other western/Romance languages Rockbox might currently be going.  I can readily read/recite many of the most common Jewish prayers, but trying to evaluate how correctly Rockbox handles/manipulates Hebrew would be quite beyond me.
Title: Re: Database alphabetic sorting order?
Post by: speachy on December 03, 2022, 08:56:58 PM
For language coverage, have a look at https://translate.rockbox.org/

Additionally, we generate voice files for thirteen languages for the nightly builds.

(Support for translating/voicing strings in plugins was added relatively recently so the coverage across our plugins isn't all that great yet, but the core code is fully translated/voiced)

Title: Re: Database alphabetic sorting order?
Post by: iPodVT on December 18, 2022, 10:56:34 PM
Tonight I was looking for Édith Piaf in Database->Artists and finally found her at the very bottom of the list of all artists - immediately after Zino Francescatti.  I guess I will have to edit her name to remove the accent from the 'É'.  I wish there was another, more proper way to manage this.
Title: Re: Database alphabetic sorting order?
Post by: iPodVT on December 30, 2022, 01:01:04 PM
Poor Édith!

I have discovered another problem caused by the accented first letter of her name:  She does not appear anywhere at all in Database->A to Z...->Artists;  not in the 'E' list and not in the Numeric list (more below about that list).  I understand why she is not in the 'E' list (though I wish that she could be there), but surely she should appear somewhere.  Perhaps there should be an additional list added immediately after the Numeric list or else after the 'Z' list that would contain every artist that doesn't get placed in any of the other lists?

Re the Numeric list:  I see that it contains artists whose names begin with characters other than 'a' - 'z' or 'A' - 'Z'.  In my case, '"Little" Jimmy Dickens' was placed there.  Since that list contains names that don't necessarily start with '0' - '9', perhaps it should be called something more generalized than 'Numeric', and then Édith and her similarly accented kin could be put there, too.

All of this seems to also apply to the 'Albums' and 'Tracks' lists that hang off of 'A to Z...'

To get around this problem in the meantime, I have edited the accent off of the 'É' in Édith's name.  But I imagine that French users of Rockbox would not be happy about having to do that for every artist, album and track that starts with an accented letter.

Thanks.
Title: Re: Database alphabetic sorting order?
Post by: Bilgus on December 30, 2022, 09:01:01 PM
I think you should be able to customize the tagnav to show those

https://www.rockbox.org/wiki/DataBase#tagnavi.config_v2.0_Syntax
Title: Re: Database alphabetic sorting order?
Post by: iPodVT on December 31, 2022, 12:07:46 PM
I think you should be able to customize the tagnav to show those

https://www.rockbox.org/wiki/DataBase#tagnavi.config_v2.0_Syntax

This is great - thanks.  I'm now using a tagnavi_user.config file to modify the "A - Z..." "Numeric" lists to only include elements that begin with a number, and I have added "Other" lists to catch everything that doesn't begin with a number or an unaccented letter (including accounting for the fact that the evaluation of <constant> is not case-sensitive).  I'm wondering if what I have done would work for languages other than English - especially those that use two byte character sets?

I still think that this should probably be built-in for the sake of non technical users who wouldn't be able to manage this stuff.

One other suggestion:  tagnavi.config contains a note about the use of tagnavi_user.config, but there is no corresponding note in https://www.rockbox.org/wiki/DataBase#tagnavi.config_v2.0_Syntax.  I think it probably ought to be there, too.

Again, thanks for your help.