The attached add-on files may be out of date. Please visit Devot-ee for the latest versions.
This extension allows you to convert automatically non-latin characters in entry’s URL title according to some predefined set of conversion rules.
There is already extension which does exactly that - CM Strange URL Interpreter. I was not content with it because using it when there is a need to define conversion rule you must make edits both in the language file and in extension file.
Using URL Title Chars extension conversion rule can be defined by editing just language file. To do it you should type a line such as this:
'url_title_char_916' => "d", // Δ Greek Capital Letter DeltaIn this line using symbol’s decimal notation (916) was set that Greek capital letter delta if found in URL title should be converted into latin letter “d”.
Installation:
1) download and unzip the package 2) open the file lang.url_title_chars.php in text editor. 3) edit conversion rules; in order to find each symbol’s decimal representation use Mr. Richard Ishida’s Unicode Code Converter v7 beta 4) upload files to language and extensions folders. 5) enable extension.
Great extension! This could be very useful.
I am trying to adapt this extension to support Korean by adding new conversion rules as follows:
‘url_title_char_45392’ => “Nyeon”, // Korean Letter 념 ‘url_title_char_45397’ => “Nyeong”, // Korean Letter 녕 ‘url_title_char_45432’ => “Noh”, // Korean Letter 노 ‘url_title_char_45453’ => “Nong”, // Korean Letter 농 ‘url_title_char_45516’ => “Noe”, // Korean Letter 뇌 ‘url_title_char_45544’ => “Neung”, // Korean Letter 뇨 ‘url_title_char_45768’ => “Ni”, // Korean Letter 니
Each single Korean character represents one syllable, therefore multiple Latin characters as above. Am I doing something wrong here?
Since there are few thousand Korean characters in use today, I am only adding about 400 most used only which should give me not entirely correct but reasonably correct URL titles.
This doesn’t seem to work.
Hi,
The bad effect is that the first capital letter gets truncated isn’t it? To avoid this fron happening open the file /system/cp/cp.publish.php, go to approximately the line 890 and comment out the line
NewText = NewText.replace(/[^a-z0-9-_]/g,'');Now conversion should proceed correctly.
I get following error message when entering Korean title and leave URL title empty and try to save
You are not supposed to leave URL title empty. When you enter Korean title URL Title Chars extension converts Korean characters into Latin ones and puts them into URL title field; contents of this field should be submitted.
when I enter English title in the title field it does convert that into url title field but when I do the same with Korean title, nothing happens.
If you have URL Title Chars extension installed and have in its language file the lines
'url_title_char_45392' => "Nyeon", // Korean Letter 념
'url_title_char_45397' => "Nyeong", // Korean Letter 녕
'url_title_char_45432' => "Noh", // Korean Letter 노
'url_title_char_45453' => "Nong", // Korean Letter 농
'url_title_char_45516' => "Noe", // Korean Letter 뇌
'url_title_char_45544' => "Neung", // Korean Letter 뇨
'url_title_char_45768' => "Ni", // Korean Letter 니the convertion should proceed, only Latin capital letters get truncated (just tried on 1.6.8 installation).
In addition, empty url title with English title saves just fine. Only the non-Latin doesn’t save with error at the end.
Correct. But this behavior has nothing to do with URL Title Chars extension. It happens because convertion into Latin characters is done client-side. If you send English title, then conversion is not needed and url_title is created server-side using title string; if you submit Korean title without url_title then url_title cannot be created server-side using title string and you get an error message.
I don’t know abot any conflicts with other extensions.
Instead of searching for possible conflicts it would be better to look at the source code of Publish page: find in it javascript function liveUrlTitle() and look inside it if you find the lines as this:
if (c == '45392') {NewTextTemp += 'Nyeon'; continue;}
if (c == '45397') {NewTextTemp += 'Nyeong'; continue;}
if (c == '45432') {NewTextTemp += 'Noh'; continue;}
if (c == '45453') {NewTextTemp += 'Nong'; continue;}
if (c == '45516') {NewTextTemp += 'Noe'; continue;}
if (c == '45544') {NewTextTemp += 'Neung'; continue;}
if (c == '45768') {NewTextTemp += 'Ni'; continue;}If there are such lines, convertion should work.
It doesn’t seem to be the extensions after all. I have reinstalled all other extensions and it still works.
I think the problem was that you need to enter some special character before URL Title Chars to start converting. When you enter consecutive Korean characters only, it does nothing but when you press something like ‘space’ or ‘!’ character then it starts to convert.
This is why I originally thought that it wasn’t working. It would be great if I can just enter consecutive Korean characters and hit tab to convert but it doesn’t work that way at this point. It doesn’t seem to recognize tab or enter character as an initiation point.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.