In Revolution 2.0.0-pl r7166 there are settings for alias transliteration. How to properly set them up to make this [tt]Zażółć gęślą jaźń[/tt] into this [tt]zazolc-gesla-jazn[/tt]?
How to set up [tt]friently_alias_translit[/tt] to use [tt]iconv[/tt]?
How to set up [tt]friently_alias_translit[/tt] to use [tt]translit.modTransliterate[/tt]?
This is the web: the only thing you know about who will come is that you don't know who will come.
Quote from: OpenGeek at Jul 15, 2010, 12:02 PMSpecify the value of iconv
That’s what I did initially and now repeated but with no result. I experimented with [tt]friendly_alias_restrict_chars[/tt] setting and got the following from my example [tt]Zażółć gęślą jaźń[/tt] (all with [tt]automatic_alias[/tt] enabled):
pattern zażółć-gęślą-jaźń
legal zażółć-gęślą-jaźń
alpha za-gl-ja
alphanumeric za-gl-ja
My iconv setup from php_info is at its default:
iconv support enabled
iconv implementation glibc
iconv library version 2.10.1
Directive Local Value Master Value
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1
This is the web: the only thing you know about who will come is that you don't know who will come.
-
MODX Staff
- 10,725 Posts
restrict_chars is not transliteration. That just removes any chars you don’t want to include. Is the iconv transliteration not working for you? Do you have iconv available?
Quote from: OpenGeek at Jul 16, 2010, 10:49 AM
Is the iconv transliteration not working for you? Do you have iconv available?
Apparently it’s not working as expected. I do have iconv available according to [tt]php_info[/tt] output I posted before. I did a small testing with the following snippet:
$str = "Zażółć gęślą jaźń";
$oc = "ISO-8859-1";
$ic = "UTF-8";
echo iconv( $ic, $oc . '//TRANSLIT//IGNORE', $str );
I experimented with different input and output encodings but could not the expected result. However, from what I understand from [tt]core/model/modx/modresource.class.php[/tt] the conversion carried out is from UTF-8 to UTF-8 (assuming the site encoding is set to UTF-8, which is my case), so the output string will be *exactly the same* as input.
I’m on a dedicated machine running Ubuntu Server with PHP 5.2.10.
This is the web: the only thing you know about who will come is that you don't know who will come.
-
MODX Staff
- 10,725 Posts
Yeah, I originally had it hardcoded as ASCII//TRANSLIT//IGNORE and that seemed to handle a lot of the transliteration automatically, but caused problems with some. It also didn’t seem proper to translate it to ASCII, but, now I’m just confused. It may be that ASCII//TRANSLIT//IGNORE is what it should be and custom named transliteration tables will need to be used in your case. If you find otherwise, I’d love some help in determining if iconv is even useful here. It seemed to be originally, but now I’m not so sure.
The intention BTW is to take the transliteration tables created for Evolution’s TransAlias plugin and use those with translit.modTransliterate. I’ll see if I can find the time this weekend to publish it with some existing transliteration tables.
Quote from: OpenGeek at Jul 17, 2010, 01:48 PM
It may be that ASCII//TRANSLIT//IGNORE is what it should be and custom named transliteration tables will need to be used in your case. If you find otherwise, I’d love some help in determining if iconv is even useful here.
This doesn’t help either. I tested a standalone script outside of MODx too with the same result.
How could I test iconv further to determine its usefulness?
The intention BTW is to take the transliteration tables created for Evolution’s TransAlias plugin and use those with translit.modTransliterate. I’ll see if I can find the time this weekend to publish it with some existing transliteration tables.
AFAIR I posted this issue for 0.9.x those days and provided a custom table extracted from Textpattern which I still have locally.
This is the web: the only thing you know about who will come is that you don't know who will come.
Quote from: OpenGeek at Jul 17, 2010, 01:48 PM
I’ll see if I can find the time this weekend to publish it with some existing transliteration tables.
Any update on this?
This is the web: the only thing you know about who will come is that you don't know who will come.