* (bug 11072) Fix regression in API image history query
[lhc/web/wiklou.git] / languages / classes / LanguageBe.php
1 <?php
2 /** Belarusian normative (Беларуская мова)
3 *
4 * This is still the version from Be-x-old, only duplicated for consistency of
5 * plural and grammar functions. If there are errors please send a patch.
6 *
7 * @addtogroup Language
8 *
9 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
10 * @bug 1638, 2135
11 * @link http://be.wikipedia.org/wiki/Talk:LanguageBe.php
12 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
13 * @license http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License
14 */
15
16 class LanguageBe extends Language {
17 function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
18 $count = str_replace ('.', '', $count);
19 if ($count > 10 && floor(($count % 100) / 10) == 1) {
20 return $wordform3;
21 } else {
22 switch ($count % 10) {
23 case 1: return $wordform1;
24 case 2:
25 case 3:
26 case 4: return $wordform2;
27 default: return $wordform3;
28 }
29 }
30 }
31
32 # Convert from the nominative form of a noun to some other case
33 # Invoked with {{GRAMMAR:case|word}}
34 /**
35 * Cases: родны, вінавальны, месны
36 */
37 function convertGrammar( $word, $case ) {
38 switch ( $case ) {
39 case 'родны': # genitive
40 if ( $word == 'Вікіпэдыя' ) {
41 $word = 'Вікіпэдыі';
42 } elseif ( $word == 'ВікіСлоўнік' ) {
43 $word = 'ВікіСлоўніка';
44 } elseif ( $word == 'ВікіКнігі' ) {
45 $word = 'ВікіКніг';
46 } elseif ( $word == 'ВікіКрыніца' ) {
47 $word = 'ВікіКрыніцы';
48 } elseif ( $word == 'ВікіНавіны' ) {
49 $word = 'ВікіНавін';
50 } elseif ( $word == 'ВікіВіды' ) {
51 $word = 'ВікіВідаў';
52 }
53 break;
54 case 'вінавальны': # akusative
55 if ( $word == 'Вікіпэдыя' ) {
56 $word = 'Вікіпэдыю';
57 } elseif ( $word == 'ВікіСлоўнік' ) {
58 $word = 'ВікіСлоўнік';
59 } elseif ( $word == 'ВікіКнігі' ) {
60 $word = 'ВікіКнігі';
61 } elseif ( $word == 'ВікіКрыніца' ) {
62 $word = 'ВікіКрыніцу';
63 } elseif ( $word == 'ВікіНавіны' ) {
64 $word = 'ВікіНавіны';
65 } elseif ( $word == 'ВікіВіды' ) {
66 $word = 'ВікіВіды';
67 }
68 break;
69 case 'месны': # prepositional
70 if ( $word == 'Вікіпэдыя' ) {
71 $word = 'Вікіпэдыі';
72 } elseif ( $word == 'ВікіСлоўнік' ) {
73 $word = 'ВікіСлоўніку';
74 } elseif ( $word == 'ВікіКнігі' ) {
75 $word = 'ВікіКнігах';
76 } elseif ( $word == 'ВікіКрыніца' ) {
77 $word = 'ВікіКрыніцы';
78 } elseif ( $word == 'ВікіНавіны' ) {
79 $word = 'ВікіНавінах';
80 } elseif ( $word == 'ВікіВіды' ) {
81 $word = 'ВікіВідах';
82 }
83 break;
84 }
85
86 return $word; # this will return the original value for 'назоўны' (nominative) and all undefined case values
87 }
88
89 }
90
91