* (bug 6279) Add genitive month names to Slovenian localisation
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 21 Jun 2006 14:37:37 +0000 (14:37 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 21 Jun 2006 14:37:37 +0000 (14:37 +0000)
* Restructured

RELEASE-NOTES
languages/LanguageSl.php

index 2073401..defa2bb 100644 (file)
@@ -528,6 +528,7 @@ Some default configuration options have changed:
 * (bug 6365) Show user information in the "old revision" navigation links
 * Introduce 'FetchChangesList' hook; see docs/hooks.txt for more information
 * (bug 6345) Update to Indonesian localisation (id) #22
+* (bug 6279) Add genitive month names to Slovenian localisation
 
 == Compatibility ==
 
index d94efc6..1cffbde 100644 (file)
@@ -1,8 +1,10 @@
 <?php
-/**
-  * @package MediaWiki
-  * @subpackage Language
-  */
+/** Slovenian (Slovenščina)
+ *
+ * @package MediaWiki
+ * @subpackage Language
+ *
+ */
 
 #
 # Revision/
 #         1.00.32 romanm        2003-11-19 |    merged incorrectly broken lines
 #         1.00.40 romanm        2003-11-21 |    fixed Google search
 
-#         1.00.50 Nikerabbit    2005-08-15 |    removed old stuff, some cleanup, NOT COMPLETE!
-
-
-require_once( "LanguageUtf8.php" );
-
-/* private */ $wgNamespaceNamesSl = array(
-       NS_MEDIA          => 'Media',
-       NS_SPECIAL        => 'Posebno',
-       NS_MAIN           => '',
-       NS_TALK           => 'Pogovor',
-       NS_USER           => 'Uporabnik',
-       NS_USER_TALK      => 'Uporabniški_pogovor',
-       NS_PROJECT        => $wgMetaNamespace,
-       NS_PROJECT_TALK   => FALSE,  # Set in constructor
-       NS_IMAGE          => 'Slika',
-       NS_IMAGE_TALK     => 'Pogovor_o_sliki',
-       NS_MEDIAWIKI      => 'MediaWiki',
-       NS_MEDIAWIKI_TALK => 'Pogovor_o_MediaWiki',
-       NS_TEMPLATE       => 'Predloga',
-       NS_TEMPLATE_TALK  => 'Pogovor_o_predlogi',
-       NS_HELP           => 'Pomoč',
-       NS_HELP_TALK      => 'Pogovor_o_pomoči',
-       NS_CATEGORY       => 'Kategorija',
-       NS_CATEGORY_TALK  => 'Pogovor_o_kategoriji'
-) + $wgNamespaceNamesEn;
-
-/* private */ $wgQuickbarSettingsSl = array(
-       "Brez", "Levo nepomično", "Desno nepomično", "Levo leteče"
-);
-
-/* private */ $wgDateFormatsSl = array(
-#        'No preference',
-);
+
+require_once( 'LanguageUtf8.php' );
 
 if (!$wgCachedMessageArrays) {
        require_once('MessagesSl.php');
 }
 
-#--------------------------------------------------------------------------
-# Internationalisation code
-#--------------------------------------------------------------------------
-
 class LanguageSl extends LanguageUtf8 {
-       function LanguageSl() {
-               global $wgNamespaceNamesSl, $wgMetaNamespace;
-               LanguageUtf8::LanguageUtf8();
-               $wgNamespaceNamesSl[NS_PROJECT_TALK] = 'Pogovor_' .
-                       str_replace( ' ', '_', $this->convertGrammar( $wgMetaNamespace, 'mestnik' ) );
+       private $mMessagesSl, $mNamespaceNamesSl = null;
+
+       private $mQuickbarSettingsSl = array(
+               'Brez', 'Levo nepomično', 'Desno nepomično', 'Levo leteče'
+       );
+
+       private $mMonthNameGenSl = array(
+               'januarja', 'februarja', 'marca', 'aprila', 'maja', 'junija',
+               'julija', 'avgusta', 'septembra', 'oktobra', 'novembra', 'decembra'
+       );
+
+       function __construct() {
+               parent::__construct();
+
+               global $wgAllMessagesSl;
+               $this->mMessagesSl =& $wgAllMessagesSl;
+
+               global $wgMetaNamespace;
+               $this->mNamespaceNamesSl = array(
+                       NS_MEDIA          => 'Media',
+                       NS_SPECIAL        => 'Posebno',
+                       NS_MAIN           => '',
+                       NS_TALK           => 'Pogovor',
+                       NS_USER           => 'Uporabnik',
+                       NS_USER_TALK      => 'Uporabniški_pogovor',
+                       NS_PROJECT        => $wgMetaNamespace,
+                       NS_PROJECT_TALK   => 'Pogovor_' .
+                       str_replace( ' ', '_', $this->convertGrammar( $wgMetaNamespace, 'mestnik' ) ),
+                       NS_IMAGE          => 'Slika',
+                       NS_IMAGE_TALK     => 'Pogovor_o_sliki',
+                       NS_MEDIAWIKI      => 'MediaWiki',
+                       NS_MEDIAWIKI_TALK => 'Pogovor_o_MediaWiki',
+                       NS_TEMPLATE       => 'Predloga',
+                       NS_TEMPLATE_TALK  => 'Pogovor_o_predlogi',
+                       NS_HELP           => 'Pomoč',
+                       NS_HELP_TALK      => 'Pogovor_o_pomoči',
+                       NS_CATEGORY       => 'Kategorija',
+                       NS_CATEGORY_TALK  => 'Pogovor_o_kategoriji'
+               );
+
        }
 
        function getNamespaces() {
-               global $wgNamespaceNamesSl;
-               return $wgNamespaceNamesSl;
+               return $this->mNamespaceNamesSl + parent::getNamespaces();
        }
 
        function getQuickbarSettings() {
-               global $wgQuickbarSettingsSl;
-               return $wgQuickbarSettingsSl;
+               return $this->mQuickbarSettingsSl;
        }
 
        function getDateFormats() {
-               global $wgDateFormatsSl;
-               return $wgDateFormatsSl;
+               return false;
        }
 
        function getMessage( $key ) {
-               global $wgAllMessagesSl;
-               if(array_key_exists($key, $wgAllMessagesSl))
-                       return $wgAllMessagesSl[$key];
-               else
-                       return parent::getMessage($key);
+               if( isset( $this->mMessagesSl[$key] ) ) {
+                       return $this->mMessagesSl[$key];
+               } else {
+                       return parent::getMessage( $key );
+               }
+       }
+
+       function getAllMessages() {
+               return $this->mMessagesSl;
        }
 
+
        function fallback8bitEncoding() {
                return "iso-8859-2";
        }
@@ -96,6 +100,11 @@ class LanguageSl extends LanguageUtf8 {
                return array(',' => '.', '.' => ',' );
        }
 
+       function getMonthNameGen( $key ) {
+               return $this->mMonthNameGenSl[$key-1];
+       }
+
+
        # Convert from the nominative form of a noun to some other case
        # Invoked with {{GRAMMAR:case|word}}
        /**
@@ -195,11 +204,11 @@ class LanguageSl extends LanguageUtf8 {
        function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) {
                $count = str_replace ('.', '', $count);
                $forms = array( $w1, $w2, $w3, $w4, $w5 );
-               if ( $count % 100 === 1 ) {
+               if ( $count % 100 == 1 ) {
                        $index = 0;
-               } elseif ( $count % 100 === 2 ) {
+               } elseif ( $count % 100 == 2 ) {
                        $index = 1;
-               } elseif ( $count%100==3 || $count%100==4 ) {
+               } elseif ( $count % 100 == 3 || $count % 100 == 4 ) {
                        $index = 2;
                } elseif ( $count != 0 ) {
                        $index = 3;