From 6834b5021c6987f2e209a211b4e13d653eb02975 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Wed, 7 Feb 2007 21:20:43 +0000 Subject: [PATCH] * (bug 8877) Update for Latin localization (la) --- RELEASE-NOTES | 1 + languages/classes/LanguageLa.php | 54 +++++++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4c8cd29fd3..4eab40f257 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -198,6 +198,7 @@ lighter making things easier to read. * Kazakh (kk) * Korean (ko) * Ripuarian (ksh) +* Latin (la) * Limburgish (li) * Lithuanian (lt) * Marathi (mr) diff --git a/languages/classes/LanguageLa.php b/languages/classes/LanguageLa.php index b8bf9a6e4b..82336ecd28 100644 --- a/languages/classes/LanguageLa.php +++ b/languages/classes/LanguageLa.php @@ -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; -- 2.20.1