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