Last modified: 2011-09-19 17:02:07 UTC
Created attachment 9043 [details] LanguageOs class Please add new LanguageOs class to the directory <http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/languages/classes/>. LanguageOs.php is attached. In the class case rules and plural forms for Ossetic language are described.
This file contains some errors, e.g. "genetive" instead of "genitive". Have you tested it?
I have tested it on my personal wiki for tests (http://alaninternet.org/w/index.php?uselang=en&title=LanguageOs_test&action=edit). It works. About "genitive". I am attaching corrected version.
Created attachment 9045 [details] LanguageOs class Corrected. "genetive" => "genitive"
I don't like the looks of the way regex is being abused. From the looks of it you should be using a proper regex with a character class rather than trying to concatenate user input into a regex pattern.
Why is there convertPlural that re-implements the default implementation?
Created attachment 9046 [details] LanguageOs class Corrected
(In reply to comment #4) > I don't like the looks of the way regex is being abused. From the looks of it > you should be using a proper regex with a character class rather than trying to > concatenate user input into a regex pattern. I have attached corrected version.
(In reply to comment #5) > Why is there convertPlural that re-implements the default implementation? I didn't know that there is the default rule. But I still think we should implement convertPlural for Ossetic. It is clear using form0 for n=1 and form1 for n>1 in literature dialect. But using form1 for n=0 is not clear in literature. So it would be better for finding best form for Ossetic if someone see unclear rule in class LanguageOs instead of searching it in class Language. But if it is necessary I won't mind deleting convertPlural function.
Created attachment 9047 [details] LanguageOs class ирон æвзаг(ossetian language) => Ирон (Ossetian) Changed convertPlural() as in Language.php
Created attachment 9048 [details] LanguageOs class Sorry for my bad PHP skills. Correcting some mistakes. Adding new case rule for words in plural form.
Created attachment 9067 [details] LanguageOs class Deleted convertPlural
Question to maintainers. Is there any other problems with the class? And have I solved problems you pointed out? This class is very important for translating MediaWiki. It is impossible to put {{SITENAME}} into right form with help of wiki mark up. Everything depends on the last two letters of the word. So it can be solved only with {{grammar:case|word}}.
Looks fine to me. Will handle on Monday.
Created attachment 9071 [details] LanguageOs class Style changes: "'" => "-".
Why is this twice?: if (preg_match('/тæ$/u', $word)) $word=mb_substr($word,0,-1); What does this do? Can you add a comment with example or something? elseif ( preg_match( "/[у]/u", $ll) ) { if ( !preg_match( "/[аæеёиоыэюя]/u", mb_substr( $word, -2, 1 )) ) Can you also do with out $ll variable? It is easy to match the end of string with pattern like /y$/. It also does not follow our coding conventions, but that is something I can fix when I commit.
Created attachment 9072 [details] LanguageOs class Per comment 15. Updated conversion to allative.
(In reply to comment #15) > Why is this twice?: > if (preg_match('/тæ$/u', $word)) $word=mb_substr($word,0,-1); > > What does this do? Can you add a comment with example or something? > elseif ( preg_match( "/[у]/u", $ll) ) { > if ( !preg_match( "/[аæеёиоыэюя]/u", mb_substr( $word, -2, 1 )) ) > > Can you also do with out $ll variable? It is easy to match the end of string > with pattern like /y$/. > > It also does not follow our coding conventions, but that is something I can fix > when I commit. Done. Letter 'у' can be either vowel or consonant. So it is important to specify it for putting 'й' between word and case ending. This is an example: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
Committed with style changes in r97515.