Added German translation for new messages (de)
[lhc/web/wiklou.git] / languages / LanguageLa.php
1 <?php
2 /** Latin (lingua Latina)
3 *
4 * @package MediaWiki
5 * @subpackage Language
6 */
7
8 if (!$wgCachedMessageArrays) {
9 require_once('MessagesLa.php');
10 }
11
12 class LanguageLa extends LanguageUtf8 {
13 private $mMessagesLa, $mNamespaceNamesLa = null;
14
15 private $mQuickbarSettingsLa = array(
16 'Nullus', 'Constituere a sinistra', 'Constituere a dextra', 'Innens a sinistra'
17 );
18
19 private $mSkinNamesLa = array(
20 'standard' => 'Norma',
21 'nostalgia' => 'Nostalgia',
22 'cologneblue' => 'Caerulus Colonia'
23 );
24
25 function __construct() {
26 parent::__construct();
27
28 global $wgAllMessagesLa;
29 $this->mMessagesLa =& $wgAllMessagesLa;
30
31 global $wgMetaNamespace;
32 $this->mNamespaceNamesLa = array(
33 NS_SPECIAL => 'Specialis',
34 NS_MAIN => '',
35 NS_TALK => 'Disputatio',
36 NS_USER => 'Usor',
37 NS_USER_TALK => 'Disputatio_Usoris',
38 NS_PROJECT => $wgMetaNamespace,
39 NS_PROJECT_TALK => 'Disputatio_' . $this->convertGrammar( $wgMetaNamespace, 'genitive' ),
40 NS_IMAGE => 'Imago',
41 NS_IMAGE_TALK => 'Disputatio_Imaginis',
42 NS_MEDIAWIKI => 'MediaWiki',
43 NS_MEDIAWIKI_TALK => 'Disputatio_MediaWiki',
44 NS_TEMPLATE => 'Formula',
45 NS_TEMPLATE_TALK => 'Disputatio_Formulae',
46 NS_HELP => 'Auxilium',
47 NS_HELP_TALK => 'Disputatio_Auxilii',
48 NS_CATEGORY => 'Categoria',
49 NS_CATEGORY_TALK => 'Disputatio_Categoriae',
50 );
51
52 }
53
54 function getNamespaces() {
55 return $this->mNamespaceNamesLa + parent::getNamespaces();
56 }
57
58 function getQuickbarSettings() {
59 return $this->mQuickbarSettingsLa;
60 }
61
62 function getSkinNames() {
63 return $this->mSkinNamesLa + parent::getSkinNames();
64 }
65
66 function getMessage( $key ) {
67 if( isset( $this->mMessagesLa[$key] ) ) {
68 return $this->mMessagesLa[$key];
69 } else {
70 return parent::getMessage( $key );
71 }
72 }
73
74 function getAllMessages() {
75 return $this->mMessagesLa;
76 }
77
78 function getNsIndex( $text ) {
79 global $wgMetaNamespace;
80
81 foreach ( $this->mNamespaceNamesLa as $i => $n ) {
82 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
83 }
84
85 # Backwards compatibility hacks
86 if( $wgMetaNamespace == 'Vicipaedia' || $wgMetaNamespace == 'Victionarium' ) {
87 if( 0 == strcasecmp( 'Disputatio_Wikipedia', $text ) ) return NS_PROJECT_TALK;
88 }
89 return false;
90 }
91
92 /**
93 * Convert from the nominative form of a noun to some other case
94 *
95 * Just used in a couple places for sitenames; special-case as necessary.
96 * Rules are far from complete.
97 *
98 * Cases: genitive
99 */
100 function convertGrammar( $word, $case ) {
101 global $wgGrammarForms;
102 if ( isset($wgGrammarForms['la'][$case][$word]) ) {
103 return $wgGrammarForms['la'][$case][$word];
104 }
105
106 switch ( $case ) {
107 case 'genitive':
108 // 1st and 2nd declension singular only.
109 $in = array( '/a$/', '/u[ms]$/', '/tio$/' );
110 $out = array( 'ae', 'i', 'tionis' );
111 return preg_replace( $in, $out, $word );
112 default:
113 return $word;
114 }
115 }
116
117 }
118
119
120 ?>