* Adding LanguageKaa
[lhc/web/wiklou.git] / languages / classes / LanguageKaa.php
1 <?php
2 /** Karakalpak (Qaraqalpaqsha)
3 *
4 *
5 * @addtogroup Language
6 */
7
8 class LanguageKaa extends Language {
9
10 # Convert from the nominative form of a noun to some other case
11 # Invoked with {{GRAMMAR:case|word}}
12 /**
13 * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
14 */
15 function convertGrammar( $word, $case ) {
16 global $wgGrammarForms;
17 if ( isset( $wgGrammarForms['kaa'][$case][$word] ) ) {
18 return $wgGrammarForms['kaa'][$case][$word];
19 }
20 /* Full code of function convertGrammar() is in development. Updates coming soon. */
21 return $word;
22 }
23
24 function ucfirst ( $string ) {
25 if ( $string[0] == 'i' ) {
26 return 'İ' . substr( $string, 1 );
27 } else {
28 return parent::ucfirst( $string );
29 }
30 }
31
32 /**
33 * Avoid grouping whole numbers between 0 to 9999
34 */
35 function commafy( $_ ) {
36 if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
37 return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) );
38 } else {
39 return $_;
40 }
41 }
42
43 }