Last modified: 2011-09-19 17:02:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32846, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30846 - New LanguageOs class
New LanguageOs class
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n, patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-10 12:07 UTC by Soslan Khubulov
Modified: 2011-09-19 17:02 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
LanguageOs class (1.93 KB, application/x-php)
2011-09-10 12:07 UTC, Soslan Khubulov
Details
LanguageOs class (1.93 KB, patch)
2011-09-10 12:58 UTC, Soslan Khubulov
Details
LanguageOs class (1.91 KB, patch)
2011-09-10 14:09 UTC, Soslan Khubulov
Details
LanguageOs class (1.95 KB, patch)
2011-09-10 14:45 UTC, Soslan Khubulov
Details
LanguageOs class (2.10 KB, patch)
2011-09-10 20:11 UTC, Soslan Khubulov
Details
LanguageOs class (1.72 KB, patch)
2011-09-17 12:20 UTC, Soslan Khubulov
Details
LanguageOs class (1.72 KB, patch)
2011-09-19 09:21 UTC, Soslan Khubulov
Details
LanguageOs class (2.76 KB, text/plain)
2011-09-19 14:03 UTC, Soslan Khubulov
Details

Description Soslan Khubulov 2011-09-10 12:07:19 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.
Comment 1 Max Semenik 2011-09-10 12:19:21 UTC
This file contains some errors, e.g. "genetive" instead of "genitive". Have you tested it?
Comment 2 Soslan Khubulov 2011-09-10 12:53:56 UTC
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.
Comment 3 Soslan Khubulov 2011-09-10 12:58:29 UTC
Created attachment 9045 [details]
LanguageOs class

Corrected. "genetive" => "genitive"
Comment 4 Daniel Friesen 2011-09-10 12:59:20 UTC
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.
Comment 5 Niklas Laxström 2011-09-10 14:08:53 UTC
Why is there convertPlural that re-implements the default implementation?
Comment 6 Soslan Khubulov 2011-09-10 14:09:33 UTC
Created attachment 9046 [details]
LanguageOs class

Corrected
Comment 7 Soslan Khubulov 2011-09-10 14:12:03 UTC
(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.
Comment 8 Soslan Khubulov 2011-09-10 14:40:11 UTC
(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.
Comment 9 Soslan Khubulov 2011-09-10 14:45:31 UTC
Created attachment 9047 [details]
LanguageOs class

ирон æвзаг(ossetian language) => Ирон (Ossetian)
Changed convertPlural() as in Language.php
Comment 10 Soslan Khubulov 2011-09-10 20:11:54 UTC
Created attachment 9048 [details]
LanguageOs class

Sorry for my bad PHP skills. Correcting some mistakes. Adding new case rule for words in plural form.
Comment 11 Soslan Khubulov 2011-09-17 12:20:54 UTC
Created attachment 9067 [details]
LanguageOs class

Deleted convertPlural
Comment 12 Soslan Khubulov 2011-09-17 12:29:56 UTC
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}}.
Comment 13 Niklas Laxström 2011-09-17 13:20:22 UTC
Looks fine to me. Will handle on Monday.
Comment 14 Soslan Khubulov 2011-09-19 09:21:29 UTC
Created attachment 9071 [details]
LanguageOs class

Style changes: "'" => "-".
Comment 15 Niklas Laxström 2011-09-19 11:59:08 UTC
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.
Comment 16 Soslan Khubulov 2011-09-19 14:03:54 UTC
Created attachment 9072 [details]
LanguageOs class

Per comment 15. Updated conversion to allative.
Comment 17 Soslan Khubulov 2011-09-19 14:14:19 UTC
(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|лæппу}} = лæппуйы.
Comment 18 Niklas Laxström 2011-09-19 17:02:07 UTC
Committed with style changes in r97515.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links