? ? Failure

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
27 Jun 2017

See similar PR #16878

Summary of Changes

This PR lets override any custom transliterate method form the languages xx-XX.localise.php and create same 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 2017-06-27 at 10 14 47
(It is more likely to be enabled by default when using php 5.5.x or higher).
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 - 27 Jun 2017
avatar infograf768 infograf768 - change - 27 Jun 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jun 2017
Category Libraries
avatar zero-24
zero-24 - comment - 27 Jun 2017

Please check: https://github.com/joomla/joomla-cms/compare/staging...zero-24:jm_langu?expand=1 as this looks easier to read / understand to me.

avatar infograf768
infograf768 - comment - 27 Jun 2017

@zero-24
Will do.

avatar infograf768 infograf768 - change - 27 Jun 2017
Labels Added: ?
avatar infograf768
infograf768 - comment - 27 Jun 2017

Please @zero-24 @ggppdk test.

avatar schnuti schnuti - test_item - 30 Jun 2017 - Tested successfully
avatar schnuti
schnuti - comment - 30 Jun 2017

I have tested this item successfully on 5474a1d

Tested on a "Latin" system.
Without patch: Latin languages get translated. Non-Latin languages translate alias to a date.
With patch: Latin languages AND Non-Latin languages translate alias to ASCII characters.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16880.

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 20 Jul 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 20 Jul 2017

I have tested this item successfully on 5474a1d


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16880.

avatar franz-wohlkoenig franz-wohlkoenig - change - 20 Jul 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 20 Jul 2017

RTC after two successful tests.

avatar rdeutz rdeutz - change - 20 Jul 2017
Status Ready to Commit Needs Review
Labels Added: ?
Removed: ?
avatar rdeutz
rdeutz - comment - 20 Jul 2017

same reason as here #16878 (comment)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16880.

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Aug 2017
Status Needs Review Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Oct 2017
Status Discussion Needs Review
avatar brianteeman
brianteeman - comment - 29 Dec 2019

@HLeithner this really should be closed as it is never going to get merged into J3

avatar HLeithner
HLeithner - comment - 29 Dec 2019

That's true, @infograf768 do we have something similar for j4? iirc there was a topic about this but can't remember if it's alias or only com_finder...

avatar HLeithner HLeithner - change - 29 Dec 2019
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2019-12-29 22:47:22
Closed_By HLeithner
avatar HLeithner HLeithner - close - 29 Dec 2019
avatar infograf768
infograf768 - comment - 30 Dec 2019

I have for both #16878 and this one a J4 ready PR.
Waiting for a decision from PD @HLeithner to decide if I propose or not.

Add a Comment

Login with GitHub to post a comment