voku / portable-ascii

🔡 Portable ASCII library - performance optimized (ascii) string functions for PHP.
MIT License
536 stars 36 forks source link

German transcription with plural is wrong #38

Open osworx opened 4 years ago

osworx commented 4 years ago

According to your description:

For example, German will map 'ä' to 'ae', while other languages will simply return e.g. 'a'.

this is wrong. Example: 1 Apfel ( 1 Aple ) > nothing to convert 2 Äpfel (2 Apples) > you will convert Ä to A which is wrong because with an A only the 2 Apples become 1 Apple. Maybe this sample is a bit hard to understand, but 1 Apfel = 1 Apple , 2 (or more) Äpfel are more Apples. The only difference is the first letter, either an A or an Ä

Same will be with your sample Düsseldorf, converting it to en for example will translate Düsseldorf to Dusseldorf where it should be in all other languages than German Duesseldorf! Dusseldorf may also exist as a town somewhere in Europe, if not Dussel means something very special in German (some stupid).

Translating German into other languages, especially for SEO-URLs is not that easy as it looks! Please recheck and rework your framework, if it will handle such cases also correct, it could be useful.

aimeos commented 4 years ago

If you don't pass the right language, the replacements will be that for English. Use \voku\helper\ASCII::to_ascii( '2 Äpfel', 'de' ) to get 2 Aepfel.

BTW: The package has the best implementation we've seen up to now for transliteration! Great work :-)

osworx commented 4 years ago

If you don't pass the right language, the replacements will be that for English. Use \voku\helper\ASCII::to_ascii( '2 Äpfel', 'de' ) to get 2 Aepfel.

BTW: The package has the best implementation we've seen up to now for transliteration! Great work :-)

Aepfel is NOT Äpfel. Can't understand why this is so hard to understand!

And what do you mean by "If you don't pass the right language .." What shall I pass?

voku commented 4 years ago

If you don't pass the right language, the replacements will be that for English. Use \voku\helper\ASCII::to_ascii( '2 Äpfel', 'de' ) to get 2 Aepfel. BTW: The package has the best implementation we've seen up to now for transliteration! Great work :-)

Aepfel is NOT Äpfel. Can't understand why this is so hard to understand!

And what do you mean by "If you don't pass the right language .." What shall I pass?

I am pretty sure that Ae is correct here, if you pass 'de' as language: https://de.wikipedia.org/wiki/Umlaut#Darstellung_von_Umlauten