Follwup r75575, honour table prefixes. Bad Roan ;)
[mediawiki.git] / languages / classes / LanguageLa.php
blob81fc30cfd05b7824761cfcda3a7daac524d39eb7
1 <?php
3 /** Latin (lingua Latina)
5 * @ingroup Language
6 */
7 class LanguageLa extends Language {
8 /**
9 * Convert from the nominative form of a noun to some other case
11 * Just used in a couple places for sitenames; special-case as necessary.
12 * Rules are far from complete.
14 * Cases: genitive, accusative, ablative
16 function convertGrammar( $word, $case ) {
17 global $wgGrammarForms;
18 if ( isset( $wgGrammarForms['la'][$case][$word] ) ) {
19 return $wgGrammarForms['la'][$case][$word];
22 switch ( $case ) {
23 case 'genitive':
24 // only a few declensions, and even for those mostly the singular only
25 $in = array( '/u[ms]$/', # 2nd declension singular
26 '/ommunia$/', # 3rd declension neuter plural (partly)
27 '/a$/', # 1st declension singular
28 '/libri$/', '/nuntii$/', # 2nd declension plural (partly)
29 '/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
30 '/es$/' # 5th declension singular
32 $out = array( 'i',
33 'ommunium',
34 'ae',
35 'librorum', 'nuntiorum',
36 'tionis', 'ntis', 'atis',
37 'ei'
39 return preg_replace( $in, $out, $word );
40 case 'accusative':
41 // only a few declensions, and even for those mostly the singular only
42 $in = array( '/u[ms]$/', # 2nd declension singular
43 '/a$/', # 1st declension singular
44 '/ommuniam$/', # 3rd declension neuter plural (partly)
45 '/libri$/', '/nuntii$/', # 2nd declension plural (partly)
46 '/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
47 '/es$/' # 5th declension singular
49 $out = array( 'um',
50 'am',
51 'ommunia',
52 'libros', 'nuntios',
53 'tionem', 'ntem', 'atem',
54 'em'
56 return preg_replace( $in, $out, $word );
57 case 'ablative':
58 // only a few declensions, and even for those mostly the singular only
59 $in = array( '/u[ms]$/', # 2nd declension singular
60 '/ommunia$/', # 3rd declension neuter plural (partly)
61 '/a$/', # 1st declension singular
62 '/libri$/', '/nuntii$/', # 2nd declension plural (partly)
63 '/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
64 '/es$/' # 5th declension singular
66 $out = array( 'o',
67 'ommunibus',
68 'a',
69 'libris', 'nuntiis',
70 'tione', 'nte', 'ate',
71 'e'
73 return preg_replace( $in, $out, $word );
74 default:
75 return $word;