# Convert from the nominative form of a noun to some other case
# Invoked with {{GRAMMAR:case|word}}
function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
switch ( $case ) {
case 'genitiv': # genitive
if ( $word == 'Wikipedia' ) {
# Grammatical transformations, needed for inflected languages
# Invoked by putting {{grammar:case|word}} in a message
function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
# allowed values for $case:
# 1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular)
switch ( $word ) {
# Convert from the nominative form of a noun to some other case
# Invoked with {{GRAMMAR:case|word}}
function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
+
# These rules are not perfect, but they are currently only used for site names so it doesn't
# matter if they are wrong sometimes. Just add a special case for your site name if necessary.
switch ( $case ) {
# Convert day names
# Invoked with {{GRAMMAR:transformation|word}}
function convertGrammar( $word, $what ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
+
switch ( $what ) {
case 'genitive':
switch ($word) {
* Rules are far from complete.
*/
function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
+
switch ( $case ) {
case 'genitive':
// 1st and 2nd declension singular only.
# Convert from the nominative form of a noun to some other case
# Invoked with {{grammar:case|word}}
function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
+
# These rules are not perfect, but they are currently only used for site names so it doesn't
# matter if they are wrong sometimes. Just add a special case for your site name if necessary.
# Convert from the nominative form of a noun to some other case
# Invoked with {{GRAMMAR:case|word}}
function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
+
switch ( $case ) {
case 'genitív':
if ( $word == 'Wikipédia' ) {
# Convert from the nominative form of a noun to some other case
# Invoked with {{GRAMMAR:case|word}}
function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
+
switch ( $case ) {
case 'rodilnik': # genitive
if ( $word == 'Wikipedija' ) {
* @return string
*/
function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset($wgGrammarForms[$case][$word]) ) {
+ return $wgGrammarForms[$case][$word];
+ }
+
// Set up some constants...
$allVowels = array("е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y");