Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Can't use permalink with non-English title ?
Hi I switshed to arabic to make change, and it works!
But for my need i will copy the title into url field cause i prefer to get the arabic title in the URL.
Cheers.
NB: If i have some times i will try to make an arabic remora theme.
Last edited by Dragondz (2009-12-21 08:57:04)
Offline
Re: Can't use permalink with non-English title ?
I wrote a Hebrew transliteration and tried to send it to txp-dev@textpattern.com, but gt this error message:
The error that the other server returned was: 550 550 <txp-dev@textpattern.com>: Recipient address rejected: User unknown in virtual alias table (state 14).
Offline
Re: Can't use permalink with non-English title ?
Sorry, wrong address. txp-dev@lists.textpattern.com is correct.
Offline
Re: Can't use permalink with non-English title ?
these are my two functions to convert vietnamese characters to rough ASCII equivalent. hope this help
function deLocalize($inStr)
{
$outStr = $inStr;
$outStr = preg_replace('@[éÉèÈẻẺẽẼẹẸêÊếẾềỀểỂễỄệỆ]@u', 'e', $outStr);
$outStr = preg_replace('@[úÚùÙủỦũŨụỤưƯứỨừỪửỬữỮựỰ]@u', 'u', $outStr);
$outStr = preg_replace('@[íÍìÌỉỈĩĨịỊ]@u', 'i', $outStr);
$outStr = preg_replace('@[óÓòÒỏỎõÕọỌôÔơƠốỐồỒổỔỗỖộỘớỚờỜởỞỡỠợỢ]@u', 'o', $outStr);
$outStr = preg_replace('@[áÁàÀảẢãÃạẠâÂăĂấẤầẦẩẨẫẪậẬắẮằẰẳẲẵẴặẶ]@u', 'a', $outStr);
$outStr = preg_replace('@[đĐ]@u', 'd', $outStr);
return $outStr;
}
function seftitle($yourtitle)
{
$str = deLocalize($yourtitle);
$str = strtolower($str);
$str = preg_replace('@[^a-z 0-9]+@u', '', $str);
$str = preg_replace('@\s+@u', "-", $str);
return $str;
}
echo seftitle("tiêu đề bài viết phù hợp") will produce a proper title => tieu-de-bai-viet-phu-hop
Last edited by HAC (2010-01-05 15:28:38)
Offline