spamprotectiontext says, "You might want to check the following regular
[lhc/web/wiklou.git] / languages / Language.php
index bf0bfbd..a3dea4f 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+if( defined( "MEDIAWIKI" ) ) {
+
 #
 # In general you should not make customizations in these language files
 # directly, but should use the MediaWiki: special namespace to customize
@@ -40,7 +42,7 @@ if($wgMetaNamespace === FALSE)
        NS_TEMPLATE_TALK    => 'Template_talk',
        NS_HELP             => 'Help',
        NS_HELP_TALK        => 'Help_talk',
-       NS_CATEGORY         => 'Category',
+       NS_CATEGORY         => 'Category',
        NS_CATEGORY_TALK    => 'Category_talk'
 );
 
@@ -78,14 +80,13 @@ define( "MW_MATH_MATHML", 5 );
 
 # Validation types
 $wgValidationTypesEn = array (
-               "0" => "Style|Awful|Awesome|5",
-               "1" => "Legal|Illegal|Legal|5",
-               "2" => "Completeness|Stub|Extensive|5",
-               "3" => "Facts|Wild guesses|Solid as a rock|5",
-               "4" => "Suitable for 1.0 (paper)|No|Yes|2",
-               "5" => "Suitable for 1.0 (CD)|No|Yes|2"
-               ) ;
-
+       "0" => "Style|Awful|Awesome|5",
+       "1" => "Legal|Illegal|Legal|5",
+       "2" => "Completeness|Stub|Extensive|5",
+       "3" => "Facts|Wild guesses|Solid as a rock|5",
+       "4" => "Suitable for 1.0 (paper)|No|Yes|2",
+       "5" => "Suitable for 1.0 (CD)|No|Yes|2"
+);
 
 /* private */ $wgMathNamesEn = array(
        MW_MATH_PNG => 'mw_math_png',
@@ -96,6 +97,10 @@ $wgValidationTypesEn = array (
        MW_MATH_MATHML => 'mw_math_mathml'
 );
 
+# Whether to use user or default setting in Language::date()
+define( "MW_DATE_DEFAULT", false );
+define( "MW_DATE_USER_FORMAT", true );
+
 /* private */ $wgDateFormatsEn = array(
        'No preference',
        'January 15, 2001',
@@ -167,36 +172,37 @@ $wgLanguageNamesEn =& $wgLanguageNames;
 #
 /* private */ $wgMagicWordsEn = array(
 #   ID                                 CASE  SYNONYMS
-    MAG_REDIRECT             => array( 0,    '#redirect'              ),
-    MAG_NOTOC                => array( 0,    '__NOTOC__'              ),
-    MAG_FORCETOC             => array( 0,    '__FORCETOC__'           ),
-    MAG_TOC                  => array( 0,    '__TOC__'                ),
-    MAG_NOEDITSECTION        => array( 0,    '__NOEDITSECTION__'      ),
-    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'    ),
-               MAG_PAGENAME             => array( 1,    'PAGENAME'               ),
-               MAG_NAMESPACE            => array( 1,    'NAMESPACE'              ),
+       MAG_REDIRECT             => array( 0,    '#redirect'              ),
+       MAG_NOTOC                => array( 0,    '__NOTOC__'              ),
+       MAG_FORCETOC             => array( 0,    '__FORCETOC__'           ),
+       MAG_TOC                  => array( 0,    '__TOC__'                ),
+       MAG_NOEDITSECTION        => array( 0,    '__NOEDITSECTION__'      ),
+       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'    ),
+       MAG_PAGENAME             => array( 1,    'PAGENAME'               ),
+       MAG_PAGENAMEE            => array( 1,    'PAGENAMEE'              ),
+       MAG_NAMESPACE            => array( 1,    'NAMESPACE'              ),
        MAG_MSG                  => array( 0,    'MSG:'                   ),
        MAG_SUBST                => array( 0,    'SUBST:'                 ),
-    MAG_MSGNW                => array( 0,    'MSGNW:'                 ),
+       MAG_MSGNW                => array( 0,    'MSGNW:'                 ),
        MAG_END                  => array( 0,    '__END__'                ),
-    MAG_IMG_THUMBNAIL        => array( 1,    'thumbnail', 'thumb'     ),
-    MAG_IMG_RIGHT            => array( 1,    'right'                  ),
-    MAG_IMG_LEFT             => array( 1,    'left'                   ),
-    MAG_IMG_NONE             => array( 1,    'none'                   ),
-    MAG_IMG_WIDTH            => array( 1,    '$1px'                   ),
-    MAG_IMG_CENTER           => array( 1,    'center', 'centre'       ),
-    MAG_IMG_FRAMED          => array( 1,    'framed', 'enframed', 'frame' ),
-    MAG_INT                  => array( 0,    'INT:'                   ),
-    MAG_SITENAME             => array( 1,    'SITENAME'               ),
-    MAG_NS                   => array( 0,    'NS:'                    ),
+       MAG_IMG_THUMBNAIL        => array( 1,    'thumbnail', 'thumb'     ),
+       MAG_IMG_RIGHT            => array( 1,    'right'                  ),
+       MAG_IMG_LEFT             => array( 1,    'left'                   ),
+       MAG_IMG_NONE             => array( 1,    'none'                   ),
+       MAG_IMG_WIDTH            => array( 1,    '$1px'                   ),
+       MAG_IMG_CENTER           => array( 1,    'center', 'centre'       ),
+       MAG_IMG_FRAMED           => array( 1,    'framed', 'enframed', 'frame' ),
+       MAG_INT                  => array( 0,    'INT:'                   ),
+       MAG_SITENAME             => array( 1,    'SITENAME'               ),
+       MAG_NS                   => array( 0,    'NS:'                    ),
        MAG_LOCALURL             => array( 0,    'LOCALURL:'              ),
        MAG_LOCALURLE            => array( 0,    'LOCALURLE:'             ),
        MAG_SERVER               => array( 0,    'SERVER'                 )
@@ -220,6 +226,8 @@ $wgLanguageNamesEn =& $wgLanguageNames;
 
 
 /* private */ $wgAllMessagesEn = array(
+'special_version_prefix' => '',
+'special_version_postfix' => '',
 # User preference toggles
 'tog-hover'            => 'Show hoverbox over wiki links',
 'tog-underline' => 'Underline links',
@@ -499,7 +507,7 @@ Don't forget to change your {{SITENAME}} preferences.",
 
 'login'                        => 'Log in',
 'loginprompt'           => "You must have cookies enabled to log in to {{SITENAME}}.",
-'userlogin'            => 'Log in',
+'userlogin'            => 'Create an account or log in',
 'logout'               => 'Log out',
 'userlogout'   => 'Log out',
 'notloggedin'  => 'Not logged in',
@@ -795,9 +803,7 @@ from server time (UTC).',
 'rcnote'               => "Below are the last <strong>$1</strong> changes in last <strong>$2</strong> days.",
 'rcnotefrom'   => "Below are the changes since <b>$2</b> (up to <b>$1</b> shown).",
 'rclistfrom'   => "Show new changes starting from $1",
-# "rclinks"            => "Show last $1 changes in last $2 hours / last $3 days",
-# "rclinks"            => "Show last $1 changes in last $2 days.",
-'showhideminor' => "$1 minor edits | $2 bots | $3 logged in users ",
+'showhideminor' => "$1 minor edits | $2 bots | $3 logged in users | $4 patrolled edits ",
 'rclinks'              => "Show last $1 changes in last $2 days<br />$3",
 'rchide'               => "in $4 form; $1 minor edits; $2 secondary namespaces; $3 multiple edits.",
 'rcliu'                        => "; $1 edits from logged in users",
@@ -808,7 +814,7 @@ from server time (UTC).',
 'tableform'            => 'table',
 'listform'             => 'list',
 'nchanges'             => "$1 changes",
-'minoreditletter' => 'M',
+'minoreditletter' => 'm',
 'newpageletter' => 'N',
 
 # Upload
@@ -872,9 +878,11 @@ agrees to license it under the terms of the $1.",
 'noaffirmation' => 'You must affirm that your upload does not violate any copyrights.',
 'ignorewarning'        => 'Ignore warning and save file anyway.',
 'minlength'            => 'Image 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'  => "Image name has been changed to \"$1\".",
 'badfiletype'  => "\".$1\" is not a recommended image file format.",
 'largefile'            => 'It is recommended that images not exceed 100k in size.',
+'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.',
 'successfulupload' => 'Successful upload',
 'fileuploaded' => "File uploaded successfully.
@@ -956,6 +964,7 @@ That comes to '''$5''' average edits per page, and '''$6''' views per edit.",
 'geo'          => 'GEO coordinates',
 'validate'             => 'Validate page',
 'lonelypages'  => 'Orphaned pages',
+'uncategorizedpages'   => 'Uncategorized pages',
 'unusedimages' => 'Unused images',
 'popularpages' => 'Popular pages',
 'nviews'               => '$1 views',
@@ -1142,13 +1151,14 @@ See [[{{ns:4}}:Deletion_log]] for a record of recent deletions and restorations.
 
 # Contributions
 #
-'contributions'        => 'User contributions',
-'mycontris' => 'My contributions',
-'contribsub'   => "For $1",
-'nocontribs'   => 'No changes were found matching these criteria.',
-'ucnote'               => "Below are this user's last <b>$1</b> changes in the last <b>$2</b> days.",
-'uclinks'              => "View the last $1 changes; view the last $2 days.",
-'uctop'                => ' (top)' ,
+'contributions' => 'User contributions',
+'mycontris'     => 'My contributions',
+'contribsub'    => "For $1",
+'nocontribs'    => 'No changes were found matching these criteria.',
+'ucnote'        => "Below are this user's last <b>$1</b> changes in the last <b>$2</b> days.",
+'uclinks'       => "View the last $1 changes; view the last $2 days.",
+'uctop'         => ' (top)' ,
+'newbies'       => 'newbies',
 
 # What links here
 #
@@ -1283,6 +1293,9 @@ merging will fill in the other options with your previous settings.',
 'val_user_validations' => 'This user has validated $1 pages.',
 'val_no_anon_validation' => 'You have to be logged in to validate an article.',
 'val_validate_article_namespace_only' => 'Only articles can be validated. This page is <i>not</i> in the article namespace.',
+'val_validated' => 'Validation done.',
+'val_article_lists' => 'List of validated articles',
+'val_page_validation_statistics' => 'Page validation statistics for $1',
 
 # Move page
 #
@@ -1398,11 +1411,11 @@ amusement.',
 # Spam protection
 
 'spamprotectiontitle' => 'Spam protection filter',
-'spamprotectiontext' => 'The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site.
-
-You might want to check the following regular expression for patterns that are currently blocked:',
+'spamprotectiontext' => 'The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site.',
 'subcategorycount' => "There are $1 subcategories to this category.",
+'subcategorycount1' => "There is $1 subcategorie to this category.",
 'categoryarticlecount' => "There are $1 articles in this category.",
+'categoryarticlecount1' => "There is $1 article in this category.",
 'usenewcategorypage' => "1\n\nSet first character to \"0\" to disable the new category page layout.",
 
 # Info page
@@ -1414,12 +1427,21 @@ You might want to check the following regular expression for patterns that are c
 "numtalkauthors" => "Number of distinct authors (discussion page): $1",
 
 # Math options
-       'mw_math_png' => 'Always render PNG',
-       'mw_math_simple' => 'HTML if very simple or else PNG',
-       'mw_math_html' => 'HTML if possible or else PNG',
-       'mw_math_source' => 'Leave it as TeX (for text browsers)',
-       'mw_math_modern' => 'Recommended for modern browsers',
-       'mw_math_mathml' => 'MathML if possible (experimental)',
+'mw_math_png' => 'Always render PNG',
+'mw_math_simple' => 'HTML if very simple or else PNG',
+'mw_math_html' => 'HTML if possible or else PNG',
+'mw_math_source' => 'Leave it as TeX (for text browsers)',
+'mw_math_modern' => 'Recommended for modern browsers',
+'mw_math_mathml' => 'MathML if possible (experimental)',
+
+# Patrolling
+'markaspatrolleddiff'   => "Mark as patrolled",
+'markaspatrolledlink'   => "<div class='patrollink'>[$1]</div>",
+'markaspatrolledtext'   => "Mark this article as patrolled",
+'markedaspatrolled'     => "Marked as patrolled",
+'markedaspatrolledtext' => "The selected revision has been marked as patrolled.",
+'rcpatroldisabled'      => "Recent Changes Patrol disabled",
+'rcpatroldisabledtext'  => "The Recent Changes Patrol feature is currently disabled.",
 
 # Monobook.js: tooltips and access keys for monobook
 'Monobook.js' => '/* tooltips and access keys */
@@ -1634,14 +1656,18 @@ class Language {
                return date( 'YmdHis', $t );
        }
 
-       function date( $ts, $adj = false )
+       function date( $ts, $adj = false, $format = MW_DATE_USER_FORMAT )
        {
                global $wgAmericanDates, $wgUser, $wgUseDynamicDates;
 
                if ( $adj ) { $ts = $this->userAdjust( $ts ); }
-
                if ( $wgUseDynamicDates ) {
-                       $datePreference = $wgUser->getOption( 'date' );
+                       if ( $format == MW_DATE_USER_FORMAT ) {
+                               $datePreference = $wgUser->getOption( 'date' );
+                       } else {
+                               $options = $this->getDefaultUserOptions();
+                               $datePreference = $options['date'];
+                       }
                        if ( $datePreference == 0 ) {
                                $datePreference = $wgAmericanDates ? 1 : 2;
                        }
@@ -1671,9 +1697,9 @@ class Language {
                return $this->formatNum( $t );
        }
 
-       function timeanddate( $ts, $adj = false )
+       function timeanddate( $ts, $adj = false, $format = MW_DATE_USER_FORMAT )
        {
-               return $this->time( $ts, $adj ) . ', ' . $this->date( $ts, $adj );
+               return $this->time( $ts, $adj ) . ', ' . $this->date( $ts, $adj, $format );
        }
 
        function rfc1123( $ts )
@@ -1749,7 +1775,7 @@ class Language {
                # Some languages have special punctuation to strip out
                # or characters which need to be converted for MySQL's
                # indexing to grok it correctly. Make such changes here.
-               return $in;
+               return strtolower( $in );
        }
 
        function firstChar( $s ) {
@@ -1838,22 +1864,47 @@ class Language {
                return $number;
        }
 
-        function listToText( $l ) {
-               $s = '';
-               $m = count($l) - 1;
-               for ($i = $m; $i >= 0; $i--) {
-                   if ($i == $m) {
-                       $s = $l[$i];
-                   } else if ($i == $m - 1) {
-                       $s = $l[$i] . ' ' . $this->getMessage('and') . ' ' . $s;
-                   } else {
-                       $s = $l[$i] . ', ' . $s;
-                   }
+       function listToText( $l ) {
+               $s = '';
+               $m = count($l) - 1;
+               for ($i = $m; $i >= 0; $i--) {
+                       if ($i == $m) {
+                               $s = $l[$i];
+                       } else if ($i == $m - 1) {
+                               $s = $l[$i] . ' ' . $this->getMessage('and') . ' ' . $s;
+                       } else {
+                               $s = $l[$i] . ', ' . $s;
+                       }
+               }
+               return $s;
+       }
+
+       # Crop a string from the beginning or end to a certain number of bytes.
+       # (Bytes are used because our storage has limited byte lengths for some
+       # columns in the database.) Multibyte charsets will need to make sure that
+       # only whole characters are included!
+       #
+       # $length does not include the optional ellipsis.
+       # If $length is negative, snip from the beginning
+       function truncate( $string, $length, $ellipsis = "" ) {
+               if( $length == 0 ) {
+                       return $ellipsis;
+               }
+               if ( strlen( $string ) <= abs( $length ) ) {
+                       return $string;
+               }
+               if( $length > 0 ) {
+                       $string = substr( $string, 0, $length );
+                       return $string . $ellipsis;
+               } else {
+                       $string = substr( $string, $length );
+                       return $ellipsis . $string;
                }
-               return $s;
        }
 }
 
 # This should fail gracefully if there's not a localization available
 @include_once( 'Language' . ucfirst( $wgLanguageCode ) . '.php' );
+
+}
 ?>