Page 1 of 1
Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Tue Aug 30, 2005 9:12 am
by roman
When you create a new page, after send form, you must change page alias - remove characters "?"...
Way is change file "lib/classes/class.content.inc.php" ... after line 341 ("$alias = trim($this->mMenuText);") put:
Code: Select all
#Change letters with diacritic
$badletters = array("ľ", "š", "č", "ť", "ž", "ý", "á", "í", "é", "ú", "ä", "ô", "ň", "ď", "ů", "ř", "ě");
$goodletters =array("l", "s", "c", "t", "z", "y", "a", "i", "e", "u", "a", "o", "n", "d", "u", "r", "e");
$alias = strtolower(str_replace($badletters, $goodletters, $alias));
Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Fri Sep 02, 2005 8:04 am
by mbvdk
Looks like a simple solution, but it has one drowback: when the user creates a page name that contains a character that is not on the list, you still get an invalid alias.
What I do is disable alias auto-generation, setting
Code: Select all
$config['auto_alias_content'] = false;
in "config.php"
Not elegant, but now it's the users fault if the alias isn't valid

Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Fri Sep 02, 2005 11:45 am
by roman
Yes, but before my solution was also this problem, and now, if y will fill into this arrays letters from your language can be good. Not?
Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Fri Sep 02, 2005 12:32 pm
by Ted
If I were going to do something like this, it would have to be on a language by language basis and actually defined in the nls file for that language.
I'm not opposed to that, though. Lemme think about it.
Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Fri Sep 02, 2005 1:50 pm
by roman
I'm not opposite

, settings can by in 'User Preferences' admin part,if y like this system, or default, or not 'auto_alias_content' ... Also in user preferences somebody had question about numbers of pages displayed per mangement of pages in file 'admin/listcontent.php' ...default is 20. This file ('admin/editprefs.php') can be automatic generated from database for furhter inflation. .... but maybe don't will be cms MADE SIMPLE

Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Mon Apr 24, 2006 6:46 pm
by ToOb
Ted wrote:
If I were going to do something like this, it would have to be on a language by language basis and actually defined in the nls file for that language.
Definition table used in Textpattern (for "all" languages globally):
http://txpref.avinnovators.com/textpatt ... source.txt
PHP function utilizing it:
http://txpref.avinnovators.com/textpatt ... .html#l561
(Don't ask me why is called dumbdown. :)
Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Wed May 07, 2008 2:09 pm
by Wiedmann
Hi Karolis,
you can try the attached patch. (at the current date, I assume that your PHP have the iconv-extension installed...)
Regards,
Carsten
Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Thu May 08, 2008 11:59 am
by Wiedmann
And I still get the following error when adding page with Russian characters:
Can you give me an example of such a Russian page name?
Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Thu May 08, 2008 2:05 pm
by Wiedmann
Thanks, and I've found the problem... iconv also does not have a translation table for any of these characters (the chars from "roman" all work fine...). Thus these chars can't be translit to another charset (they have no similar expression) and so the remaining string is empty.
Three ways are possible
- you can enhance the file "replacement.php" with all Cyryllic chars you are using
- cmsms is using a unique random string as page alias instead (need patch)
- use the Cyryllic chars (any utf-8 char) as page alias. (need patch)
Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Thu May 08, 2008 2:31 pm
by Wiedmann
can you provide me with the links to the patches you've mentioned?
Oh, if you need one of them, I must first write the patch

Re: Automatic change of 'page alias' for slovak, czech, and other languages
Posted: Thu Jun 12, 2008 1:17 pm
by Sonya
I solved it with translit lib and UDT (russian)
http://forum.cmsmadesimple.org/index.ph ... 132.0.html
Probably a solution for you too.