* Save Preferences => Save
[lhc/web/wiklou.git] / languages / Language.php
index 666b838..419445c 100644 (file)
@@ -110,11 +110,11 @@ if(isset($wgExtraNamespaces)) {
 # Whether to use user or default setting in Language::date()
 
 /* private */ $wgDateFormatsEn = array(
-       'No preference',
-       '16:12, January 15, 2001',
-       '16:12, 15 January 2001',
-       '16:12, 2001 January 15',
-       'ISO 8601' => '2001-01-15 16:12:34'
+       MW_DATE_DEFAULT => 'No preference',
+       MW_DATE_MDY => '16:12, January 15, 2001',
+       MW_DATE_DMY => '16:12, 15 January 2001',
+       MW_DATE_YMD => '16:12, 2001 January 15',
+       MW_DATE_ISO => '2001-01-15 16:12:34'
 );
 
 /* private */ $wgUserTogglesEn = array(
@@ -188,7 +188,7 @@ $wgLanguageNamesEn =& $wgLanguageNames;
 #
 /* private */ $wgMagicWordsEn = array(
 #   ID                                 CASE  SYNONYMS
-       MAG_REDIRECT             => array( 0,    '#redirect'              ),
+       MAG_REDIRECT             => array( 0,    '#REDIRECT'              ),
        MAG_NOTOC                => array( 0,    '__NOTOC__'              ),
        MAG_FORCETOC             => array( 0,    '__FORCETOC__'           ),
        MAG_TOC                  => array( 0,    '__TOC__'                ),
@@ -233,6 +233,9 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_CURRENTWEEK          => array( 1,    'CURRENTWEEK'            ),
        MAG_CURRENTDOW           => array( 1,    'CURRENTDOW'             ),
        MAG_REVISIONID           => array( 1,    'REVISIONID'             ),
+       MAG_PLURAL               => array( 0,    'PLURAL:'                ),
+       MAG_FULLURL              => array( 0,    'FULLURL:'               ),
+       MAG_FULLURLE             => array( 0,    'FULLURLE:'              ),
 );
 
 #-------------------------------------------------------------------
@@ -292,9 +295,9 @@ parent class in order maintain consistency across languages.
 'tog-previewontop' => 'Show preview before edit box',
 'tog-previewonfirst' => 'Show preview on first edit',
 'tog-nocache' => 'Disable page caching',
-'tog-enotifwatchlistpages'     => 'Send me an email on page changes',
-'tog-enotifusertalkpages'      => 'Send me an email when my user talk page is changed',
-'tog-enotifminoredits'                 => 'Send me an email also for minor edits of pages',
+'tog-enotifwatchlistpages'     => 'Email me on page changes',
+'tog-enotifusertalkpages'      => 'Email me when my user talk page is changed',
+'tog-enotifminoredits'                 => 'Email me also for minor edits of pages',
 'tog-enotifrevealaddr'                 => 'Reveal my email address in notification mails',
 'tog-shownumberswatching'      => 'Show the number of watching users',
 'tog-fancysig' => 'Raw signatures (without automatic link)',
@@ -460,6 +463,7 @@ See $1.',
 'versionrequiredtext' => 'Version $1 of MediaWiki is required to use this page. See [[Special:Version]]',
 
 'nbytes'               => '$1 bytes',
+'widthheight'          => '$1x$2',
 'ok'                   => 'OK',
 'sitetitle'            => '{{SITENAME}}',
 'pagetitle'            => '$1 - {{SITENAME}}',
@@ -592,6 +596,8 @@ Your account has been created. Don't forget to change your {{SITENAME}} preferen
 'badretype'            => 'The passwords you entered do not match.',
 'userexists'   => 'The user name you entered is already in use. Please choose a different name.',
 'youremail'            => 'Email *',
+'username'             => 'Username: ',
+'uid'                  => 'User ID: ',
 'yourrealname'         => 'Real name *',
 'yourlanguage' => 'Language',
 'yourvariant'  => 'Variant',
@@ -615,9 +621,13 @@ Check your spelling, or use the form below to create a new user account.",
 'mailmypassword'       => 'Mail me a new password',
 'passwordremindertitle' => "Password reminder from {{SITENAME}}",
 'passwordremindertext' => "Someone (probably you, from IP address $1)
-requested that we send you a new {{SITENAME}} login password.
+requested that we send you a new {{SITENAME}} login password for {{SERVERNAME}}.
 The password for user \"$2\" is now \"$3\".
-You should log in and change your password now.",
+You should log in and change your password now.
+
+If someone else made this request or if you have remembered your password and
+you no longer wish to change it, you may ignore this message and continue using
+your old password.",
 'noemail'                          => "There is no e-mail address recorded for user \"$1\".",
 'passwordsent' => "A new password has been sent to the e-mail address
 registered for \"$1\".
@@ -631,8 +641,7 @@ to confirm that the account is actually yours.",
 'emailauthenticated'        => 'Your email address was authenticated on $1.',
 'emailnotauthenticated'     => 'Your email address is <strong>not yet authenticated</strong>. No email
 will be sent for any of the following features.',
-'noemailprefs'              => '<strong>No email address has been specified</strong>, the following
-features will not work.',
+'noemailprefs'              => '<strong>Specify an email address for these features to work.</strong>',
 'emailconfirmlink' => 'Confirm your e-mail address',
 'invalidemailaddress'  => 'The email address cannot be accepted as it appears to have an invalid
 format. Please enter a well-formatted address or empty that field.',
@@ -695,16 +704,18 @@ Your IP address is $3. Please include this address in any queries you make.
 To create the page, start typing in the box below
 (see the [[Project:Help|help page]] for more info).
 If you are here by mistake, just click your browser's '''back''' button.",
+'newarticletextanon' => '{{int:newarticletext}}',
 'talkpagetext' => '<!-- MediaWiki:talkpagetext -->',
 'anontalkpagetext' => "----''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical [[IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.'' ",
-'noarticletext' => '(There is currently no text in this page)',
+'noarticletext' => 'There is currently no text in this page, you can [[{{ns:special}}:Search/{{PAGENAME}}|search for this page title]] in other pages or [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} edit this page].',
+'noarticletextanon' => '{{int:noarticletext}}',
 'clearyourcache' => "'''Note:''' After saving, you may have to bypass your browser's cache to see the changes. '''Mozilla / Firefox / Safari:''' hold down ''Shift'' while clicking ''Reload'', or press ''Ctrl-Shift-R'' (''Cmd-Shift-R'' on Apple Mac); '''IE:''' hold ''Ctrl'' while clicking ''Refresh'', or press ''Ctrl-F5''; '''Konqueror:''': simply click the ''Reload'' button, or press ''F5''; '''Opera''' users may need to completely clear their cache in ''Tools&rarr;Preferences''.",
 'usercssjsyoucanpreview' => "<strong>Tip:</strong> Use the 'Show preview' button to test your new CSS/JS before saving.",
 'usercsspreview' => "'''Remember that you are only previewing your user CSS, it has not yet been saved!'''",
 'userjspreview' => "'''Remember that you are only testing/previewing your user JavaScript, it has not yet been saved!'''",
 'updated'              => '(Updated)',
 'note'                 => '<strong>Note:</strong> ',
-'previewnote'  => 'Remember that this is only a preview, and has not yet been saved!',
+'previewnote'  => 'This is only a preview, changes have not yet been saved!',
 'previewconflict' => 'This preview reflects the text in the upper
 text editing area as it will appear if you choose to save.',
 'editing'              => "Editing $1",
@@ -839,16 +850,13 @@ $2 List redirects &nbsp; Search for $3 $9",
 'preferences'  => 'Preferences',
 'prefsnologin' => 'Not logged in',
 'prefsnologintext'     => "You must be [[Special:Userlogin|logged in]] to set user preferences.",
-'prefslogintext' => "You are logged in as \"$1\".
-Your internal ID number is $2.
-
-See [[Project:User preferences help]] for help deciphering the options.",
 'prefsreset'   => 'Preferences have been reset from storage.',
 'qbsettings'   => 'Quickbar',
 'changepassword' => 'Change password',
 'skin'                 => 'Skin',
 'math'                 => 'Math',
 'dateformat'           => 'Date format',
+'datetime'             => 'Date and time',
 'math_failure'         => 'Failed to parse',
 'math_unknown_error'   => 'unknown error',
 'math_unknown_function'        => 'unknown function ',
@@ -858,8 +866,8 @@ See [[Project:User preferences help]] for help deciphering the options.",
 'math_bad_tmpdir'      => 'Can\'t write to or create math temp directory',
 'math_bad_output'      => 'Can\'t write to or create math output directory',
 'math_notexvc' => 'Missing texvc executable; please see math/README to configure.',
-'prefs-personal' => 'User data',
-'prefs-rc' => 'Recent changes & stubs',
+'prefs-personal' => 'User profile',
+'prefs-rc' => 'Recent changes',
 'prefs-misc' => 'Misc',
 'saveprefs'            => 'Save',
 'resetprefs'   => 'Reset',
@@ -882,7 +890,7 @@ See [[Project:User preferences help]] for help deciphering the options.",
 'timezoneoffset' => 'Offset¹',
 'servertime'   => 'Server time',
 'guesstimezone' => 'Fill in from browser',
-'emailflag'            => 'Disable e-mail from other users',
+'emailflag'            => 'Disable email from other users',
 'defaultns'            => 'Search in these namespaces by default:',
 'default'              => 'default',
 'files'                        => 'Files',
@@ -982,14 +990,10 @@ to upload files.",
 'uploaderror'  => 'Upload error',
 'uploadtext'   =>
 "
-Use the form below to upload new files,
+Use the form below to upload files,
 to view or search previously uploaded images
 go to the [[Special:Imagelist|list of uploaded files]],
-uploads and deletions are also logged in the [[Special:Log|project log]].
-
-You must also check the box affirming that you are not
-violating any copyrights by uploading the file.
-Press the \"Upload\" button to finish the upload.
+uploads and deletions are also logged in the [[Special:Log/upload|upload log]].
 
 To include the image in a page, use a link in the form
 '''<nowiki>[[{{ns:6}}:file.jpg]]</nowiki>''',
@@ -1017,6 +1021,8 @@ To include the image in a page, use a link in the form
 'largefileserver' => 'This file is bigger than the server is configured to allow.',
 'emptyfile'            => 'The file you uploaded seems to be empty. This might be due to a typo in the file name. Please check whether you really want to upload this file.',
 'fileexists'           => 'A file with this name exists already, please check $1 if you are not sure if you want to change it.',
+'fileexists-forbidden' => 'A file with this name exists already; please go back and upload this file under a new name. [[Image:$1|thumb|center|$1]]',
+'fileexists-shared-forbidden' => 'A file with this name exists already in the shared file repository; please go back and upload this file under a new name. [[Image:$1|thumb|center|$1]]',
 'successfulupload' => 'Successful upload',
 'fileuploaded' => "File $1 uploaded successfully.
 Please follow this link: $2 to the description page and fill
@@ -1033,7 +1039,7 @@ created and by whom, and anything else you may know about it. If this is an imag
 'destfilename' => 'Destination filename',
 
 'license' => 'Licensing',      
-'nolicense' => 'None',
+'nolicense' => 'None selected',
 
 # Image list
 #
@@ -1066,6 +1072,16 @@ this old version, (rev) = revert to this old version.
 'noimage-linktext'       => 'upload it',
 'uploadnewversion' => '[$1 Upload a new version of this file]',
 
+# Mime search
+#
+'mimesearch' => 'MIME search',
+'mimetype' => 'MIME type: ',
+'download' => 'download',
+
+# Unwatchedpages
+#
+'unwatchedpages' => 'Unwatched pages',
+
 # Statistics
 #
 'statistics'   => 'Statistics',
@@ -1119,6 +1135,9 @@ That comes to '''$5''' average edits per page, and '''$6''' views per edit.",
 'nviews'               => '$1 views',
 'wantedpages'  => 'Wanted pages',
 'mostlinked'   => 'Most linked to pages',
+'mostcategories' => 'Most linked to categories',
+'mostimages'   => 'Most linked to images',
+'mostrevisions' => 'Articles with the most revisions',
 'nlinks'               => '$1 links',
 'allpages'             => 'All pages',
 'prefixindex'   => 'Prefix index',
@@ -1514,7 +1533,7 @@ Type the name of the user in the box and press the button to make the user an ad
 'val_tab' => 'Validate',
 'val_this_is_current_version' => 'this is the latest version',
 'val_version_of' => "Version of $1" ,
-'val_table_header' => "<tr><th>Class</th>$1<th colspan=4>Opinion</th>$1<th>Comment</th></tr>\n",
+'val_table_header' => '<tr><th>Class</th>$1<th colspan="4">Opinion</th>$1<th>Comment</th></tr>\n',
 'val_stat_link_text' => 'Validation statistics for this article',
 'val_view_version' => 'View this revision',
 'val_validate_version' => 'Validate this version',
@@ -1925,7 +1944,7 @@ ta[\'ca-nstab-category\'] = new Array(\'c\',\'View the category page\');
 'exif-compression-1' => 'Uncompressed',
 'exif-compression-6' => 'JPEG',
 
-'exif-photometricinterpretation-1' => 'RGB',
+'exif-photometricinterpretation-2' => 'RGB',
 'exif-photometricinterpretation-6' => 'YCbCr',
 
 'exif-orientation-1' => 'Normal', // 0th row: top; 0th column: left
@@ -1981,7 +2000,7 @@ ta[\'ca-nstab-category\'] = new Array(\'c\',\'View the category page\');
 'exif-lightsource-3' => 'Tungsten (incandescent light)',
 'exif-lightsource-4' => 'Flash',
 'exif-lightsource-9' => 'Fine weather',
-'exif-lightsource-10' => 'Clody weather',
+'exif-lightsource-10' => 'Cloudy weather',
 'exif-lightsource-11' => 'Shade',
 'exif-lightsource-12' => 'Daylight fluorescent (D 5700 – 7100K)',
 'exif-lightsource-13' => 'Day white fluorescent (N 4600 – 5400K)',
@@ -2412,23 +2431,28 @@ class Language {
         * all children.
         *
         *<code>
-        * function timeanddate([...], $format = '0') {
+        * function timeanddate([...], $format = true) {
         *      $datePreference = $this->dateFormat($format);
         * [...]
         *</code>
         *
-        * @param mixed $format
+        * @param bool $usePrefs: if false, the site/language default is used
         * @return string
         */
-       function dateFormat( $format ) {
-               global $wgUser;
+       function dateFormat( $usePrefs = true ) {
+               global $wgUser, $wgAmericanDates;
 
-               if ( !$wgUser->isLoggedIn() || $format === false ) {
-                       $options = $this->getDefaultUserOptions();
-                       return (string)$options['date'];
+               if( $usePrefs ) {
+                       $datePreference = $wgUser->getOption( 'date' );
                } else {
-                       return $wgUser->getOption( 'date' );
+                       $options = $this->getDefaultUserOptions();
+                       $datePreference = (string)$options['date'];
+               }
+
+               if( $datePreference == MW_DATE_DEFAULT || $datePreference == '' ) {
+                       return $wgAmericanDates ? MW_DATE_MDY : MW_DATE_DMY;
                }
+               return $datePreference;
        }
 
        /**
@@ -2437,30 +2461,26 @@ 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 mixed  $format what format to return, if it's false output the
-        *               default one.
+        * @param bool   $format true to use user's date format preference
         * @param string $timecorrection the time offset as returned by
         *               validateTimeZone() in Special:Preferences
         * @return string
         */
        function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
-               global $wgAmericanDates, $wgUser;
+               global $wgUser;
 
                if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
 
-               $datePreference = $this->dateFormat($format);
-
-               if ($datePreference == '0'
-                   || $datePreference == '' ) {$datePreference = $wgAmericanDates ? '0' : '2';}
+               $datePreference = $this->dateFormat( $format );
 
                $month = $this->getMonthName( substr( $ts, 4, 2 ) );
                $day = $this->formatNum( 0 + substr( $ts, 6, 2 ) );
                $year = $this->formatNum( substr( $ts, 0, 4 ), true );
 
                switch( $datePreference ) {
-                       case '2': return "$day $month $year";
-                       case '3': return "$year $month $day";
-                       case 'ISO 8601': return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
+                       case MW_DATE_DMY: return "$day $month $year";
+                       case MW_DATE_YMD: return "$year $month $day";
+                       case MW_DATE_ISO: return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
                        default: return "$month $day, $year";
                }
        }
@@ -2471,23 +2491,20 @@ 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 mixed  $format what format to return, if it's false output the
-       *               default one (default true)
+       * @param bool   $format true to use user's date format preference
        * @param string $timecorrection the time offset as returned by
        *               validateTimeZone() in Special:Preferences
        * @return string
        */
        function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
-               global $wgUser, $wgAmericanDates;
+               global $wgUser;
 
                if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
-               $datePreference = $this->dateFormat($format);
-
-               if ($datePreference == '0') {$datePreference = $wgAmericanDates ? '0' : '2';}
+               $datePreference = $this->dateFormat( $format );
 
                $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
 
-               if ( $datePreference === 'ISO 8601' ) {
+               if ( $datePreference == MW_DATE_ISO ) {
                        $t .= ':' . substr( $ts, 12, 2 );
                }
                return $this->formatNum( $t );
@@ -2499,22 +2516,20 @@ 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 mixed  $format what format to return, if it's false output the
-       *               default one (default true)
+       * @param bool   $format true to use user's date format preference
        * @param string $timecorrection the time offset as returned by
        *               validateTimeZone() in Special:Preferences
        * @return string
        */
        function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) {
-               global $wgUser, $wgAmericanDates;
+               global $wgUser;
 
                $datePreference = $this->dateFormat($format);
-
                switch ( $datePreference ) {
-                       case 'ISO 8601': return $this->date( $ts, $adj, $datePreference, $timecorrection ) . ' ' .
-                               $this->time( $ts, $adj, $datePreference, $timecorrection );
-                       default: return $this->time( $ts, $adj, $datePreference, $timecorrection ) . ', ' .
-                               $this->date( $ts, $adj, $datePreference, $timecorrection );
+                       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 );
                }
        }
 
@@ -2780,6 +2795,27 @@ class Language {
                return $word;
        }
 
+       /**
+        * Plural form transformations, needed for some languages.
+        * For example, where are 3 form of plural in Russian and Polish,
+        * depending on "count mod 10". See [[w:Plural]]
+        * For English it is pretty simple.
+        *
+        * Invoked by putting {{plural:count|wordform1|wordform2}}
+        * or {{plural:count|wordform1|wordform2|wordform3}}
+        *
+        * Example: {{plural:{{NUMBEROFARTICLES}}|article|articles}} 
+        *
+        * @param integer $count
+        * @param string $wordform1
+        * @param string $wordform2
+        * @param string $wordform3 (optional)
+        * @return string
+        */
+       function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
+               return $count == 1 ? $wordform1 : $wordform2;
+       }
+
        /**
         * For translaing of expiry times
         * @param string The validated block time in English