Last modified: 2014-09-24 00:06:08 UTC
Crimean language has two writing systems - Cyrillic and Latin. The translator is written on php. How can this translator be included into Crimean Wiki, so that users can switch from one writing to another, such as in Kazakh Wiki (http://kk.wikipedia.org). The example of translator is here: http://medeniye.org/transliterator/ Thank you in advance.
I assume this asks for variants to be enabled?
Don Alessandro (http://ru.wikipedia.org/wiki/%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA:Don_Alessandro) tried to create support fro multiples writing systems for Crimean Tatar language based on Kazakh converter. I don't know current status. Probably developers help needed to update code to current MediaWiki code and other possible problems fixing.
Created attachment 6814 [details] Crimean Tatar writing system convertor
(In reply to comment #2) Yes, actually, he asked me to work on it. I've attached the converter. It is written on php. Is it possible to update it to current MediaWiki code?
Really. I've asked Timming to help me with this problem. So, nearly two months have passed, is there any progress?
It is the program it is important for many languages of the people of Russia and were the USSR at which alphabets varied. The experts having possibility to help, I ask to pay attention to this problem.
Totally agree with you. To date, day, many representatives of these people live abroad and enjoy the Latin, Cyrillic and others, so this is a very big problem. The sooner we resolve it, the sooner these projects will develop.
remove keyword shell. I'm not exactly sure what its here for. Note, the patch is in the wrong format (all patches should be in (uncompressed) unified diff format. Some of us don't have a rar decompression programs installed (and apparently there aren't any open source ones(?)).) Furthermore just providing the php files doesn't really give the context of where they are supposed to go. To summarize, please provide patches in unified diff format.
OK, I understand. The patch should be rewritten, to be something like http://svn.wikimedia.org/doc/LanguageTg_8php_source.html So, I'll remove the shell keyword.
That(In reply to comment #9) > OK, I understand. The patch should be rewritten, to be something like > http://svn.wikimedia.org/doc/LanguageTg_8php_source.html > That to, but more importantly, the patch should be generated by the diff program (svn diff if you're using svn, but really they're both the same program). For example (pulling a random example from bugzilla) http://bug-attachment.wikimedia.org/attachment.cgi?id=2634 notice how it has + signs at lines that are new, and - signs on lines that are removed. See [[Unified_diff#Unified_format]] Thanks.
(In reply to comment #10) Maybe I didn't understand you well, but this is not a patch, this is a transliteration program example. And the question was if someone could make a patch for Wikipedia engine out of this example. So, should I make diff a files, which is not a patch? Correct me if I am wrong. Thank you. PS. Adding an archieve in ZIP format.
(In reply to comment #11) > (In reply to comment #10) > Maybe I didn't understand you well, but this is not a patch, this is a > transliteration program example. And the question was if someone could make a > patch for Wikipedia engine out of this example. > > So, should I make diff a files, which is not a patch? > > Correct me if I am wrong. Thank you. > > PS. Adding an archieve in ZIP format. Sorry, someone added the patch keyword, and I assumed it was patch. The whole unified diff thing really only applies to patches (well I suppose you could make a diff for this entirely new program, but that does seem kind of silly). Cheers.
I've tried to change our script using Kazakh one as a model. Here is the result - http://crh.wikipedia.org/wiki/User:Don_Alessandro/Translit Is there anybody who can help me to diff and test it? Unfortunately I have no opportunity to install MediaWiki on my localhost now.
Created attachment 7783 [details] Transliterator in ZIP format
Created attachment 7785 [details] Don_Alessandro's code from comment 13 (In reply to comment #13) > I've tried to change our script using Kazakh one as a model. Here is the result > - http://crh.wikipedia.org/wiki/User:Don_Alessandro/Translit Is there anybody > who can help me to diff and test it? Unfortunately I have no opportunity to > install MediaWiki on my localhost now. I tested it on my personal install (sorry, not publically available unfortunately). Got a fatal error: Notice: Undefined variable: mCyrl2Latn in /var/www/w/phase3/languages/classes/LanguageCrh.php on line 69 Fatal error: Cannot access empty property in /var/www/w/phase3/languages/classes/LanguageCrh.php on line 69 I presume thats due to the extra dollar sign on line 69. I got rid of the dollar sign, and got a whole bunch of warnings: Notice: Undefined variable: crh2Latn in /var/www/w/phase3/languages/classes/LanguageCrh.php on line 60 Notice: Undefined variable: crh2Cyrl in /var/www/w/phase3/languages/classes/LanguageCrh.php on line 61 Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/w/phase3/includes/StringUtils.php on line 294 Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/w/phase3/includes/StringUtils.php on line 294 Warning: strtr() [function.strtr]: The second argument is not an array in /var/www/w/phase3/includes/StringUtils.php on line 324 Warning: strtr() [function.strtr]: The second argument is not an array in /var/www/w/phase3/includes/StringUtils.php on line 324 However, I do get the variant drop down menu, with two entries (Cryllic and latin). Unfortunately clicking on either of them causes the page contents to totally disappear (probably related to all the warnings). I'm also unclear on how includes/CrhConversion.php is supposed to get included (but I'm totally unfamiliar with the lang convert stuff, so there might be magic I just don't know about). Attached is a unified diff of the stuff at http://crh.wikipedia.org/wiki/User:Don_Alessandro/Translit (as of whatever time it is right now), but with the fatal error on line 70 of LanguageCrh.php fixed. Cheers. p.s. All in all, considering you never tested your code, and (I assume) you're rather new at this, having only a single fatal error is actually pretty good.
Thanks a lot! I've fixed one little bug, maybe it will work now... Could you please test this
Created attachment 7789 [details] Don Alessandro's code from comment 13 with some bugs fixed
Thanks a lot! I've fixed one little bug, maybe it will work now... Could you please test this: https://bugzilla.wikimedia.org/attachment.cgi?id=7789&action=diff
(In reply to comment #18) > Thanks a lot! > > I've fixed one little bug, maybe it will work now... Could you please test > this: https://bugzilla.wikimedia.org/attachment.cgi?id=7789&action=diff Thanks a lot for your efforts on this, apologies for the delay in getting this applied to mediawiki. I used the latest patch given, and to verify whether it actually works, I tried some test cases. But I could not get it passed. I tried this combination : "алейкум" => "aleyküm" I get preg_replace(): Compilation failed: assertion expected after (?( at offset 30 at regsConverter methods preg_replace call. This happens for Latin to Cyrillic and reverse. I am not sure in what way you tested the transliteration. I used phpunit. Created a class wiki/tests/phpunit/LanguageCrhTest with the following lines. <?php class LanguageCrhTest extends MediaWikiTestCase { private $lang; function setUp() { $this->lang = Language::factory( 'Crh' ); } function tearDown() { unset( $this->lang ); } function testTranslate() { $this->assertEquals($this->lang->mConverter->convertTo( 'aleyküm', 'crh-cyrl' ) ,'алейкум'); $this->assertEquals($this->lang->mConverter->convertTo( 'алейкум', 'crh-latn' ) ,'aleyküm'); } } and from phpunit folder, php phpunit.php languages/LanguageCrhTest.php Could you please follow this and expand the above test class with more test cases and attach here? From the errors I am getting I assume that some of the regular expressions constructed are not working. But the online tool http://medeniye.org/transliterator/index.php gave me correct results.
Alexander, I changed the keyword "need-review" to "reviewed" -- if you have time to upload a revised patch, please change that keyword back when you do. Thanks!
Can someone comment on this?
(In reply to Ata from comment #21) > Can someone comment on this? What exactly is your question (as I guess you don't want some random comment for the sake of a comment)? It looks like the current situation is described in comment 19.
(In reply to Andre Klapper from comment #22) > It looks like the current situation is described in comment 19. Something was not working -- back in 2011. I wonder if smth has changed since then.