- # Grammatical transformations, needed for inflected languages
- # Invoked by putting {{grammar:case|word}} in a message
- function convertGrammar( $word, $case ) {
- global $wgGrammarForms;
- if ( isset($wgGrammarForms['cs'][$case][$word]) ) {
- return $wgGrammarForms['cs'][$case][$word];
- }
- # allowed values for $case:
- # 1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular)
- switch ( $word ) {
- case 'Wikipedia':
- case 'Wikipedie':
- switch ( $case ) {
- case '3sg':
- case '4sg':
- case '6sg':
- return 'Wikipedii';
- case '7sg':
- return 'Wikipedií';
- default:
- return 'Wikipedie';
- }
-
- case 'Wiktionary':
- case 'Wikcionář':
- switch ( $case ) {
- case '2sg':
- return 'Wikcionáře';
- case '3sg':
- case '5sg';
- case '6sg';
- return 'Wikcionáři';
- case '7sg':
- return 'Wikcionářem';
- default:
- return 'Wikcionář';
- }