* And the rest needed for $wgGrammarForms support
[mediawiki.git] / languages / LanguageLa.php
blobb27a39c3f86a8fe7834542e9f09e0af40f753cf0
1 <?php
2 /** Latin (lingua Latina)
4 * @package MediaWiki
5 * @subpackage Language
6 */
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;
28 /* private */ $wgQuickbarSettingsLa = array(
29 "Nullus", "Constituere a sinistra", "Constituere a dextra", "Innens a sinistra"
32 /* private */ $wgSkinNamesLa = array(
33 'standard' => 'Norma',
34 'nostalgia' => 'Nostalgia',
35 'cologneblue' => 'Caerulus Colonia'
36 ) + $wgSkinNamesEn;
38 if (!$wgCachedMessageArrays) {
39 require_once('MessagesLa.php');
42 require_once( "LanguageUtf8.php" );
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' );
52 function getNamespaces() {
53 global $wgNamespaceNamesLa;
54 return $wgNamespaceNamesLa;
57 function getNsIndex( $text ) {
58 global $wgNamespaceNamesLa;
59 global $wgMetaNamespace;
61 foreach ( $wgNamespaceNamesLa as $i => $n ) {
62 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
65 # Backwards compatibility hacks
66 if( $wgMetaNamespace == 'Vicipaedia' || $wgMetaNamespace == 'Victionarium' ) {
67 if( 0 == strcasecmp( 'Disputatio_Wikipedia', $text ) ) return NS_PROJECT_TALK;
69 return false;
72 function getQuickbarSettings() {
73 global $wgQuickbarSettingsLa;
74 return $wgQuickbarSettingsLa;
77 function getSkinNames() {
78 global $wgSkinNamesLa;
79 return $wgSkinNamesLa;
82 function getMessage( $key ) {
83 global $wgAllMessagesLa;
84 if( isset( $wgAllMessagesLa[$key] ) ) {
85 return $wgAllMessagesLa[$key];
87 return parent::getMessage( $key );
90 /**
91 * Convert from the nominative form of a noun to some other case
93 * Just used in a couple places for sitenames; special-case as necessary.
94 * Rules are far from complete.
96 function convertGrammar( $word, $case ) {
97 global $wgGrammarForms;
98 if ( isset($wgGrammarForms[$case][$word]) ) {
99 return $wgGrammarForms[$case][$word];
102 switch ( $case ) {
103 case 'genitive':
104 // 1st and 2nd declension singular only.
105 $in = array( '/a$/', '/u[ms]$/', '/tio$/' );
106 $out = array( 'ae', 'i', 'tionis' );
107 return preg_replace( $in, $out, $word );
108 default:
109 return $word;