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