Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-12-21 08:56:05

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,546
Website GitHub Twitter

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

#14 2010-01-05 14:34:32

jacknails
Member
From: Israel
Registered: 2009-12-12
Posts: 17
Website

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

#15 2010-01-05 14:38:07

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,339
Website GitHub Mastodon

Re: Can't use permalink with non-English title ?

Sorry, wrong address. txp-dev@lists.textpattern.com is correct.

Offline

#16 2010-01-05 15:26:44

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

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

Board footer

Powered by FluxBB