From 2d0ef13142cfba1025dda867f52cdefe8f8cfc52 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Wed, 21 Jun 2006 14:37:37 +0000 Subject: [PATCH] * (bug 6279) Add genitive month names to Slovenian localisation * Restructured --- RELEASE-NOTES | 1 + languages/LanguageSl.php | 129 +++++++++++++++++++++------------------ 2 files changed, 70 insertions(+), 60 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2073401121..defa2bb488 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/languages/LanguageSl.php b/languages/LanguageSl.php index d94efc6e01..1cffbde7ed 100644 --- a/languages/LanguageSl.php +++ b/languages/LanguageSl.php @@ -1,8 +1,10 @@ '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; -- 2.20.1