formatNum for Esperanto
[lhc/web/wiklou.git] / languages / Language.php
index 4f357f5..602b4e6 100644 (file)
@@ -81,6 +81,8 @@ if(isset($wgExtraNamespaces)) {
        'fancysig'              => 0,
        'externaleditor'        => 0,
        'externaldiff'          => 0,
+       'showjumplinks'         => 1,
+       'numberheadings'        => 0,
 );
 
 /* private */ $wgQuickbarSettingsEn = array(
@@ -107,12 +109,22 @@ if(isset($wgExtraNamespaces)) {
        MW_MATH_MATHML => 'mw_math_mathml'
 );
 
-# Whether to use user or default setting in Language::date()
-
-/* private */ $wgDateFormatsEn = array(
+/**
+ * Whether to use user or default setting in Language::date()
+ *
+ * NOTE: the array string values are no longer important!
+ * The actual date format functions are now called for the selection in
+ * Special:Preferences, and the 'datedefault' message for MW_DATE_DEFAULT.
+ *
+ * The array keys make up the set of formats which this language allows
+ * the user to select. It's exposed via Language::getDateFormats().
+ *
+ * @access private
+ */
+$wgDateFormatsEn = array(
        MW_DATE_DEFAULT => 'No preference',
-       MW_DATE_MDY => '16:12, January 15, 2001',
        MW_DATE_DMY => '16:12, 15 January 2001',
+       MW_DATE_MDY => '16:12, January 15, 2001',
        MW_DATE_YMD => '16:12, 2001 January 15',
        MW_DATE_ISO => '2001-01-15 16:12:34'
 );
@@ -143,6 +155,7 @@ if(isset($wgExtraNamespaces)) {
        'fancysig',
        'externaleditor',
        'externaldiff',
+       'showjumplinks',
 );
 
 /* private */ $wgBookstoreListEn = array(
@@ -207,6 +220,9 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_PAGENAME             => array( 1,    'PAGENAME'               ),
        MAG_PAGENAMEE            => array( 1,    'PAGENAMEE'              ),
        MAG_NAMESPACE            => array( 1,    'NAMESPACE'              ),
+       MAG_NAMESPACEE           => array( 1,    'NAMESPACEE'             ),
+       MAG_FULLPAGENAME         => array( 1,    'FULLPAGENAME'           ),
+       MAG_FULLPAGENAMEE        => array( 1,    'FULLPAGENAMEE'          ),
        MAG_MSG                  => array( 0,    'MSG:'                   ),
        MAG_SUBST                => array( 0,    'SUBST:'                 ),
        MAG_MSGNW                => array( 0,    'MSGNW:'                 ),
@@ -236,6 +252,10 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_PLURAL               => array( 0,    'PLURAL:'                ),
        MAG_FULLURL              => array( 0,    'FULLURL:'               ),
        MAG_FULLURLE             => array( 0,    'FULLURLE:'              ),
+       MAG_LCFIRST              => array( 0,    'LCFIRST:'               ),
+       MAG_UCFIRST              => array( 0,    'UCFIRST:'               ),
+       MAG_LC                   => array( 0,    'LC:'                    ),
+       MAG_UC                   => array( 0,    'UC:'                    ),
 );
 
 #-------------------------------------------------------------------
@@ -249,10 +269,6 @@ $wgLanguageNamesEn =& $wgLanguageNames;
 global $wgRightsText;
 
 /* private */ $wgAllMessagesEn = array(
-
-# The navigation toolbar, int: is used here to make sure that the appropriate
-# messages are automatically pulled from the user-selected language file.
-
 /*
 The sidebar for MonoBook is generated from this message, lines that do not
 begin with * or ** are discarded, furthermore lines that do begin with ** and
@@ -277,7 +293,7 @@ parent class in order maintain consistency across languages.
 ',
 
 # User preference toggles
-'tog-underline' => 'Underline links',
+'tog-underline' => 'Underline links:',
 'tog-highlightbroken' => 'Format broken links <a href="" class="new">like this</a> (alternative: like this<a href="" class="internal">?</a>).',
 'tog-justify'  => 'Justify paragraphs',
 'tog-hideminor' => 'Hide minor edits in recent changes',
@@ -303,6 +319,7 @@ parent class in order maintain consistency across languages.
 'tog-fancysig' => 'Raw signatures (without automatic link)',
 'tog-externaleditor' => 'Use external editor by default',
 'tog-externaldiff' => 'Use external diff by default',
+'tog-showjumplinks' => 'Enable "jump to" accessibility links',
 
 'underline-always' => 'Always',
 'underline-never' => 'Never',
@@ -344,6 +361,7 @@ parent class in order maintain consistency across languages.
 'dec' => 'Dec',
 # Bits of text used by many pages:
 #
+'categories1' => 'Category',
 'categories' => 'Categories',
 'category' => 'category',
 'category_header' => 'Articles in category "$1"',
@@ -437,6 +455,7 @@ parent class in order maintain consistency across languages.
 'viewtalkpage' => 'View discussion',
 'otherlanguages' => 'In other languages',
 'redirectedfrom' => '(Redirected from $1)',
+'redirectpagesub' => 'Redirect page',
 'lastmodified' => 'This page was last modified $1.',
 'viewcount'            => 'This page has been accessed $1 times.',
 'copyright'    => 'Content is available under $1.',
@@ -444,6 +463,9 @@ parent class in order maintain consistency across languages.
 'printsubtitle' => '(From {{SERVER}})',
 'protectedpage' => 'Protected page',
 'administrators' => 'Project:Administrators',
+'jumpto' => 'Jump to:',
+'jumptonavigation' => 'navigation',
+'jumptosearch' => 'search',
 
 'sysoptitle'   => 'Sysop access required',
 'sysoptext'            => 'The action you have requested can only be
@@ -463,6 +485,8 @@ See $1.',
 'versionrequiredtext' => 'Version $1 of MediaWiki is required to use this page. See [[Special:Version]]',
 
 'nbytes'               => '$1 bytes',
+'ncategories'          => '$1 categories',
+'nrevisions'           => '$1 revisions',
 'widthheight'          => '$1x$2',
 'ok'                   => 'OK',
 'sitetitle'            => '{{SITENAME}}',
@@ -599,9 +623,10 @@ Your account has been created. Don't forget to change your {{SITENAME}} preferen
 'username'             => 'Username: ',
 'uid'                  => 'User ID: ',
 'yourrealname'         => 'Real name *',
-'yourlanguage' => 'Language',
+'yourlanguage' => 'Language:',
 'yourvariant'  => 'Variant',
-'yournick'             => 'Nickname',
+'yournick'             => 'Nickname:',
+'badsig'               => 'Invalid raw signature; check HTML tags.',
 'email'                        => 'Email',
 'emailforlost'         => "Fields marked with superscripts 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.",
@@ -715,9 +740,12 @@ If you are here by mistake, just click your browser's '''back''' button.",
 'userjspreview' => "'''Remember that you are only testing/previewing your user JavaScript, it has not yet been saved!'''",
 'updated'              => '(Updated)',
 'note'                 => '<strong>Note:</strong> ',
-'previewnote'  => 'This is only a preview, changes have not yet been saved!',
+'previewnote'  => '<strong>This is only a preview; changes have not yet been saved!</strong>',
+'session_fail_preview' => '<strong>Sorry! We could not process your edit due to a loss of session data. 
+Please try again. If it still doesn\'t work, try logging out and logging back in.</strong>',
 'previewconflict' => 'This preview reflects the text in the upper
 text editing area as it will appear if you choose to save.',
+'importing'            => "Importing $1",
 'editing'              => "Editing $1",
 'editingsection'               => "Editing $1 (section)",
 'editingcomment'               => "Editing $1 (comment)",
@@ -856,6 +884,7 @@ $2 List redirects &nbsp; Search for $3 $9",
 'skin'                 => 'Skin',
 'math'                 => 'Math',
 'dateformat'           => 'Date format',
+'datedefault'          => 'No preference',
 'datetime'             => 'Date and time',
 'math_failure'         => 'Failed to parse',
 'math_unknown_error'   => 'unknown error',
@@ -869,20 +898,20 @@ $2 List redirects &nbsp; Search for $3 $9",
 'prefs-personal' => 'User profile',
 'prefs-rc' => 'Recent changes',
 'prefs-misc' => 'Misc',
-'saveprefs'            => 'Save Preferences',
+'saveprefs'            => 'Save',
 'resetprefs'   => 'Reset',
-'oldpassword'  => 'Old password',
-'newpassword'  => 'New password',
-'retypenew'            => 'Retype new password',
+'oldpassword'  => 'Old password:',
+'newpassword'  => 'New password:',
+'retypenew'            => 'Retype new password:',
 'textboxsize'  => 'Editing',
-'rows'                 => 'Rows',
-'columns'              => 'Columns',
+'rows'                 => 'Rows:',
+'columns'              => 'Columns:',
 'searchresultshead' => 'Search',
-'resultsperpage' => 'Hits per page',
-'contextlines' => 'Lines per hit',
-'contextchars' => 'Context per line',
-'stubthreshold' => 'Threshold for stub display',
-'recentchangescount' => 'Titles in recent changes',
+'resultsperpage' => 'Hits per page:',
+'contextlines' => 'Lines per hit:',
+'contextchars' => 'Context per line:',
+'stubthreshold' => 'Threshold for stub display:',
+'recentchangescount' => 'Titles in recent changes:',
 'savedprefs'   => 'Your preferences have been saved.',
 'timezonelegend' => 'Time zone',
 'timezonetext' => 'The number of hours your local time differs from server time (UTC).',
@@ -890,7 +919,7 @@ $2 List redirects &nbsp; Search for $3 $9",
 'timezoneoffset' => 'Offset¹',
 'servertime'   => 'Server time',
 'guesstimezone' => 'Fill in from browser',
-'emailflag'            => 'Disable email from other users',
+'allowemail'           => 'Enable email from other users',
 'defaultns'            => 'Search in these namespaces by default:',
 'default'              => 'default',
 'files'                        => 'Files',
@@ -1012,7 +1041,7 @@ To include the image in a page, use a link in the form
 'copyrightpage' => "Project:Copyrights",
 'copyrightpagename' => "{{SITENAME}} copyright",
 'uploadedfiles'        => 'Uploaded files',
-'ignorewarning'        => 'Ignore warning and save file anyway.',
+'ignorewarnings'       => 'Ignore any warnings',
 'minlength'            => 'File names must be at least three letters.',
 'illegalfilename'      => 'The filename "$1" contains characters that are not allowed in page titles. Please rename the file and try uploading it again.',
 'badfilename'  => 'File name has been changed to "$1".',
@@ -1038,7 +1067,7 @@ created and by whom, and anything else you may know about it. If this is an imag
 'sourcefilename' => 'Source filename',
 'destfilename' => 'Destination filename',
 
-'license' => 'Licensing',      
+'license' => 'Licensing',
 'nolicense' => 'None selected',
 
 # Image list
@@ -1109,6 +1138,7 @@ That comes to '''$5''' average edits per page, and '''$6''' views per edit.",
 'disambiguationstext'  => "The following pages link to a <i>disambiguation page</i>. They should link to the appropriate topic instead.<br />A page is treated as disambiguation if it is linked from $1.<br />Links from other namespaces are <i>not</i> listed here.",
 'doubleredirects'      => 'Double redirects',
 'doubleredirectstext'  => "Each row contains links to the first and second redirect, as well as the first line of the second redirect text, usually giving the \"real\" target page, which the first redirect should point to.",
+'doubleredirectsarrow' => '→',
 'brokenredirects'      => 'Broken Redirects',
 'brokenredirectstext'  => 'The following redirects link to a non-existing pages.',
 'selflinks'            => 'Pages with Self Links',
@@ -1124,7 +1154,6 @@ That comes to '''$5''' average edits per page, and '''$6''' views per edit.",
 # Miscellaneous special pages
 #
 'orphans'              => 'Orphaned pages',
-'geo'          => 'GEO coordinates',
 'validate'             => 'Validate page',
 'lonelypages'  => 'Orphaned pages',
 'uncategorizedpages'   => 'Uncategorized pages',
@@ -1133,9 +1162,11 @@ That comes to '''$5''' average edits per page, and '''$6''' views per edit.",
 'unusedimages' => 'Unused files',
 'popularpages' => 'Popular pages',
 'nviews'               => '$1 views',
+'wantedcategories' => 'Wanted categories',
 'wantedpages'  => 'Wanted pages',
 'mostlinked'   => 'Most linked to pages',
-'mostcategories' => 'Most linked to categories',
+'mostlinkedcategories' => 'Most linked to categories',
+'mostcategories' => 'Articles with the most categories',
 'mostimages'   => 'Most linked to images',
 'mostrevisions' => 'Articles with the most revisions',
 'nlinks'               => '$1 links',
@@ -1192,6 +1223,7 @@ You can narrow down the view by selecting a log type, the user name, or the affe
 'allpagesprev'         => 'Previous',
 'allpagesnext'         => 'Next',
 'allpagessubmit'       => 'Go',
+'allpagesprefix'       => 'Display pages with prefix:',
 
 # E this user
 #
@@ -1369,7 +1401,7 @@ before deletion. The actual text of these deleted revisions is only available to
 'undeletebtn' => 'Restore!',
 'undeletedarticle' => "restored \"[[$1]]\"",
 'undeletedrevisions' => "$1 revisions restored",
-'undeletedtext'   => "[[$1]] has been successfully restored.
+'undeletedtext'   => "[[:$1|$1]] has been successfully restored.
 See [[Special:Log/delete]] for a record of recent deletions and restorations.",
 
 # Namespace form on various pages
@@ -1543,6 +1575,9 @@ Type the name of the user in the box and press the button to make the user an ad
 'val_validated' => 'Validation done.',
 'val_article_lists' => 'List of validated articles',
 'val_page_validation_statistics' => 'Page validation statistics for $1',
+'val_max_topics' => 'Maximum number of $1 topics reached',
+'val_no_topics_defined' => 'No topics defined',
+'val_no_topics_defined_text' => 'You have no topics defined which can be rated. Go to [[Special:Validate]], and have an administrator run the "Manage" function to add at least one topic and point range.',
 
 # Move page
 #
@@ -1589,8 +1624,8 @@ title. Please merge them manually.'''",
 'movetalk'             => 'Move "talk" page as well, if applicable.',
 'talkpagemoved' => 'The corresponding talk page was also moved.',
 'talkpagenotmoved' => 'The corresponding talk page was <strong>not</strong> moved.',
-'1movedto2'            => '$1 moved to $2',
-'1movedto2_redir' => '$1 moved to $2 over redirect',
+'1movedto2'            => '[[$1]] moved to [[$2]]',
+'1movedto2_redir' => '[[$1]] moved to [[$2]] over redirect',
 'movelogpage' => 'Move log',
 'movelogpagetext' => 'Below is a list of page moved.',
 'movereason'   => 'Reason',
@@ -1612,12 +1647,11 @@ set of pages wrapped in some XML. In the future, this may then be imported into
 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
+To export 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
-article [[Train]].
+In the latter case you can also use a link, e.g. [[{{ns:Special}}:Export/{{Mediawiki:mainpage}}]] for the page {{Mediawiki:mainpage}}.
 ',
 'exportcuronly'        => 'Include only the current revision, not the full history',
 
@@ -1646,6 +1680,8 @@ article [[Train]].
 'importsuccess'        => 'Import succeeded!',
 'importhistoryconflict' => 'Conflicting history revision exists (may have imported this page before)',
 'importnosources' => 'No transwiki import sources have been defined and direct history uploads are disabled.',
+'importnofile' => 'No import file was uploaded.',
+'importuploaderror' => 'Upload of import file failed; perhaps the file is bigger than the allowed upload size.',
 
 # Keyboard access keys for power users
 'accesskey-search' => 'f',
@@ -2163,6 +2199,13 @@ Please confirm that really want to recreate this article.',
 
 'unit-pixel' => 'px',
 
+# HTML dump
+'redirectingto' => 'Redirecting to [[$1]]...',
+
+# action=purge
+'confirm_purge' => "Clear the cache of this page?\n\n$1",
+'confirm_purge_button' => 'OK',
+
 );
 
 /* a fake language converter */
@@ -2436,17 +2479,23 @@ class Language {
         * [...]
         *</code>
         *
-        * @param bool $usePrefs: if false, the site/language default is used
+        * @param mixed $usePrefs: if true, the user's preference is used
+        *                         if false, the site/language default is used
+        *                         if int/string, assumed to be a format.
         * @return string
         */
        function dateFormat( $usePrefs = true ) {
                global $wgUser, $wgAmericanDates;
 
-               if( $usePrefs ) {
-                       $datePreference = $wgUser->getOption( 'date' );
+               if( is_bool( $usePrefs ) ) {
+                       if( $usePrefs ) {
+                               $datePreference = $wgUser->getOption( 'date' );
+                       } else {
+                               $options = $this->getDefaultUserOptions();
+                               $datePreference = (string)$options['date'];
+                       }
                } else {
-                       $options = $this->getDefaultUserOptions();
-                       $datePreference = (string)$options['date'];
+                       $datePreference = (string)$usePrefs;
                }
 
                if( $datePreference == MW_DATE_DEFAULT || $datePreference == '' ) {
@@ -2461,7 +2510,7 @@ class Language {
         *               date('YmdHis') format with wfTimestamp(TS_MW,$ts)
         * @param bool   $adj whether to adjust the time output according to the
         *               user configured offset ($timecorrection)
-        * @param bool   $format true to use user's date format preference
+        * @param mixed  $format true to use user's date format preference
         * @param string $timecorrection the time offset as returned by
         *               validateTimeZone() in Special:Preferences
         * @return string
@@ -2473,8 +2522,8 @@ class Language {
 
                $datePreference = $this->dateFormat( $format );
 
-               $month = $this->getMonthName( substr( $ts, 4, 2 ) );
-               $day = $this->formatNum( 0 + substr( $ts, 6, 2 ) );
+               $month = $this->formatMonth( substr( $ts, 4, 2 ), $datePreference );
+               $day = $this->formatDay( substr( $ts, 6, 2 ), $datePreference );
                $year = $this->formatNum( substr( $ts, 0, 4 ), true );
 
                switch( $datePreference ) {
@@ -2491,7 +2540,7 @@ class Language {
        *               date('YmdHis') format with wfTimestamp(TS_MW,$ts)
        * @param bool   $adj whether to adjust the time output according to the
        *               user configured offset ($timecorrection)
-       * @param bool   $format true to use user's date format preference
+       * @param mixed  $format true to use user's date format preference
        * @param string $timecorrection the time offset as returned by
        *               validateTimeZone() in Special:Preferences
        * @return string
@@ -2501,13 +2550,53 @@ class Language {
 
                if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
                $datePreference = $this->dateFormat( $format );
-
-               $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
+               
+               $sep = ($datePreference == MW_DATE_ISO)
+                       ? ':'
+                       : $this->timeSeparator( $format );
+               
+               $t = substr( $ts, 8, 2 ) . $sep . substr( $ts, 10, 2 );
 
                if ( $datePreference == MW_DATE_ISO ) {
-                       $t .= ':' . substr( $ts, 12, 2 );
+                       $t .= $sep . substr( $ts, 12, 2 );
                }
-               return $this->formatNum( $t );
+               return $t;
+       }
+       
+       /**
+        * Default separator character between hours, minutes, and seconds.
+        * Will be used by Language::time() for non-ISO formats.
+        * (ISO will always use a colon.)
+        * @return string
+        */
+       function timeSeparator( $format ) {
+               return ':';
+       }
+       
+       /**
+        * String to insert between the time and the date in a combined
+        * string. Should include any relevant whitespace.
+        * @return string
+        */
+       function timeDateSeparator( $format ) {
+               return ', ';
+       }
+       
+       /**
+        * Return true if the time should display before the date.
+        * @return bool
+        * @access private
+        */
+       function timeBeforeDate() {
+               return true;
+       }
+
+       function formatMonth( $month, $format ) {
+               return $this->getMonthName( $month );
+       }
+       
+       function formatDay( $day, $format ) {
+               return $this->formatNum( 0 + $day );
        }
 
        /**
@@ -2516,7 +2605,7 @@ class Language {
        *               date('YmdHis') format with wfTimestamp(TS_MW,$ts)
        * @param bool   $adj whether to adjust the time output according to the
        *               user configured offset ($timecorrection)
-       * @param bool   $format true to use user's date format preference
+       * @param mixed  $format true to use user's date format preference
        * @param string $timecorrection the time offset as returned by
        *               validateTimeZone() in Special:Preferences
        * @return string
@@ -2528,8 +2617,13 @@ class Language {
                switch ( $datePreference ) {
                        case MW_DATE_ISO: return $this->date( $ts, $adj, $format, $timecorrection ) . ' ' .
                                $this->time( $ts, $adj, $format, $timecorrection );
-                       default: return $this->time( $ts, $adj, $format, $timecorrection ) . ', ' .
-                               $this->date( $ts, $adj, $format, $timecorrection );
+                       default:
+                               $time = $this->time( $ts, $adj, $format, $timecorrection );
+                               $sep = $this->timeDateSeparator( $datePreference );
+                               $date = $this->date( $ts, $adj, $format, $timecorrection );
+                               return $this->timeBeforeDate( $datePreference )
+                                       ? $time . $sep . $date
+                                       : $date . $sep . $time;
                }
        }
 
@@ -2553,10 +2647,18 @@ class Language {
                return ucfirst( $string );
        }
 
+       function uc( $str ) {
+               return strtoupper( $str );
+       }
+
        function lcfirst( $s ) {
                return strtolower( $s{0} ). substr( $s, 1 );
        }
 
+       function lc( $str ) {
+               return strtolower( $str );
+       }
+
        function checkTitleEncoding( $s ) {
                global $wgInputEncoding;
 
@@ -2677,6 +2779,9 @@ class Language {
        # Fill a MagicWord object with data from here
        function getMagic( &$mw ) {
                $raw = $this->getMagicWords();
+
+               wfRunHooks( 'LanguageGetMagic', array( &$raw ) );
+               
                if( !isset( $raw[$mw->mId] ) ) {
                        # Fall back to English if local list is incomplete
                        $raw =& Language::getMagicWords();