diff options
Diffstat (limited to 'languages/classes/LanguageLa.php')
-rw-r--r-- | languages/classes/LanguageLa.php | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/languages/classes/LanguageLa.php b/languages/classes/LanguageLa.php index b9f69925..0e34b5c5 100644 --- a/languages/classes/LanguageLa.php +++ b/languages/classes/LanguageLa.php @@ -1,8 +1,7 @@ <?php /** Latin (lingua Latina) * - * @package MediaWiki - * @subpackage Language + * @addtogroup Language */ class LanguageLa extends Language { @@ -12,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; @@ -22,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 + '/a$/', # 1st declension singular + '/ommuniam$/', # 3rd declension neuter plural (partly) + '/libri$/', '/nuntii$/', # 2nd declension plural (partly) + '/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly) + '/es$/' # 5th declension singular + ); + $out = array( 'um', + 'am', + 'ommunia', + '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; |