* (bug 8877) Update for Latin localization (la)
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 7 Feb 2007 21:20:43 +0000 (21:20 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 7 Feb 2007 21:20:43 +0000 (21:20 +0000)
RELEASE-NOTES
languages/classes/LanguageLa.php

index 4c8cd29..4eab40f 100644 (file)
@@ -198,6 +198,7 @@ lighter making things easier to read.
 * Kazakh (kk)
 * Korean (ko)
 * Ripuarian (ksh)
+* Latin (la)
 * Limburgish (li)
 * Lithuanian (lt)
 * Marathi (mr)
index b8bf9a6..82336ec 100644 (file)
@@ -11,7 +11,7 @@ class LanguageLa extends Language {
         * Just used in a couple places for sitenames; special-case as necessary.
         * Rules are far from complete.
         *
-        * Cases: genitive
+        * Cases: genitive, accusative, ablative
         */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
@@ -21,9 +21,55 @@ class LanguageLa extends Language {
 
                switch ( $case ) {
                case 'genitive':
-                       // 1st and 2nd declension singular only.
-                       $in  = array( '/a$/', '/u[ms]$/', '/tio$/' );
-                       $out = array( 'ae',   'i',        'tionis' );
+                       // only a few declensions, and even for those mostly the singular only
+                       $in  = array(   '/u[ms]$/',                     # 2nd declension singular
+                                       '/ommunia$/',                   # 3rd declension neuter plural (partly)
+                                       '/a$/',                         # 1st declension singular
+                                       '/libri$/', '/nuntii$/',        # 2nd declension plural (partly)
+                                       '/tio$/', '/ns$/', '/as$/',     # 3rd declension singular (partly)
+                                       '/es$/'                         # 5th declension singular
+                                       );
+                       $out = array(   'i',
+                                       'ommunium',
+                                       'ae',
+                                       'librorum', 'nuntiorum',
+                                       'tionis', 'ntis', 'atis',
+                                       'ei'
+                                       );
+                       return preg_replace( $in, $out, $word );
+               case 'accusative':
+                       // only a few declensions, and even for those mostly the singular only
+                       $in  = array(   '/u[ms]$/',                     # 2nd declension singular
+                                       '/ommunia$/',                   # 3rd declension neuter plural (partly)
+                                       '/a$/',                         # 1st declension singular
+                                       '/libri$/', '/nuntii$/',        # 2nd declension plural (partly)
+                                       '/tio$/', '/ns$/', '/as$/',     # 3rd declension singular (partly)
+                                       '/es$/'                         # 5th declension singular
+                                       );
+                       $out = array(   'um',
+                                       'ommunia',
+                                       'am',
+                                       'libros', 'nuntios',
+                                       'tionem', 'ntem', 'atem',
+                                       'em'
+                                       );
+                       return preg_replace( $in, $out, $word );
+               case 'ablative':
+                       // only a few declensions, and even for those mostly the singular only
+                       $in  = array(   '/u[ms]$/',                     # 2nd declension singular
+                                       '/ommunia$/',                   # 3rd declension neuter plural (partly)
+                                       '/a$/',                         # 1st declension singular
+                                       '/libri$/', '/nuntii$/',        # 2nd declension plural (partly)
+                                       '/tio$/', '/ns$/', '/as$/',     # 3rd declension singular (partly)
+                                       '/es$/'                         # 5th declension singular
+                                       );
+                       $out = array(   'o',
+                                       'ommunibus',
+                                       'a',
+                                       'libris', 'nuntiis',
+                                       'tione', 'nte', 'ate',
+                                       'e'
+                                       );
                        return preg_replace( $in, $out, $word );
                default:
                        return $word;