3 /** Karakalpak (Qaraqalpaqsha)
7 class LanguageKaa
extends Language
{
9 # Convert from the nominative form of a noun to some other case
10 # Invoked with {{GRAMMAR:case|word}}
12 * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
14 function convertGrammar( $word, $case ) {
15 global $wgGrammarForms;
16 if ( isset( $wgGrammarForms['kaa'][$case][$word] ) ) {
17 return $wgGrammarForms['kaa'][$case][$word];
19 /* Full code of function convertGrammar() is in development. Updates coming soon. */
24 * It fixes issue with ucfirst for transforming 'i' to 'İ'
28 function ucfirst ( $string ) {
29 if ( substr( $string, 0, 1 ) === 'i' ) {
30 return 'İ' . substr( $string, 1 );
32 return parent
::ucfirst( $string );
37 * It fixes issue with lcfirst for transforming 'I' to 'ı'
39 function lcfirst ( $string ) {
40 if ( substr( $string, 0, 1 ) === 'I' ) {
41 return 'ı' . substr( $string, 1 );
43 return parent
::lcfirst( $string );
48 * Avoid grouping whole numbers between 0 to 9999
50 function commafy( $_ ) {
51 if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
52 return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );