[Mediawiki-l] PLural Transformation for Upper Sorbian

Michael Wolf milupo at sorbzilla.de
Sun Aug 6 23:33:14 UTC 2006


Rotem Liss napisa:
> If I understood the question, adding the function
> LanguageHsb::convertPlural will do. I think this code should work:
> 
>     /**
>      * Gets a number and uses the suited form of the word.
>      *
>      * @param integer the number of items
>      * @param string the first form (singular)
>      * @param string the second form (genetive plural ? 0 and from 5)
>      * @param string the third form (dual ? 2)
>      * @param string the fourth form (nominative plural ? 3 and 4)
>      *
>      * @return string of the suited form of word
>      */
>     public function convertPlural( $count, $w1, $w2, $w3, $w4 ) {
>         if ( $count == '1' ) {
>             return $w1;
>         } elseif ( $count == '2' ) {
>             return $w3;
>         } elseif ( $count == '3' || $count == '4' ) {
>             return $w4;
>         } else {
>             return $w2;
>         }
>     }
> 
> It will make it possible to specify four forms in {{plural:}}: first is
> singular, second is genetive plural, third is dual, fourth is nominative
> plural. You can add this code to the file.


Hi Rotem,

thank you for your reply and your help.

Your function unfortunately doesn't work. I have a similar one, only the 
key word "public" I didn't use. And the order is an other one - sg, 
dual, nom. pl., gen. pl.
But the issue remains. The function doesn't work correctly. The default 
plural is used for all numerals. No differentiation.

For testing I used the special page Statistics. There are some numerals 
and at the moment there should be all possible variants: singular, dual, 
nom. pl and gen. pl.

I uploaded 2 screenshots:
- sorbplural.png, http://www.sorbzilla.de/hsbwiki/sorbplural.png, which 
shows the browser display and
- messagehsb.gif, http://www.sorbzilla.de/hsbwiki/messagehsb.gif, which 
shows the corresponding text from the messagesHsb.php. The text belongs 
to entity 'sitestatstext'.

As follows I explain the text of those images:

According to your proposal $w2 is gen.pl and used as default. And you 
will instantly recognize the gen.pl. All the words ending in "-ow" are 
in gen.pl. In the most cases that's correct:

C o r r e c t: 1406 stronow, 0 datajow, 62 wopytow, 0,00 wobddźělanjow, 
20,67 wopytow

rynka nadawkow is a normal genitive plural, independent of any numeral.

W r o n g:
- 1 stronow, must be sg., 1 strona;
- kotrež je...woprawdźitych nastawkow, should be kotraž je...woprawdźity 
nastawk;
- 3 wobdźělanjow, must be nom. pl. 3 wobdźělanja;
- 2 zregistrowanych wužiwarjow, must be dual 2 zregistrowanaj wužiwarjej;
- z toho 1 ... administratorow, must be 1 administrator;

This list looks only like this if gen. pl is default. But for numerals 
1, 2, 3, 4 should be used the mentioned other number forms.


> Also, please look at the new structure of the language files.

My languageHsb.php is based on English Language.php of Mediawiki 1.7.0.
Should be any additional preference int LocalSettings.php that is necessary?

Kind regards
Michael Wolf









More information about the MediaWiki-l mailing list