Added "searchdisabled" key for reference
[lhc/web/wiklou.git] / languages / Language.php
index 355adcb..751d462 100644 (file)
@@ -1,5 +1,37 @@
 <?
 
+#--------------------------------------------------------------------------
+# Constants
+#--------------------------------------------------------------------------
+
+# Namespaces
+define("NS_SPECIAL", -1);
+define("NS_MAIN", 0);
+define("NS_TALK", 1);
+define("NS_USER", 2);
+define("NS_USER_TALK", 3);
+define("NS_WP", 4);
+define("NS_WP_TALK", 5);
+define("NS_IMAGE", 6);
+define("NS_IMAGE_TALK", 7);
+
+# Magic words
+define("MAG_REDIRECT", 0);
+define("MAG_NOTOC", 1);
+define("MAG_START", 2);
+define("MAG_CURRENTMONTH", 3);
+define("MAG_CURRENTMONTHNAME", 4);
+define("MAG_CURRENTDAY", 5);
+define("MAG_CURRENTDAYNAME", 6);
+define("MAG_CURRENTYEAR", 7);
+define("MAG_CURRENTTIME", 8);
+define("MAG_NUMBEROFARTICLES", 9);
+define("MAG_CURRENTMONTHNAMEGEN", 10);
+
+#--------------------------------------------------------------------------
+# Language-specific text
+#--------------------------------------------------------------------------
+
 # NOTE: To turn off "Current Events" in the sidebar,
 # set "currentevents" => "-"
 
@@ -25,7 +57,7 @@
        "contextlines" => 5, "contextchars" => 50,
        "skin" => 0, "math" => 1, "rcdays" => 7, "rclimit" => 50,
        "highlightbroken" => 1, "stubthreshold" => 0,
-       "previewontop" => 1, "editsection"=>1, "showtoc"=>1,
+       "previewontop" => 1, "editsection"=>1,"editsectiononrightclick"=>0, "showtoc"=>1,
        "date" => 0
 );
 
@@ -34,7 +66,7 @@
 );
 
 /* private */ $wgSkinNamesEn = array(
-       "Standard", "Nostalgia", "Cologne Blue"
+       "Standard", "Nostalgia", "Cologne Blue", "Paddington", "Montparnasse"
 );
 
 /* private */ $wgMathNamesEn = array(
@@ -61,12 +93,13 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
        "hideminor" => "Hide minor edits in recent changes",
        "usenewrc" => "Enhanced recent changes (not for all browsers)",
        "numberheadings" => "Auto-number headings",
-       "editsection"=>"Show links for editing individual sections",
-       "showtoc"=>"Show table of contents for articles with more than 3 headings",
+       "editondblclick" => "Edit pages on double click (JavaScript)",
+       "editsection"=>"Enable section editing via [edit] links",
+       "editsectiononrightclick"=>"Enable section editing by right clicking<br> on section titles (JavaScript)",
+       "showtoc"=>"Show table of contents<br>(for articles with more than 3 headings)",
        "rememberpassword" => "Remember password across sessions",
        "editwidth" => "Edit box has full width",
-       "editondblclick" => "Edit pages on double click (JavaScript)",
-       "watchdefault" => "Watch new and modified articles",
+       "watchdefault" => "Add pages you edit to your watchlist",
        "minordefault" => "Mark all edits minor by default",
        "previewontop" => "Show preview before edit box and not after it",
        "nocache" => "Disable page caching"
@@ -190,7 +223,7 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
        "sr" => "Srpski",
        "ss"    => "Siswati",
        "st"    => "Sesotho",
-       "su"    => "Sudanese",
+       "su"    => "Sundanese",
        "sv" => "Svenska",
        "sw" => "Kiswahili",
        "ta"    => "Tamil",
@@ -239,6 +272,21 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
        "Sep", "Oct", "Nov", "Dec"
 );
 
+/* private */ $wgMagicWordsEn = array(
+#   ID                                 CASE  SYNONYMS
+    MAG_REDIRECT             => array( 0,    "#redirect"              ),
+    MAG_NOTOC                => array( 0,    "__NOTOC__"              ),
+    MAG_START                => array( 0,    "__START__"              ),
+    MAG_CURRENTMONTH         => array( 1,    "{{CURRENTMONTH}}"       ),
+    MAG_CURRENTMONTHNAME     => array( 1,    "{{CURRENTMONTHNAME}}"   ),
+    MAG_CURRENTDAY           => array( 1,    "{{CURRENTDAY}}"         ),   
+    MAG_CURRENTDAYNAME       => array( 1,    "{{CURRENTDAYNAME}}"     ),
+    MAG_CURRENTYEAR          => array( 1,    "{{CURRENTYEAR}}"        ),
+    MAG_CURRENTTIME          => array( 1,    "{{CURRENTTIME}}"        ),
+    MAG_NUMBEROFARTICLES     => array( 1,    "{{NUMBEROFARTICLES}}"   ),
+    MAG_CURRENTMONTHNAMEGEN  => array( 1,    "{{CURRENTMONTHNAMEGEN}}"),
+);
+       
 # All special pages have to be listed here: a description of ""
 # will make them not show up on the "Special Pages" page, which
 # is the right thing for some of them (such as the "targeted" ones).
@@ -274,7 +322,8 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
        "Whatlinkshere" => "",
        "Recentchangeslinked" => "",
        "Movepage"              => "",
-       "Booksources"   => "External book sources"
+       "Booksources"   => "External book sources",
+"Categories" => "Page categories"
 );
 
 /* private */ $wgSysopSpecialPagesEn = array(
@@ -293,6 +342,11 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
 
 # Bits of text used by many pages:
 #
+"categories" => "Page categories",
+"category" => "category",
+"category_header" => "Articles in category \"$1\"",
+"subcategories" => "Subcategories",
+
 "linktrail"            => "/^([a-z]+)(.*)\$/sD",
 "mainpage"             => "Main Page",
 "mainpagetext" => "Wiki software successfully installed.",
@@ -333,6 +387,7 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
 "unprotectthispage" => "Unprotect this page",
 "newpage" => "New page",
 "talkpage"             => "Discuss this page",
+"postcomment"   => "Post a comment",
 "articlepage"  => "View article",
 "subjectpage"  => "View subject", # For compatibility
 "userpage" => "View user page",
@@ -365,6 +420,10 @@ See $1.",
 "newmessageslink" => "new messages",
 "editsection"=>"edit",
 "toc" => "Table of contents",
+"showtoc" => "show",
+"hidetoc" => "hide",
+"thisisdeleted" => "View or restore $1?",
+"restorelink" => "$1 deleted edits",
 
 # Main script and global functions
 #
@@ -391,8 +450,9 @@ The last attempted database query was:
 \"$1\"
 from within function \"$2\".
 MySQL returned error \"$3: $4\".\n",
-"noconnect"            => "Could not connect to DB on $1",
+"noconnect"            => "Sorry! The wiki is experiencing some technical difficulties, and cannot contact the database server.",
 "nodb"                 => "Could not select database $1",
+"cachederror"          => "The following is a cached copy of the requested page, and may not be up to date.",
 "readonly"             => "Database locked",
 "enterlockreason" => "Enter a reason for the lock, including an estimate
 of when the lock will be released",
@@ -429,9 +489,11 @@ the wiki.",
 # Login and logout pages
 #
 "logouttitle"  => "User logout",
-"logouttext"   => "You are now logged out.
+"logouttext" => "You are now logged out.
 You can continue to use Wikipedia anonymously, or you can log in
-again as the same or as a different user.\n",
+again as the same or as a different user. Note that some pages may
+continue to be displayed as if you were still logged in, until you clear
+your browser cache\n",
 
 "welcomecreation" => "<h2>Welcome, $1!</h2><p>Your account has been created.
 Don't forget to personalize your wikipedia preferences.",
@@ -456,6 +518,7 @@ that it be to the address you give.<br>\n",
 "userlogout"   => "Log out",
 "notloggedin"  => "Not logged in",
 "createaccount"        => "Create new account",
+"createaccountmail"    => "by eMail",
 "badretype"            => "The passwords you entered do not match.",
 "userexists"   => "The user name you entered is already in use. Please choose a different name.",
 "youremail"            => "Your e-mail*",
@@ -485,6 +548,7 @@ Please log in again after you receive it.",
 # Edit pages
 #
 "summary"              => "Summary",
+"subject"              => "Subject/headline",
 "minoredit"            => "This is a minor edit",
 "watchthis"            => "Watch this article",
 "savearticle"  => "Save page",
@@ -494,6 +558,14 @@ Please log in again after you receive it.",
 "blockedtext"  => "Your user name or IP address has been blocked by $1.
 The reason given is this:<br>''$2''<p>You may contact $1 or one of the other
 [[Wikipedia:administrators|administrators]] to discuss the block.",
+"whitelistedittitle" => "Login required to edit",
+"whitelistedittext" => "You have to [[Special:Userlogin|login]] to edit articles.",
+"whitelistreadtitle" => "Login required to read",
+"whitelistreadtext" => "You have to [[Special:Userlogin|login]] to read articles.",
+"whitelistacctitle" => "You are not allowed to create an account",
+"whitelistacctext" => "To be allowed to create accounts in this Wiki you have to [[Special:Userlogin|log]] in and have the appropriate permissions.",
+"accmailtitle" => "Password sent.",
+"accmailtext" => "The Password for '$1' has been sent to $2.",
 "newarticle"   => "(New)",
 "newarticletext" =>
 "You've followed a link to a page that doesn't exist yet.
@@ -509,6 +581,7 @@ If you are here by mistake, just click your browser's '''back''' button.",
 text editing area as it will appear if you choose to save.",
 "editing"              => "Editing $1",
 "sectionedit"  => " (section)",
+"commentedit"  => " (comment)",
 "editconflict" => "Edit conflict: $1",
 "explainconflict" => "Someone else has changed this page since you
 started editing it.
@@ -601,7 +674,25 @@ containing all of the search terms will appear in the result).",
 Search in namespaces :<br>
 $1<br>
 $2 List redirects &nbsp; Search for $3 $9",
-
+"searchdisabled" => "<p>Sorry! Full text search has been disabled temporarily, for performance reasons. In the meantime, you can use the Google search below, which may be out of date.</p>
+
+<!-- SiteSearch Google -->
+<FORM method=GET action=\"http://www.google.com/search\">
+<TABLE bgcolor=\"#FFFFFF\"><tr><td>
+<A HREF=\"http://www.google.com/\">
+<IMG SRC=\"http://www.google.com/logos/Logo_40wht.gif\"
+border=\"0\" ALT=\"Google\"></A>
+</td>
+<td>
+<INPUT TYPE=text name=q size=31 maxlength=255 value=\"\">
+<INPUT type=submit name=btnG VALUE=\"Google Search\">
+<font size=-1>
+<input type=hidden name=domains value=\"{$wgServer}\"><br><input type=radio name=sitesearch value=\"\"> WWW <input type=radio name=sitesearch value=\"{$wgServer}\" checked> {$wgServer} <br>
+</font>
+</td></tr></TABLE>
+</FORM>
+<!-- SiteSearch Google -->",
+"blanknamespace" => "(Main)",
 
 # Preferences page
 #
@@ -611,7 +702,9 @@ $2 List redirects &nbsp; Search for $3 $9",
   wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
 to set user preferences.",
 "prefslogintext" => "You are logged in as \"$1\".
-Your internal ID number is $2.",
+Your internal ID number is $2.
+
+See [[Wikipedia:User preferences help]] for help deciphering the options.",
 "prefsreset"   => "Preferences have been reset from storage.",
 "qbsettings"   => "Quickbar settings", 
 "changepassword" => "Change password",
@@ -651,7 +744,8 @@ from server time (UTC).",
 #
 "changes" => "changes",
 "recentchanges" => "Recent changes",
-"recentchangestext" => "Track the most recent changes to Wikipedia on this page.
+"recentchangestext" => 
+"Track the most recent changes to Wikipedia on this page.
 [[Wikipedia:Welcome,_newcomers|Welcome, newcomers]]!
 Please have a look at these pages: [[wikipedia:FAQ|Wikipedia FAQ]],
 [[Wikipedia:Policies and guidelines|Wikipedia policy]]
@@ -693,7 +787,7 @@ See also the [http://meta.wikipedia.org/wiki/Special:Recentchanges recent meta d
 "uploadnologintext"    => "You must be <a href=\"" .
   wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
 to upload files.",
-"uploadfile"   => "Upload file",
+"uploadfile"   => "Upload images, sounds, documents etc.",
 "uploaderror"  => "Upload error",
 "uploadtext"   => "<strong>STOP!</strong> Before you upload here,
 make sure to read and follow Wikipedia's <a href=\"" .
@@ -830,9 +924,9 @@ That comes to <b>$5</b> average edits per page, and <b>$6</b> views per edit.",
 "longpages"            => "Long pages",
 "listusers"            => "User list",
 "specialpages" => "Special pages",
-"spheading"            => "Special pages",
-"sysopspheading" => "Special pages for sysop use",
-"developerspheading" => "Special pages for developer use",
+"spheading"            => "Special pages for all users",
+"sysopspheading" => "For sysop use only",
+"developerspheading" => "For developer use only",
 "protectpage"  => "Protect page",
 "recentchangeslinked" => "Related changes",
 "rclsub"               => "(to pages linked from \"$1\")",
@@ -902,6 +996,24 @@ make it easier to pick out.</p>
 "watchthispage"        => "Watch this page",
 "unwatchthispage" => "Stop watching",
 "notanarticle" => "Not an article",
+"watchnochange" => "None of your watched items were edited in the time period displayed.",
+"watchdetails" => "($1 pages watched not counting talk pages;
+$2 total pages edited since cutoff;
+$3...
+<a href='$4'>show and edit complete list</a>.)",
+"watchmethod-recent" => "checking recent edits for watched pages",
+"watchmethod-list" => "checking watched pages for recent edits",
+"removechecked" => "Remove checked items from watchlist",
+"watchlistcontains" => "Your watchlist contains $1 pages.",
+"watcheditlist" => "Here's an alphabetical list of your
+watched pages. Check the boxes of pages you want to remove
+from your watchlist and click the 'remove checked' button
+at the bottom of the screen.",
+"removingchecked" => "Removing requested items from watchlist...",
+"couldntremove" => "Couldn't remove item '$1'...",
+"iteminvalidname" => "Problem with item '$1', invalid name...",
+"wlnote" => "Below are the last $1 changes in the last <b>$2</b> hours.",
+                                                                                                                                       
 
 # Delete/protect/revert
 #
@@ -985,31 +1097,32 @@ to perform this function on.",
 
 # Block/unblock IP
 #
-"blockip"              => "Block IP address",
+"blockip"              => "Block user",
 "blockiptext"  => "Use the form below to block write access
-from a specific IP address.
+from a specific IP address or username.
 This should be done only only to prevent vandalism, and in
 accordance with [[Wikipedia:Policy|Wikipedia policy]].
 Fill in a specific reason below (for example, citing particular
 pages that were vandalized).",
-"ipaddress"            => "IP Address",
+"ipaddress"            => "IP Address/username",
 "ipbreason"            => "Reason",
-"ipbsubmit"            => "Block this address",
-"badipaddress" => "The IP address is badly formed.",
+"ipbsubmit"            => "Block this user",
+"badipaddress" => "No user exists by that name",
 "noblockreason" => "You must supply a reason for the block.",
 "blockipsuccesssub" => "Block succeeded",
-"blockipsuccesstext" => "The IP address \"$1\" has been blocked.
+"blockipsuccesstext" => "\"$1\" has been blocked.
 <br>See [[Special:Ipblocklist|IP block list]] to review blocks.",
-"unblockip"            => "Unblock IP address",
+"unblockip"            => "Unblock user",
 "unblockiptext"        => "Use the form below to restore write access
-to a previously blocked IP address.",
+to a previously blocked IP address or username.",
 "ipusubmit"            => "Unblock this address",
-"ipusuccess"   => "IP address \"$1\" unblocked",
-"ipblocklist"  => "List of blocked IP addresses",
+"ipusuccess"   => "\"$1\" unblocked",
+"ipblocklist"  => "List of blocked IP addresses and usernames",
 "blocklistline"        => "$1, $2 blocked $3",
 "blocklink"            => "block",
 "unblocklink"  => "unblock",
 "contribslink" => "contribs",
+"autoblocker"  => "Autoblocked because you share an IP address with \"$1\". Reason \"$2\".",
 
 # Developer tools
 #
@@ -1099,6 +1212,10 @@ title. Please merge them manually.",
 
 );
 
+#--------------------------------------------------------------------------
+# Internationalisation code
+#--------------------------------------------------------------------------
+
 class Language {
 
        function getDefaultUserOptions () {
@@ -1222,12 +1339,16 @@ class Language {
  
        function date( $ts, $adj = false )
        {
-               global $wgAmericanDates, $wgUser;
+               global $wgAmericanDates, $wgUser, $wgUseDynamicDates;
 
                if ( $adj ) { $ts = $this->userAdjust( $ts ); }
-
-               $datePreference = $wgUser->getOption( 'date' );         
-               if ( $datePreference == 0 ) {
+               
+               if ( $wgUseDynamicDates ) {
+                       $datePreference = $wgUser->getOption( 'date' );         
+                       if ( $datePreference == 0 ) {
+                               $datePreference = $wgAmericanDates ? 1 : 2;
+                       }
+               } else {
                        $datePreference = $wgAmericanDates ? 1 : 2;
                }
                
@@ -1371,13 +1492,18 @@ class Language {
 
        function replaceDates( $text )
        {
-               global $wgUser, $wgInputEncoding;
+               global $wgUser, $wgInputEncoding, $wgUseDynamicDates;
                
+               # Feature can be disabled
+               if ( !$wgUseDynamicDates ) {
+                       return;
+               }
+
                # Setup
                
                $datePreference = $wgUser->getOption( 'date' );
 
-               static $monthNames = "", $rxDM, $rxMD, $rxY, $rxDMY, $rxYMD, $rxMDY, $rxYMD;
+               static $monthNames = "", $rxDM, $rxMD, $rxY, $rxDMY, $rxYDM, $rxMDY, $rxYMD;
                if ( $monthNames == "" ) {
                        $monthNames = $this->getMonthRegex();
                        
@@ -1437,6 +1563,24 @@ class Language {
                }
                return $text;
        }
+
+       # For right-to-left language support
+       function isRTL() { return false; }
+
+       function getMagicWords() 
+       {
+               global $wgMagicWordsEn;
+               return $wgMagicWordsEn;
+       }
+
+       # Fill a MagicWord object with data from here
+       function getMagic( &$mw )
+       {
+               $raw = $this->getMagicWords(); # don't worry, it's reference counted not deep copy
+               $rawEntry = $raw[$mw->mId];
+               $mw->mCaseSensitive = $rawEntry[0];
+               $mw->mSynonyms = array_slice( $rawEntry, 1 );
+       }
 }
 
 global $IP;