Tatar week days and months
[lhc/web/wiklou.git] / languages / Language.php
index 85e4a84..54e8492 100644 (file)
@@ -32,8 +32,8 @@ if($wgMetaNamespace === FALSE)
        NS_TALK             => 'Talk',
        NS_USER             => 'User',
        NS_USER_TALK        => 'User_talk',
-       NS_WIKIPEDIA        => $wgMetaNamespace,
-       NS_WIKIPEDIA_TALK   => $wgMetaNamespace . '_talk',
+       NS_PROJECT          => $wgMetaNamespace,
+       NS_PROJECT_TALK     => $wgMetaNamespace . '_talk',
        NS_IMAGE            => 'Image',
        NS_IMAGE_TALK       => 'Image_talk',
        NS_MEDIAWIKI        => 'MediaWiki',
@@ -46,6 +46,10 @@ if($wgMetaNamespace === FALSE)
        NS_CATEGORY_TALK    => 'Category_talk'
 );
 
+if(isset($wgExtraNamespaces)) {
+       $wgNamespaceNamesEn=$wgNamespaceNamesEn+$wgExtraNamespaces;
+}
+
 /* private */ $wgDefaultUserOptionsEn = array(
        'quickbar' => 1, 'underline' => 1, 'hover' => 1,
        'cols' => 80, 'rows' => 25, 'searchlimit' => 20,
@@ -54,7 +58,7 @@ if($wgMetaNamespace === FALSE)
        'highlightbroken' => 1, 'stubthreshold' => 0,
        'previewontop' => 1, 'editsection'=>1,'editsectiononrightclick'=>0, 'showtoc'=>1,
        'showtoolbar' =>1,
-       'date' => 0
+       'date' => 0, 'imagesize' => 2
 );
 
 /* private */ $wgQuickbarSettingsEn = array(
@@ -128,6 +132,7 @@ define( 'MW_DATE_USER_FORMAT', true );
        'watchdefault',
        'minordefault',
        'previewontop',
+       'previewonfirst',
        'nocache',
 );
 
@@ -206,7 +211,8 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_NS                   => array( 0,    'NS:'                    ),
        MAG_LOCALURL             => array( 0,    'LOCALURL:'              ),
        MAG_LOCALURLE            => array( 0,    'LOCALURLE:'             ),
-       MAG_SERVER               => array( 0,    'SERVER'                 )
+       MAG_SERVER               => array( 0,    'SERVER'                 ),
+       MAG_GRAMMAR              => array( 0,    'GRAMMAR:'               )
 );
 
 #-------------------------------------------------------------------
@@ -250,6 +256,7 @@ global $wgRightsText;
 'tog-watchdefault' => 'Add pages you edit to your watchlist',
 'tog-minordefault' => 'Mark all edits minor by default',
 'tog-previewontop' => 'Show preview before edit box and not after it',
+'tog-previewonfirst' => 'Show preview on first edit',
 'tog-nocache' => 'Disable page caching',
 
 # dates
@@ -300,7 +307,7 @@ and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] f
 'portal'               => 'Community portal',
 'portal-url'           => '{{ns:4}}:Community Portal',
 'about'                        => 'About',
-"aboutwikipedia" => "About {{SITENAME}}",
+"aboutsite"      => "About {{SITENAME}}",
 "aboutpage"            => "{{ns:4}}:About",
 'article' => 'Content page',
 'help'                 => 'Help',
@@ -332,7 +339,7 @@ and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] f
 "disclaimerpage"               => "{{ns:4}}:General_disclaimer",
 "errorpagetitle" => "Error",
 "returnto"             => "Return to $1.",
-"fromwikipedia"        => "From {{SITENAME}}",
+"tagline"              => "From {{SITENAME}}",
 'whatlinkshere'        => 'Pages that link here',
 'help'                 => 'Help',
 'search'               => 'Search',
@@ -521,6 +528,8 @@ Your account has been created. Don't forget to change your {{SITENAME}} preferen
 'userexists'   => 'The user name you entered is already in use. Please choose a different name.',
 'youremail'            => 'Your email*',
 'yourrealname'         => 'Your real name*',
+'yourlanguage' => 'Interface language',
+'yourvariant'  => 'Language variant',
 'yournick'             => 'Your nickname (for signatures)',
 'emailforlost' => "Fields marked with a star (*) are optional.  Storing an email address enables people to contact you through the website without you having to reveal your
 email address to them, and it can be used to send you a new password if you forget it.<br /><br />Your real name, if you choose to provide it, will be used for giving you attribution for your work.",
@@ -634,9 +643,9 @@ You will have to merge your changes into the existing text.
 press \"Save page\".\n<p>",
 'yourtext'             => 'Your text',
 'storedversion' => 'Stored version',
-'editingold'   => '<strong>WARNING: You are editing an out-of-date
+'editingold'   => "<strong>WARNING: You are editing an out-of-date
 revision of this page.
-If you save it, any changes made since this revision will be lost.</strong>\n',
+If you save it, any changes made since this revision will be lost.</strong>\n",
 'yourdiff'             => 'Differences',
 'copyrightwarning' => "Please note that all contributions to {{SITENAME}} are
 considered to be released under the $2 (see $1 for details).
@@ -672,7 +681,9 @@ guidelines</a>.",
 Please check the URL you used to access this page.\n",
 'loadhist'             => 'Loading page history',
 'currentrev'   => 'Current revision',
-'revisionasof' => "Revision as of $1",
+'revisionasof'          => 'Revision as of $1',
+'revisionasofwithlink'  => '(Revision as of $1; $2)',
+'currentrevisionlink'   => 'view current revision',
 'cur'                  => 'cur',
 'next'                 => 'next',
 'last'                 => 'last',
@@ -714,7 +725,7 @@ and the text of $3 pages.",
 'prevn'                        => "previous $1",
 'nextn'                        => "next $1",
 'viewprevnext' => "View ($1) ($2) ($3).",
-'showingresults' => "Showing below <b>$1</b> results starting with #<b>$2</b>.",
+'showingresults' => "Showing below up to <b>$1</b> results starting with #<b>$2</b>.",
 'showingresultsnum' => "Showing below <b>$3</b> results starting with #<b>$2</b>.",
 'nonefound'            => "'''Note''': unsuccessful searches are
 often caused by searching for common words like \"have\" and \"from\",
@@ -823,6 +834,7 @@ from server time (UTC).',
 'nchanges'             => "$1 changes",
 'minoreditletter' => 'm',
 'newpageletter' => 'N',
+'sectionlink' => '&rarr;',
 
 # Upload
 #
@@ -870,11 +882,7 @@ you may be blocked from uploading if you abuse the system.",
 
 'uploadlog'            => 'upload log',
 'uploadlogpage' => 'Upload_log',
-'uploadlogpagetext' => 'Below is a list of the most recent file uploads.
-All times shown are server time (UTC).
-<ul>
-</ul>
-',
+'uploadlogpagetext' => 'Below is a list of the most recent file uploads.',
 'filename'             => 'Filename',
 'filedesc'             => 'Summary',
 'filestatus' => 'Copyright status',
@@ -1118,11 +1126,7 @@ consequences, and that you are doing this in accordance with
 See $2 for a record of recent deletions.",
 'deletedarticle' => "deleted \"$1\"",
 'dellogpage'   => 'Deletion_log',
-'dellogpagetext' => 'Below is a list of the most recent deletions.
-All times shown are server time (UTC).
-<ul>
-</ul>
-',
+'dellogpagetext' => 'Below is a list of the most recent deletions.',
 'deletionlog'  => 'deletion log',
 'reverted'             => 'Reverted to earlier revision',
 'deletecomment'        => 'Reason for deletion',
@@ -1371,15 +1375,15 @@ title. Please merge them manually.',
 
 'export'               => 'Export pages',
 'exporttext'   => 'You can export the text and editing history of a particular page or
-set of pages wrapped in some XML. In the future, this may then be imported into another 
-wiki running MediaWiki software, although there is no support for this feature in the 
+set of pages wrapped in some XML. In the future, this may then be imported into another
+wiki running MediaWiki software, although there is no support for this feature in the
 current version.
 
-To export article pages, enter the titles in the text box below, one title per line, and 
-select whether you want the current version as well as all old versions, with the page 
+To export article pages, enter the titles in the text box below, one title per line, and
+select whether you want the current version as well as all old versions, with the page
 history lines, or just the current version with the info about the last edit.
 
-In the latter case you can also use a link, e.g. [[{{ns:Special}}:Export/Train]] for the 
+In the latter case you can also use a link, e.g. [[{{ns:Special}}:Export/Train]] for the
 article [[Train]].
 ',
 'exportcuronly'        => 'Include only the current revision, not the full history',
@@ -1526,7 +1530,19 @@ ta[\'ca-nstab-mediawiki\'] = new Array(\'c\',\'View the system message\');
 ta[\'ca-nstab-template\'] = new Array(\'c\',\'View the template\');
 ta[\'ca-nstab-help\'] = new Array(\'c\',\'View the help page\');
 ta[\'ca-nstab-category\'] = new Array(\'c\',\'View the category page\');
-'
+',
+
+# image deletion
+'deletedrevision' => 'Deleted old revision $1.',
+
+# browsing diffs
+'previousdiff' => '&larr; Go to previous diff',
+'nextdiff' => 'Go to next diff &rarr;',
+
+'imagemaxsize' => 'Limit images on image description pages to: ',
+'showbigimage' => 'Download high resolution version ($1x$2, $3 KB)',
+
+'newimages' => 'New images gallery',
 
 
 );
@@ -1691,6 +1707,7 @@ class Language {
        {
                global $wgAmericanDates, $wgUser, $wgUseDynamicDates;
 
+               $ts=wfTimestamp(TS_MW,$ts);
                if ( $adj ) { $ts = $this->userAdjust( $ts ); }
                if ( $wgUseDynamicDates ) {
                        if ( $format == MW_DATE_USER_FORMAT ) {
@@ -1719,6 +1736,8 @@ class Language {
 
        function time( $ts, $adj = false, $seconds = false )
        {
+               $ts=wfTimestamp(TS_MW,$ts);
+
                if ( $adj ) { $ts = $this->userAdjust( $ts ); }
 
                $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
@@ -1730,6 +1749,8 @@ class Language {
 
        function timeanddate( $ts, $adj = false, $format = MW_DATE_USER_FORMAT )
        {
+               $ts=wfTimestamp(TS_MW,$ts);
+
                return $this->time( $ts, $adj ) . ', ' . $this->date( $ts, $adj, $format );
        }
 
@@ -1932,10 +1953,79 @@ class Language {
                        return $ellipsis . $string;
                }
        }
+
+       # Grammatical transformations, needed for inflected languages
+       # Invoked by putting {{grammar:case|word}} in a message
+       function convertGrammar( $word, $case ) {
+               return $word;
+       }
+
+    
+    # convert text to different variants of a language. the automatic
+    # conversion is done in autoConvert(). here we parse the text 
+    # marked with -{}-, which specifies special conversions of the 
+    # text that can not be accomplished in autoConvert()
+    #
+    # syntax of the markup:
+    # -{code1:text1;code2:text2;...}-  or
+    # -{text}- in which case no conversion should take place for text
+       function convert( $text ) {
+
+        $plang = $this->getPreferredVariant();
+        if(!$plang)
+            return $text;
+
+               // no conversion if redirecting
+               if(substr($text,0,9) == "#REDIRECT") {
+                       return $text;
+               }
+
+        $tarray = explode("-{", $text);
+        $tfirst = array_shift($tarray);
+        $text = $this->autoConvert($tfirst);
+
+        foreach($tarray as $txt) {
+            $marked = explode("}-", $txt);
+
+            $choice = explode(";", $marked{0});
+            if($choice{1}==NULL) {
+                $text .= $choice{0};
+            }
+            else {
+                foreach($choice as $c) {
+                    list($code, $content) = split(":", $c);
+                    $code = trim($code);
+                    $content = trim($content);
+                    if($code == $plang) {
+                        $text .= $content;
+                        break;
+                    }
+                }
+            }
+            $text .= $this->autoConvert($marked{1});
+        }
+
+        return $text;
+       }
+
+    function autoConvert($text) {
+        return $text;
+    }
+
+    # see if we have a list of language variants for conversion.
+    # right now mainly used in the Chinese conversion
+    function getVariants() {
+        return array();
+    }
+
+    # todo: write general code to get default language variant
+    function getPreferredVariant() {
+        return false;
+    }
 }
 
 # This should fail gracefully if there's not a localization available
-@include_once( 'Language' . ucfirst( $wgLanguageCode ) . '.php' );
+@include_once( 'Language' . str_replace( '-', '_', ucfirst( $wgLanguageCode ) ) . '.php' );
 
 }
 ?>