JoomFish / joomfish-2.5

Joom!Fish 2.5 core development
http://www.joomfish.net/
34 stars 27 forks source link

Unicode not accepted in menu alias translation #142

Open kochinc opened 11 years ago

kochinc commented 11 years ago

I turned on Unicode Aliases in the Global Configuration. Tried it out in the Menu Manger and had no problem entering Unicode text into the Alias field.

When I used Joom!Fish to do the translation of a menu item and put a Unicode string into the Translation field in the Label: Menu Alias section, after saving it I got a transliterate string back. For example, "樣品網站" becomes "2013-05-03-16-30-35".

kochinc commented 11 years ago

Similar problem was experienced when translating Alias field for a Content. However, the Unicode Alias was not transliterated but simply ignored.

kochinc commented 11 years ago

It appears both contentelement XML files, menu.xml and content.xml, specify filterTitle as the posthandler for the alias field. That causes filterTitle() in translationobject/menu.php and translationobject/content.php to be called when saving the translation for menu and content, respectively.

Now, filterTitle() calls JFilterOutput::stringURLSafe() to clean up the string. Unfortunately JFilterOutput::stringURLSafe() doesn't respect the Unicode Aliases setting in the Global Configuration.

Modifying filterTitle() so that it calls JApplication::stringURLSafe() instead seems to fix the problem.

kochinc commented 11 years ago

I wonder whether filterName() also has to be modified.

By the way, I tried to make the modifications on GitHub and submit a pull request, but it didn't seem to work.