dpn_glossary icon indicating copy to clipboard operation
dpn_glossary copied to clipboard

Words with an accent on the first letter are displayed in the index under the Undescore group

Open dogawaf opened this issue 10 months ago • 2 comments

If the first letter of a word is an accented letter, like É, the word is displayed under the Undescore group in the index.

I would suggest to use iconv in order to detect the first letter of a word:

$firstCharacter = strtolower(
    substr(
        iconv('UTF-8', 'ASCII//TRANSLIT', $term->getName()),
        0,
        1
    )
);

dogawaf avatar Apr 04 '24 08:04 dogawaf

Hi @dogawaf,

ah you mean in the character list mode, I had similiar issues with the pagination and umlauts. Here the solution for the repository was to add a static mapping for umlauts.

For the pagination and umlauts I wrote a bit of information in the documentation, where you have to set the proper database collation to be able to handle this properly.

Your code does'nt seem to work for me, but I don't know if you always want to have characters get simplified or seperated as it's own groups.

I have to try and think of a proper solution for this.

Greetings Daniel

featdd avatar Apr 06 '24 14:04 featdd

Hi @dogawaf,

I added some refactoring for the character grouped list here: a12f0b8574fafceb2a35e507f74f7afaaf8981ab

It uses PHP intl to transliterate the characters into their ASCII equivalents. So to use use this you have to have the PHP extension installed in your setup, otherwise it will be ignored.

You would help me to test this and share your feedback before I merge this.

Greetings Daniel

featdd avatar Apr 21 '24 15:04 featdd

Hi @dogawaf,

have you been able to have a look at this and is working for you too?

Greetings Daniel

featdd avatar Jun 08 '24 13:06 featdd

Hi @featdd

I've just tested your commit, with success. Thanks a lot, and sorry for the time it took to review it.

dogawaf avatar Jun 17 '24 08:06 dogawaf

Hi @dogawaf,

thanks for the feedback, merged it and prepare the TER release.

Greetings Daniel

featdd avatar Jun 18 '24 15:06 featdd