* And the rest needed for $wgGrammarForms support
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 25 May 2006 14:31:28 +0000 (14:31 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 25 May 2006 14:31:28 +0000 (14:31 +0000)
languages/LanguageBs.php
languages/LanguageCs.php
languages/LanguageFi.php
languages/LanguageGa.php
languages/LanguageLa.php
languages/LanguageRu.php
languages/LanguageSk.php
languages/LanguageSl.php
languages/LanguageTyv.php

index 5b318c5..10313f1 100644 (file)
@@ -183,6 +183,10 @@ class LanguageBs extends LanguageUtf8 {
        # 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' ) {
index 169a65b..9e36d39 100644 (file)
@@ -192,6 +192,10 @@ class LanguageCs extends LanguageUtf8 {
        # 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 ) {
index f0e4d9b..e183064 100644 (file)
@@ -193,6 +193,11 @@ class LanguageFi extends LanguageUtf8 {
        # 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 ) {
index 592a185..d25e8c2 100644 (file)
@@ -175,6 +175,11 @@ class LanguageGa extends LanguageUtf8 {
        # 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) {
index 289086d..b27a39c 100644 (file)
@@ -94,6 +94,11 @@ class LanguageLa extends LanguageUtf8 {
         * 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.
index 5ffad05..a37bdd4 100644 (file)
@@ -162,6 +162,11 @@ class LanguageRu extends LanguageUtf8 {
        # 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.
 
index 864c9e0..6cf472c 100644 (file)
@@ -177,6 +177,11 @@ class LanguageSk extends LanguageUtf8 {
        # 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' ) {
index f19e1b1..2adaac8 100644 (file)
@@ -100,6 +100,11 @@ class LanguageSl extends LanguageUtf8 {
        # 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' ) {
index 995066a..e6544d6 100644 (file)
@@ -99,6 +99,11 @@ class LanguageTyv extends LanguageUtf8 {
         * @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");