Merge "Link $wgVersion on Special:Version to Release Notes"
[mediawiki.git] / languages / classes / LanguageLv.php
blobe76f6f9374bd902d49909a2b0e7e89c5b6ce59e0
1 <?php
2 /**
3 * Latvian (Latviešu) specific code.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
20 * @file
21 * @author Niklas Laxström
22 * @copyright Copyright © 2006, Niklas Laxström
23 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
24 * @ingroup Language
27 /**
28 * Latvian (Latviešu)
30 * @ingroup Language
32 class LanguageLv extends Language {
33 /**
34 * Plural form transformations. Using the first form for words with the last digit 1, but not for words with the last digits 11, and the second form for all the others.
36 * Example: {{plural:{{NUMBEROFARTICLES}}|article|articles}}
38 * @param $count Integer
39 * @param $forms Array
40 * @return String
42 function convertPlural( $count, $forms ) {
43 if ( !count( $forms ) ) { return ''; }
45 // @todo FIXME: CLDR defines 3 plural forms instead of 2. Form for 0 is missing.
46 // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#lv
47 $forms = $this->preConvertPlural( $forms, 2 );
49 return ( ( $count % 10 == 1 ) && ( $count % 100 != 11 ) ) ? $forms[0] : $forms[1];