+ nonunicodebrowser message
[lhc/web/wiklou.git] / languages / Language.php
index f736314..8b6ff6f 100644 (file)
@@ -222,16 +222,6 @@ $wgLanguageNamesEn =& $wgLanguageNames;
 # hyphen (-). If you need more characters, you may be able to change
 # the regex in MagicWord::initRegex
 
-# NOTE: To turn off "Current Events" in the sidebar,
-# set "currentevents" => ""
-
-# NOTE: To turn off "Disclaimers" in the title links,
-# set "disclaimers" => ""
-
-# NOTE: To turn off "Community portal" in the title links,
-# set "portal" => ""
-
-
 # required for copyrightwarning
 global $wgRightsText;
 
@@ -304,6 +294,10 @@ global $wgRightsText;
 'mainpagetext' => 'Wiki software successfully installed.',
 "mainpagedocfooter" => "Please see [http://meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface]
 and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] for usage and configuration help.",
+
+# NOTE: To turn off "Community portal" in the title links,
+# set "portal" => "-"
+
 'portal'               => 'Community portal',
 'portal-url'           => '{{ns:4}}:Community Portal',
 'about'                        => 'About',
@@ -315,7 +309,8 @@ and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] f
 "wikititlesuffix" => "{{SITENAME}}",
 "bugreports"   => "Bug reports",
 "bugreportspage" => "{{ns:4}}:Bug_reports",
-'sitesupport'   => 'Donations', # Set a URL in $wgSiteSupportPage in LocalSettings.php
+'sitesupport'   => 'Donations', 
+'sitesupport-url' => '{{ns:4}}:Site support',
 'faq'                  => 'FAQ',
 "faqpage"              => "{{ns:4}}:FAQ",
 "edithelp"             => "Editing help",
@@ -334,9 +329,18 @@ and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] f
 'mytalk'               => 'My talk',
 'anontalk'             => 'Talk for this IP',
 'navigation' => 'Navigation',
+
+# NOTE: To turn off "Current Events" in the sidebar,
+# set "currentevents" => "-"
+                                      
 'currentevents' => 'Current events',
+'currentevents-url' => 'Current events',
+
+# NOTE: To turn off "Disclaimers" in the title links,
+# set "disclaimers" => "-"
+
 'disclaimers' => 'Disclaimers',
-"disclaimerpage"               => "{{ns:4}}:General_disclaimer",
+"disclaimerpage" => "{{ns:4}}:General_disclaimer",
 "errorpagetitle" => "Error",
 "returnto"             => "Return to $1.",
 "tagline"              => "From {{SITENAME}}",
@@ -644,6 +648,7 @@ You will have to merge your changes into the existing text.
 press \"Save page\".\n<p>",
 'yourtext'             => 'Your text',
 'storedversion' => 'Stored version',
+'nonunicodebrowser' => "<strong>WARNING: Your browser is not unicode compliant, please change it before editing an article.</strong>",
 '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",
@@ -683,7 +688,9 @@ Please check the URL you used to access this page.\n",
 'loadhist'             => 'Loading page history',
 'currentrev'   => 'Current revision',
 'revisionasof'          => 'Revision as of $1',
-'revisionasofwithlink'  => '(Revision as of $1; $2)',
+'revisionasofwithlink'  => 'Revision as of $1; $2<br />$3 | $4',
+'previousrevision'     => '&larr;Older revision',
+'nextrevision'         => 'Newer revision&rarr;',
 'currentrevisionlink'   => 'view current revision',
 'cur'                  => 'cur',
 'next'                 => 'next',
@@ -737,7 +744,8 @@ 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>",
+"searchdisabled" => '<p style="margin: 1.5em 2em 1em">{{SITENAME}} search is disabled for performance reasons. You can search via Google in the meantime.
+<span style="font-size: 89%; display: block; margin-left: .2em">Note that their indexes of {{SITENAME}} content may be out of date.</span></p>',
 'googlesearch' => "
 <!-- SiteSearch Google -->
 <FORM method=GET action=\"http://www.google.com/search\">
@@ -813,10 +821,38 @@ from server time (UTC).',
 'emailflag'            => 'Disable e-mail from other users',
 'defaultns'            => 'Search in these namespaces by default:',
 
+# User levels special page
+#
+
+# switching pan
+'userlevels-lookup-group' => 'Manage group rights',
+'userlevels-group-edit' => 'Existent groups: ',
+'editgroup' => 'Edit Group',
+'addgroup' => 'Add Group',
+
+'userlevels-lookup-user' => 'Manage user groups',
+'userlevels-user-editname' => 'Enter a username: ',
+'editusergroup' => 'Edit User Groups',
+
+# group editing
+'userlevels-editgroup' => 'Edit group',
+'userlevels-addgroup' => 'Add group',
+'userlevels-editgroup-name' => 'Group name: ',
+'userlevels-editgroup-description' => 'Group description (max 255 characters):<br />',
+'savegroup' => 'Save Group',
+
+# user groups editing
+'userlevels-editusergroup' => 'Edit user groups',
+'saveusergroups' => 'Save User Groups',
+'userlevels-groupsmember' => 'Member of:',
+'userlevels-groupsavailable' => 'Available groups:',
+'userlevels-groupshelp' => 'Select groups you want the user to be removed from or added to.
+Unselected groups will not be changed. You can unselect a group by using CTRL + Left Click',
 # Recent changes
 #
 'changes' => 'changes',
 'recentchanges' => 'Recent changes',
+'recentchanges-url' => 'Special:Recentchanges',
 'recentchangestext' => 'Track the most recent changes to the wiki on this page.',
 'rcloaderr'            => 'Loading recent changes',
 'rcnote'               => "Below are the last <strong>$1</strong> changes in last <strong>$2</strong> days.",
@@ -992,6 +1028,7 @@ That comes to '''$5''' average edits per page, and '''$6''' views per edit.",
 'nlinks'               => '$1 links',
 'allpages'             => 'All pages',
 'randompage'   => 'Random page',
+'randompage-url'=> 'Special:Randompage',
 'shortpages'   => 'Short pages',
 'longpages'            => 'Long pages',
 'deadendpages'  => 'Dead-end pages',
@@ -1016,6 +1053,7 @@ in active use.',
 'booksources'  => 'Book sources',
 'categoriespagetext' => 'The following categories exists in the wiki.',
 'data' => 'Data',
+'userlevels' => 'User levels management',
 
 # FIXME: Other sites, of course, may have affiliate relations with the booksellers list
 'booksourcetext' => "Below is a list of links to other sites that
@@ -1035,7 +1073,7 @@ You can narrow down the view by selecting a log type, the user name, or the affe
 'nextpage'          => 'Next page ($1)',
 'articlenamespace'  => '(articles)',
 'allpagesformtext1' => 'Display pages starting at: $1',
-'allpagesformtext2' => 'Choose namespace: $2 $3',
+'allpagesformtext2' => 'Choose namespace: $1 $2',
 'allarticles'       => 'All articles',
 'allpagesprev'      => 'Previous',
 'allpagesnext'      => 'Next',
@@ -1178,6 +1216,7 @@ will not be automatically replaced.',
 'undeleterevision' => "Deleted revision as of $1",
 'undeletebtn' => 'Restore!',
 'undeletedarticle' => "restored \"$1\"",
+'undeletedrevisions' => "$1 revisions restored",
 'undeletedtext'   => "[[$1]] has been successfully restored.
 See [[{{ns:4}}:Deletion_log]] for a record of recent deletions and restorations.",
 
@@ -1398,6 +1437,8 @@ article [[Train]].
 
 'allmessages'  => 'All system messages',
 'allmessagestext'      => 'This is a list of all system messages available in the MediaWiki: namespace.',
+'allmessagesnotsupportedUI' => 'Your current interface language is not supported by Special:AllMessages at this site.',
+'allmessagesnotsupportedDB' => 'Special:AllMessages not supported because wgUseDatabaseMessages is off.',
 
 # Thumbnails
 
@@ -1550,6 +1591,40 @@ ta[\'ca-nstab-category\'] = new Array(\'c\',\'View the category page\');
 
 'newimages' => 'New images gallery',
 
+'sitesettings'                  => 'Site Settings',
+'sitesettings-features'         => 'Features',
+'sitesettings-permissions'      => 'Permissions',
+'sitesettings-memcached'        => 'Memcache Daemon',
+'sitesettings-debugging'        => 'Debugging',
+'sitesettings-caching'          => 'Page caching',
+'sitesettings-wgShowIPinHeader' => 'Show IP in header (for non-logged in users)',
+'sitesettings-wgUseDatabaseMessages' => 'Use database messages for user interface labels',
+'sitesettings-wgUseCategoryMagic' => 'Enable categories',
+'sitesettings-wgUseCategoryBrowser' => 'Enable experimental dmoz-like category browsing. Outputs things like:  Encyclopedia > Music > Style of Music > Jazz',
+'sitesettings-wgHitcounterUpdateFreq' => 'Hit counter update frequency',
+'sitesettings-wgAllowExternalImages' => 'Allow to include external images into articles',
+'sitesettings-permissions-readonly' => 'Maintenance mode: Disable write access',
+'sitesettings-permissions-whitelist' => 'Whitelist mode',
+'sitesettings-permissions-banning' => 'User banning',
+'sitesettings-permissions-miser' => 'Performance settings',
+'sitesettings-wgReadOnly' => 'Readonly mode',
+'sitesettings-wgReadOnlyFile' => 'Readonly message file',
+'sitesettings-wgWhitelistEdit' => 'Users must be logged in to edit',
+'sitesettings-wgWhitelistRead' => 'Anonymous users may only read these pages:',
+'sitesettings-wgWhitelistAccount-user' => 'Users may create accounts themself',
+'sitesettings-wgWhitelistAccount-sysop' => 'Sysops may create accounts for users',
+'sitesettings-wgWhitelistAccount-developer' => 'Developers may create accounts for users',
+'sitesettings-wgSysopUserBans' => 'Sysops may block logged-in users',
+'sitesettings-wgSysopRangeBans' => 'Sysops may block IP-ranges',
+'sitesettings-wgDefaultBlockExpiry' => 'By default, blocks expire after:',
+'sitesettings-wgMiserMode' => 'Enable miser mode, which disables most "expensive" features',
+'sitesettings-wgDisableQueryPages' => 'When in miser mode, disable all query pages, not only "expensive" ones',
+'sitesettings-wgUseWatchlistCache' => 'Generate a watchlist once every hour or so',
+'sitesettings-wgWLCacheTimeout' => 'The hour or so mentioned above (in seconds):',
+'sitesettings-cookies' => 'Cookies',
+'sitesettings-performance' => 'Performance',
+'sitesettings-images' => 'Images',
+
 
 );
 
@@ -1987,6 +2062,7 @@ class Language {
 
 
                $plang = $this->getPreferredVariant();
+               $fallback = $this->getVariantFallback($plang);
 
                $tarray = explode("-{", $text);
                $tfirst = array_shift($tarray);
@@ -1996,21 +2072,37 @@ class Language {
                        $marked = explode("}-", $txt);
                        
                        $choice = explode(";", $marked{0});
-                       if($choice{1}==NULL) {
+                       if(!array_key_exists(1, $choice)) {
+                               /* a single choice */
                                $text .= $choice{0};
                        }
                        else {
+                               $choice1=false;
+                               $choice2=false;
                                foreach($choice as $c) {
-                                       list($code, $content) = split(":", $c);
-                                       $code = trim($code);
-                                       $content = trim($content);
+                                       $v = explode(":", $c);
+                                       if(!array_key_exists(1, $v)) {
+                                               //syntax error in the markup, give up
+                                               break;                  
+                                       }
+                                       $code = trim($v{0});
+                                       $content = trim($v{1});
                                        if($code == $plang) {
-                                               $text .= $content;
+                                               $choice1 = $content;
                                                break;
                                        }
+                                       if($code == $fallback)
+                                               $choice2 = $content;
                                }
+                               if ( $choice1 )
+                                       $text .= $choice1;
+                               elseif ( $choice2 )
+                                       $text .= $choice2;
+                               else
+                                       $text .= $marked{0};
                        }
-                       $text .= $this->autoConvert($marked{1});
+                       if(array_key_exists(1, $marked))
+                               $text .= $this->autoConvert($marked{1});
                }
                
                return $text;
@@ -2019,17 +2111,26 @@ class Language {
        /* this does the real conversion to the preferred variant.
           see LanguageZh.php for example
        */
-       function autoConvert($text) {
+       function autoConvert($text, $toVariant=false) {
                return $text;
        }
        
-       # see if we have a list of language variants for conversion.
+       # returns a list of language variants for conversion.
        # right now mainly used in the Chinese conversion
        function getVariants() {
-               return array();
+               $lang = strtolower(substr(get_class($this), 8));
+               return array($lang);
        }
        
-       
+       # in case some variant is not defined in the markup, we need
+       # to have some fallback. for example, in zh, normally people
+       # will define zh-cn and zh-tw, but less so for zh-sg or zh-hk.
+       # when zh-sg is preferred but not defined, we will pick zh-cn
+       # in this case. right now this is only used by zh.
+       function getVariantFallback($v) {
+               return false;
+       }
+
        function getPreferredVariant() {
                global $wgUser;
                
@@ -2051,7 +2152,7 @@ class Language {
 }
 
 # This should fail gracefully if there's not a localization available
-@include_once( 'Language' . str_replace( '-', '_', ucfirst( $wgContLanguageCode ) ) . '.php' );
+@include_once( 'Language' . str_replace( '-', '_', ucfirst( $wgLanguageCode ) ) . '.php' );
 
 }
 ?>