User tests: Successful: Unsuccessful:
See similar PR #16878
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.
Check in System Information => PHP Information that the extension is enabled:
You should get something like this:
(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 完 成
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
I have tested this item
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.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Status | Ready to Commit | ⇒ | Needs Review |
Labels |
Added:
?
Removed: ? |
same reason as here #16878 (comment)
Status | Needs Review | ⇒ | Discussion |
Status | Discussion | ⇒ | Needs Review |
@HLeithner this really should be closed as it is never going to get merged into J3
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...
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-12-29 22:47:22 |
Closed_By | ⇒ | HLeithner |
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.
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.