? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
18 Feb 2020

Replaces #16880 which was refused for J3

See comment by @HLeithner #16880 (comment)

Summary of Changes

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.

Testing Instructions

Check in System Information => PHP Information that the extension is enabled:
You should get something like this:

Screen Shot 2020-02-18 at 08 08 42

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 完 成

screen shot 2017-06-27 at 12 00 12

avatar infograf768 infograf768 - open - 18 Feb 2020
avatar infograf768 infograf768 - change - 18 Feb 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Feb 2020
Category Libraries
avatar wilsonge wilsonge - change - 18 Feb 2020
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: ?
avatar wilsonge wilsonge - close - 18 Feb 2020
avatar wilsonge wilsonge - merge - 18 Feb 2020
avatar wilsonge
wilsonge - comment - 18 Feb 2020

Thanks!

Add a Comment

Login with GitHub to post a comment