Currently some Cyrillic letter are transliterated not in very convenient way. For example 'г' transliterated as 'gh' meanwhile it was expected to be transliterated as 'g', 'х' as 'kh' when expected 'x' or just 'h' , 'е' as 'ie' when expected just 'e', 'ү' as 'u', some rarely but still used letters like 'ө', 'ң' are ignored completely. Above parities could be true for some languages which use Cyrillic, but for other languages look weird and sometimes are totally unacceptable. So my question is how could we tweak transliterations patterns by ourselves? If it is possible to set pares in admin section of Drupal site. If not please tell us how and where exactly we could hack the module to change the default transliteration behavior.
Comments
Comment #1
smk-ka commentedTransliteration supports language specific alterations, the following guide should help you adding them:
'language_code' => array(0x33 => 'g'),Two things are important here: First,
language_codemust be a valid code from Drupal's list of languages. Second, you have to keep only the last two digits of the character code (ie. 0x33, since the other two are already encoded in the file name). Remember to use hexadecimal notation everywhere.Also take a look at data/x00.php since it already contains a bunch of language specific replacements. If you think your overridden replacements are useful for others please create and file a patch.
Comment #2
yngens commentedsmk-ka,
Thank you very much for your reply. I am currently trying to tweak it following your instructions and have couple of questions.
1. I don't know where exactly I need to place such a code like
'language_code' => array(0x33 => 'g'),The files format is as follows:
So, i only could change replacing 'gh' to 'g' directly in the above raw, not by placing
'language_code' => array(0x33 => 'g'),anywhere.2. It only works with 'en' operand. Even though I tried to use such valid Drupal denominations (
language_code) like 'ru', 'kz', 'uz', 'ky' it always gives this error:Fatal error: Unsupported operand types in /home/mysite/public_html/sites/all/modules/transliteration/transliteration.inc on line 203
3. If the second question above will be resolved, then should put transliteration arrays for all three languages in one file or how else this works?
Thank you!
Comment #3
yngens commentedAlso it would be nice, to have real UTF8 parities in those php files, because after finding the right file per your instructions it is not clear how to define which character is a pair of the letter to be modified. For example, currently Cyrillic character 'ө' has been replaced by Latin 'o', and after finding the correct data file I don't know which of several 'o's and 'O's are pair of 'ө'. Of course, this problem is true in case of direct edit of a given array. The method of writing correct pair like
'language_code' => array(0x33 => 'g'),would ease the problem, but as I put above I don't know where to put this code.Comment #4
illuminaut commentedwould be nice to have an admin interface to change/add transliterations.
Comment #5
Eugene Fidelin commentedI also want to ciorrrect cyrilic transliteration but don't know where to do it
Comment #6
smk-ka commentedThe 3.x branch has a new and (hopefully) simpler way to add overrides, plus a section in the README dedicated to adding language specific variants.
Comment #6.0
yngens commentedspelling correction