User tests: Successful: Unsuccessful:
Replaces #16880 which was refused for J3
See comment by @HLeithner #16880 (comment)
This PR lets override any custom transliterate method form the languages xx-XX.localise.php and create automatic ascii alias whatever the language used in the title of the item when the alias field is empty/emptied.
It takes advantage of the PHP extension intl
when it is enabled to use the transliterator_transliterate()
method, itself using ICU
library.
The php extension is available since php 5.4.0, but may not be enabled on some hosts.
If disabled, former behavior is used, i.e. depending of the language in use or the item language or the site language (Depending on situation).
Using iconv
and IGNORE
let's get rid of some prime-characters that can't be transliterated, like the Cyrillic letter ь
.
It is totally B/C as existing aliases are not modified.
Check in System Information => PHP Information that the extension is enabled:
You should get something like this:
If it is not enabled on your local environment, try to modify your PHP.ini.
After patch, create or modify an item (menu item, article, category).
Leave the alias field empty or empty it and save.
For the same item, change its content language, empty alias field and save again.
Example with title 完 成
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-18 14:01:10 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thanks!