r14467 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14466‎ | r14467 | r14468 >
Date:21:56, 29 May 2006
Author:brion
Status:old
Tags:
Comment:
Revert to r13936; r14440 version was completely broken.
Modified paths:
  • /trunk/phase3/languages/LanguageSq.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageSq.php
@@ -1,108 +1,109 @@
22 <?php
3 -/** Albanian (Shqip)
4 - *
5 - * @package MediaWiki
6 - * @subpackage Language
7 - */
 3+/**
 4+ * @package MediaWiki
 5+ * @subpackage Language
 6+ */
87
9 -require_once( "LanguageUtf8.php" );
 8+require_once("LanguageUtf8.php");
109
11 -if (!$wgCachedMessageArrays) {
12 - require_once('MessagesSq.php');
13 -}
 10+/* private */ $wgNamespaceNamesSq = array(
 11+ NS_MEDIA => "Media",
 12+ NS_SPECIAL => "Speciale",
 13+ NS_MAIN => "",
 14+ NS_TALK => "Diskutim",
 15+ NS_USER => "Përdoruesi",
 16+ NS_USER_TALK => "Përdoruesi_diskutim",
 17+ NS_PROJECT => $wgMetaNamespace,
 18+ NS_PROJECT_TALK => $wgMetaNamespace . "_diskutim",
 19+ NS_IMAGE => "Figura",
 20+ NS_IMAGE_TALK => "Figura_diskutim",
 21+ NS_MEDIAWIKI => "MediaWiki",
 22+ NS_MEDIAWIKI_TALK => "MediaWiki_diskutim",
 23+ NS_TEMPLATE => "Stampa",
 24+ NS_TEMPLATE_TALK => "Stampa_diskutim",
 25+ NS_HELP => 'Ndihmë',
 26+ NS_HELP_TALK => 'Ndihmë_diskutim'
 27+) + $wgNamespaceNamesEn;
1428
15 -class LanguageSq extends LanguageUtf8 {
16 - private $mMessagesSq, $mNamespaceNamesSq = null;
 29+/* private */ $wgQuickbarSettingsSq = array(
 30+ "Asgjë", "Lidhur majtas", "Lidhur djathtas", "Fluturo majtas"
 31+);
1732
18 - private $mQuickbarSettingsSq = array(
19 - 'Asnjë', 'Lidhur majtas', 'Lidhur djathtas', 'Pezull majtas', 'Pezull djathtas'
20 - );
21 -
22 - private $mSkinNamesSq = array(
23 - 'standard' => "Standarte",
24 - 'nostalgia' => "Nostalgjike",
25 - 'cologneblue' => "Kolonjë Blu"
26 - );
 33+/* private */ $wgSkinNamesSq = array(
 34+ 'standard' => "Standarte",
 35+ 'nostalgia' => "Nostalgjike",
 36+ 'cologneblue' => "Kolonjë Blu"
 37+) + $wgSkinNamesEn;
2738
28 - private $mDateFormatsSq = array(
29 - MW_DATE_DEFAULT => 'No preference',
30 - MW_DATE_DMY => '16:12, 15 January 2001',
31 - MW_DATE_ISO => '2001-01-15 16:12:34'
32 - );
3339
34 - function LanguageSq() {
35 - LanguageUtf8::LanguageUtf8();
 40+/* private */ $wgDateFormatsSq = array(
 41+# "Pa preferencë",
 42+);
3643
37 - global $wgAllMessagesSq;
38 - $this->mMessagesSq =& $wgAllMessagesSq;
 44+if (!$wgCachedMessageArrays) {
 45+ require_once('MessagesSq.php');
 46+}
3947
40 - global $wgMetaNamespace;
41 - $this->mNamespaceNamesSq = array(
42 - NS_MEDIA => "Media",
43 - NS_SPECIAL => "Speciale",
44 - NS_MAIN => "",
45 - NS_TALK => "Diskutim",
46 - NS_USER => "Përdoruesi",
47 - NS_USER_TALK => "Përdoruesi_diskutim",
48 - NS_PROJECT => $wgMetaNamespace,
49 - NS_PROJECT_TALK => $wgMetaNamespace . "_diskutim",
50 - NS_IMAGE => "Figura",
51 - NS_IMAGE_TALK => "Figura_diskutim",
52 - NS_MEDIAWIKI => "MediaWiki",
53 - NS_MEDIAWIKI_TALK => "MediaWiki_diskutim",
54 - NS_TEMPLATE => "Stampa",
55 - NS_TEMPLATE_TALK => "Stampa_diskutim",
56 - NS_HELP => 'Ndihmë',
57 - NS_HELP_TALK => 'Ndihmë_diskutim'
58 - );
59 - }
 48+class LanguageSq extends LanguageUtf8 {
6049
6150 function getNamespaces() {
62 - return $this->mNamespaceNamesSq + parent::getNamespaces();
 51+ global $wgNamespaceNamesSq;
 52+ return $wgNamespaceNamesSq;
6353 }
6454
 55+ function getNsIndex( $text ) {
 56+ global $wgNamespaceNamesSq;
 57+ foreach ( $wgNamespaceNamesSq as $i => $n ) {
 58+ if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
 59+ }
 60+ # Compatbility with alt names:
 61+ if( 0 == strcasecmp( "Perdoruesi", $text ) ) return 2;
 62+ if( 0 == strcasecmp( "Perdoruesi_diskutim", $text ) ) return 3;
 63+ return false;
 64+ }
 65+
6566 function getQuickbarSettings() {
66 - return $this->mQuickbarSettingsSq;
 67+ global $wgQuickbarSettingsSq;
 68+ return $wgQuickbarSettingsSq;
6769 }
6870
6971 function getSkinNames() {
70 - return $this->mSkinNamesSq + parent::getSkinNames();
 72+ global $wgSkinNamesSq;
 73+ return $wgSkinNamesSq;
7174 }
7275
7376 function getDateFormats() {
74 - return $this->mDateFormatsSq;
 77+ global $wgDateFormatsSq;
 78+ return $wgDateFormatsSq;
7579 }
7680
77 - function getMessage( $key ) {
78 - if( isset( $this->mMessagesSq[$key] ) ) {
79 - return $this->mMessagesSq[$key];
80 - } else {
81 - return parent::getMessage( $key );
82 - }
83 - }
 81+ # localised date and time
 82+ function date( $ts, $adj = false ) {
 83+ if ( $adj ) { $ts = $this->userAdjust( $ts ); }
8484
85 - function getAllMessages() {
86 - return $this->mMessagesSq;
 85+ $d = substr( $ts, 0, 4 ) . " " .
 86+ $this->getMonthName( substr( $ts, 4, 2 ) ) . " ".
 87+ (0 + substr( $ts, 6, 2 ));
 88+ return $d;
8789 }
8890
89 - function getNsIndex( $text ) {
90 - global $wgNamespaceNamesSq;
91 - foreach ( $wgNamespaceNamesSq as $i => $n ) {
92 - if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
93 - }
94 - # Compatbility with alt names:
95 - if( 0 == strcasecmp( "Perdoruesi", $text ) ) return NS_USER;
96 - if( 0 == strcasecmp( "Perdoruesi_diskutim", $text ) ) return NS_USER_TALK;
97 - return false;
 91+ function time( $ts, $adj = false ) {
 92+ if ( $adj ) { $ts = $this->userAdjust( $ts ); }
 93+
 94+ $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 );
 95+ return $t;
9896 }
9997
100 - function timeDateSeparator( $format ) {
101 - return ' ';
 98+ function timeanddate( $ts, $adj = false ) {
 99+ return $this->date( $ts, $adj ) . " " . $this->time( $ts, $adj );
102100 }
103101
104 -
105 - function timeBeforeDate( $format ) {
106 - return false;
 102+ function getMessage( $key ) {
 103+ global $wgAllMessagesSq;
 104+ if(array_key_exists($key, $wgAllMessagesSq))
 105+ return $wgAllMessagesSq[$key];
 106+ else
 107+ return parent::getMessage($key);
107108 }
108109
109110 function separatorTransformTable() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r13936* Cleaned up formatNum usage in langfilesnikerabbit20:07, 29 April 2006
r14440* Update to Albanian localization (sq)...nikerabbit19:31, 28 May 2006

Status & tagging log