• Resolved pitaraj

    (@pitaraj)


    I use WordPress in French, and it automatically sorts accented characters properly in the Tag List (ex.: Action, ?ge, Ami…).

    I was therefore surprised to see Tag Groups’ Alphabetical Tag Index sort accented characters separately after Z!

    I then thought of using Custom Taxonomy Order to correct the problem. I made sure that accented characters were in proper order in the CTO’s tag list (they were, without me having to do any drag and drop), and I selected the option Sort by Term Order in Tag Groups Gutenberg Block sidebar. But accented characters remain sorted separately after Z!

    As a matter of fact, whether I select Sort by Natural Order, by Tag ID or by Tag Description, it doesn’t change the sort order of my tags as it should.

    What’s the problem, and how do I correct this?

Viewing 15 replies - 1 through 15 (of 28 total)
  • The sorting of first letters happens separately, we cannot use any WordPress function here. We first try with PHP’s Collator class (using the locale of the WordPress site), and if that doesn’t exist, the PHP function sort() with the PHP locale.

    I just tried on my server with the tag names you mentioned and they are sorted like A, á, ?, B and so on . So, somewhere on your server might be a wrong locale setting or another script changes something in PHP.

    If you have access via FTP, you could add to your theme’s functions.php setlocale(LC_COLLATE, 'fr_FR'); and see if that helps.

    I will also check if it makes sense to add “setlocale” directly to the plugin code, just to make sure. This would then be included in the next release.

    Thread Starter pitaraj

    (@pitaraj)

    I am not in a position to fiddle with files on the server.

    All I can say, is that my OS is in French, Worpress is in French, and my theme is in French. So everything should already be French-friendly…

    Nevertheless, how do you explain that using Tag Groups’ Sort by Term Order option as per the order set in Custom Taxonomy Order does not work?

    • This reply was modified 4 years, 1 month ago by pitaraj.

    Please post a link to the tag cloud where I can see these tags and also a sample of tags in the order that you saved with Custom Taxonomy Order, where it is different.

    PS: And also post the PHP version that you use on that server.

    Thread Starter pitaraj

    (@pitaraj)

    Here’s everything you asked for :

    https://www.pierrecorbeil.com/blogue-mots-cles/

    (The Custom Taxonomy Order sample and the PHP info are displayed after the alphabetical tag index.)

    Can you give me an example of two tags where the order is different in the list above and in the Custom Taxonomy Order screenshot below? I just see the wrong order of first letters, but in each chapter the order from Custom Taxonomy Order seems to work.

    Thread Starter pitaraj

    (@pitaraj)

    I’m not sure what you mean.

    At the bottom of the page, in the screen capture titled “Ordre des étiquettes” from Custom Taxonomy Order, you can see:
    Absolu
    Action
    Action désintéressée
    ?ge de Kali
    Allah
    ?me
    ?me réalisée
    ?me Suprême
    Amitié

    whereas on top of the page, Tag Groups listing goes:
    Absolu
    Action
    Action désintéressée
    Allah
    Amitié

    with
    ?ge de Kali
    ?me
    ?me réalisée
    ?me Suprême
    presented separately after the Y entries.

    Yes, all “A” is in one group and all “?” is in another group.

    The group “?” has the wrong position. That is the problem with the locale. I hope it can be fixed with the next version.

    Inside the group “A” the tags have the correct order and inside “?” the tags also have the correct order. So the order from Custom Taxonomy Order seems to work.

    Thread Starter pitaraj

    (@pitaraj)

    Thanks for your reply, Chris.

    When do you expect to update the plugin to correct the locale problem?

    Also, may I suggest that you include an option allowing for target info display in a new browser tab when clicking on any of the entries in Alphabetical Tab Index?

    The update should be out during the next days. I tested it on my servers and at least it works here. It will also add a parameter locale=... so that users have more options to customize it.

    Regarding the new tab: You could try the parameter link_target. For your needs it would be:

    link_target=_blank

    Thread Starter pitaraj

    (@pitaraj)

    Thanks again for your support.

    I’ve looked at many alternatives to tag clouding and indexing, and your take on it is definitely the best as far as I’m concerned.

    Thread Starter pitaraj

    (@pitaraj)

    Hi Chris,

    I just installed the new update, and the sorting is now done as follows :
    All words starting with A
    All words starting with é
    All words starting with ?
    All words starting with ê
    All words starting with B
    etc.
    Sorting by Name or by Term Order gives the same result.

    Do I have to change something somewhere?

    You could try the parameter locale. (Assuming that you use the shortcode.)
    For example:

    locale="fr_FR"
    or
    locale="fr_FR.UTF8"
    or
    locale="fr.UTF8"
    or
    locale="fr_FR.UTF-8"
    or
    locale="fr.UTF-8"

    Please also add remove_filters=0.

    I spent some hours researching and it really seems to depend on what locale is available on the server. The sort order is correct in other places, because these things are sorted in the database. Unfortunately we cannot use the database for sorting the first letters, because we have to extract them at a later time.

    The parameter “orderby” will not help here, because that is also for the database level.

    The company that provides the server might be able to tell you more. They might have experience with these cases.

    Thread Starter pitaraj

    (@pitaraj)

    The best I can get is with
    locale=”fr_FR.UTF8″
    or
    locale=”fr_FR.UTF-8″
    the result being as follows:
    A group
    ? group
    B group
    C group
    D group
    E group
    é group
    ê group
    F group
    etc.

    With or Without remove_filters=0 changes nothing

    I’m not so familiar with the French sorting order. Is this still wrong? At least the parameter “locale” really has an impact on the search order – the letters with accents are always directly after the ones without. Now the last step is to find the right setting for the locale.

    I think that French users are more able than me to help. I don’t even know what is the correct result. ??

    You could try to ask here: https://wordpress.stackexchange.com/ – or the people who provide your server should be able to give more hints.

Viewing 15 replies - 1 through 15 (of 28 total)
  • The topic ‘Alphabetical sorting problem in French’ is closed to new replies.