featdd / dpn_glossary

Glossary extension for TYPO3
http://typo3.org/extensions/repository/view/dpn_glossary
GNU General Public License v2.0
20 stars 29 forks source link

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

Closed dogawaf closed 2 months ago

dogawaf commented 5 months ago

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
    )
);
featdd commented 5 months ago

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 commented 4 months ago

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 commented 3 months ago

Hi @dogawaf,

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

Greetings Daniel

dogawaf commented 2 months ago

Hi @featdd

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

featdd commented 2 months ago

Hi @dogawaf,

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

Greetings Daniel