This page in: UNIQ302229c3d81e62c-pagenamepluslang-00000000-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000001-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000002-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000003-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000004-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000005-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000006-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000007-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000008-QINU - UNIQ302229c3d81e62c-pagenamepluslang-00000009-QINU - UNIQ302229c3d81e62c-pagenamepluslang-0000000A-QINU - UNIQ302229c3d81e62c-pagenamepluslang-0000000B-QINU - UNIQ302229c3d81e62c-pagenamepluslang-0000000C-QINU - UNIQ302229c3d81e62c-pagenamepluslang-0000000D-QINU UNIQ302229c3d81e62c-pagenamepluslang-0000000E-QINU

Cyrillic Support

The idea behind this page is to collect all the info, relating national Cyrillic alphabets support in CMS Made Simple. Although there shouldn’t be any major problems since CMSMS is UTF-8 based thus aware of national alphabets, it seems to be a good idea to share the tips and tricks here, so some valuable info won’t get lost into the forum archives.

WARNING! The information below might be outdated (trick based on an ancient 0.13 version of CMSMS). Refer to the forum thread at http://forum.cmsmadesimple.org/index.php/topic,12132.0.html for updated instructions.

Adding Cyrillic Support in auto_alias_content

First, turn on auto_alias_content in ./config.php:

#Automatically assign alias based on page title?
$config['auto_alias_content'] = true;

Then, download the excellent transliteration PHP class package by PixelApes from their website. Drop the translit.php file into the ./lib/ folder of your CMSMS installation. Then, you need to load it to CMSMS (probably loading it from some admin include file is a better idea?). Add the following code to ./include.php:

...
require($dirname."/lib/classes/class.group.inc.php");

// ZYV
require_once($dirname."/lib/translit.php");
...

Now the final touch. You need patch the SetAlias function of the content class. Open ./lib/classes/class.content.inc.php and patch it accordingly:

function SetAlias($alias) {
...
        if ($alias == '')
        {
            
		// ZYV
		if (isset($gCms->config['admin_encoding']) && isset($gCms->variables['convertclass'])) {
			$class =& $gCms->variables['convertclass'];
			$text = $class->Convert(trim($this->mMenuText), $gCms->config['admin_encoding'], "windows-1251");
		} else {
			$text = trim($this->mMenuText);
		}
		$alias = Translit::UrlTranslit($text);
...

Note that you need to decode mMenuText from UTF-8 only if you are using UTF-8 as the main CMSMS character set. If you use a different charset like KOI8-RU, then remove utf8_win1251 function from the code above and recode translit.php in KOI8-RU (file is originally shipped in Windows-1251 by PixelApes).

Enjoy, now your pretty URLs should be generated automatically by CMSMS in concordance with common Cyrillic transliteration rules.

Tip is contributed by --ZYV 08:46, 26 August 2006 (CDT)


This page in: English - Deutsch - Español - Français - Italiano - Lietuvių - Nederlands - Norsk - Polski - Česky - Русский - Svenska - Tiếng Việt - عربي - 日本語 简体中文

FAQ/Installation/Cyrillic Support

From CMSMS

Arvixe - A CMSMS Partner