From: Niklas Laxström Date: Wed, 7 Feb 2007 21:20:43 +0000 (+0000) Subject: * (bug 8877) Update for Latin localization (la) X-Git-Tag: 1.31.0-rc.0~54098 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=6834b5021c6987f2e209a211b4e13d653eb02975;p=lhc%2Fweb%2Fwiklou.git * (bug 8877) Update for Latin localization (la) --- 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;