Merge "mediawiki.toolbar: temporary workaround for T113868"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 28 Sep 2015 12:05:50 +0000 (12:05 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 28 Sep 2015 12:05:50 +0000 (12:05 +0000)
16 files changed:
includes/api/i18n/en.json
includes/specials/SpecialEditWatchlist.php
languages/classes/LanguageFi.php
languages/classes/LanguageUk.php
languages/i18n/en.json
languages/messages/MessagesAn.php
languages/messages/MessagesCa.php
languages/messages/MessagesEs.php
languages/messages/MessagesExt.php
mw-config/config.js
resources/src/mediawiki.action/mediawiki.action.view.categoryPage.less
resources/src/mediawiki.language/languages/uk.js
resources/src/mediawiki.legacy/shared.css
resources/src/mediawiki.special/mediawiki.special.css
tests/phpunit/languages/classes/LanguageUkTest.php
tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js

index 849cef8..009cc7b 100644 (file)
        "apihelp-query+alldeletedrevisions-param-namespace": "Only list pages in this namespace.",
        "apihelp-query+alldeletedrevisions-param-miser-user-namespace": "<strong>Note:</strong> Due to [[mw:Manual:$wgMiserMode|miser mode]], using <var>$1user</var> and <var>$1namespace</var> together may result in fewer than <var>$1limit</var> results returned before continuing; in extreme cases, zero results may be returned.",
        "apihelp-query+alldeletedrevisions-param-generatetitles": "When being used as a generator, generate titles rather than revision IDs.",
-       "apihelp-query+alldeletedrevisions-example-user": "List the last 50 deleted contributions by user <kbd>Example<kbd>.",
+       "apihelp-query+alldeletedrevisions-example-user": "List the last 50 deleted contributions by user <kbd>Example</kbd>.",
        "apihelp-query+alldeletedrevisions-example-ns-main": "List the first 50 deleted revisions in the main namespace.",
 
        "apihelp-query+allfileusages-description": "List all file usages, including non-existing.",
        "apihelp-query+backlinks-param-filterredir": "How to filter for redirects. If set to <kbd>nonredirects</kbd> when <var>$1redirect</var> is enabled, this is only applied to the second level.",
        "apihelp-query+backlinks-param-limit": "How many total pages to return. If <var>$1redirect</var> is enabled, the limit applies to each level separately (which means up to 2 * <var>$1limit</var> results may be returned).",
        "apihelp-query+backlinks-param-redirect": "If linking page is a redirect, find all pages that link to that redirect as well. Maximum limit is halved.",
-       "apihelp-query+backlinks-example-simple": "Show links to <kbd>Main page<kbd>.",
-       "apihelp-query+backlinks-example-generator": "Get information about pages linking to <kbd>Main page<kbd>.",
+       "apihelp-query+backlinks-example-simple": "Show links to <kbd>Main page</kbd>.",
+       "apihelp-query+backlinks-example-generator": "Get information about pages linking to <kbd>Main page</kbd>.",
 
        "apihelp-query+blocks-description": "List all blocked users and IP addresses.",
        "apihelp-query+blocks-param-start": "The timestamp to start enumerating from.",
        "apihelp-query+extlinks-param-protocol": "Protocol of the URL. If empty and <var>$1query</var> is set, the protocol is <kbd>http</kbd>. Leave both this and <var>$1query</var> empty to list all external links.",
        "apihelp-query+extlinks-param-query": "Search string without protocol. Useful for checking whether a certain page contains a certain external url.",
        "apihelp-query+extlinks-param-expandurl": "Expand protocol-relative URLs with the canonical protocol.",
-       "apihelp-query+extlinks-example-simple": "Get a list of external links on <kbd>Main Page<kbd>.",
+       "apihelp-query+extlinks-example-simple": "Get a list of external links on <kbd>Main Page</kbd>.",
 
        "apihelp-query+exturlusage-description": "Enumerate pages that contain a given URL.",
        "apihelp-query+exturlusage-param-prop": "Which pieces of information to include:",
index 5f87cf4..64a93a0 100644 (file)
@@ -71,6 +71,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
                $this->outputHeader();
                $this->outputSubtitle();
+               $out->addModuleStyles( 'mediawiki.special' );
 
                # B/C: $mode used to be waaay down the parameter list, and the first parameter
                # was $wgUser
index a96b0a9..bf09252 100644 (file)
@@ -42,8 +42,8 @@ class LanguageFi extends Language {
                        return $wgGrammarForms['fi'][$case][$word];
                }
 
-               # These rules are not perfect, but they are currently only used for site names so it doesn't
-               # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
+               # These rules don't cover the whole language.
+               # They are used only for site names.
 
                # wovel harmony flag
                $aou = preg_match( '/[aou][^äöy]*$/i', $word );
index 5215da0..8261f11 100644 (file)
@@ -42,8 +42,8 @@ class LanguageUk extends Language {
                        return $wgGrammarForms['uk'][$case][$word];
                }
 
-               # These rules are not perfect, but they are currently only used for site names so it doesn't
-               # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
+               # These rules don't cover the whole language.
+               # They are used only for site names.
 
                # join and array_slice instead mb_substr
                $ar = array();
@@ -51,40 +51,21 @@ class LanguageUk extends Language {
                if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) {
                        switch ( $case ) {
                                case 'genitive': # родовий відмінок
-                                       if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вікі' )
-                                               || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вікі' )
-                                       ) {
-                                       } elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ь' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'я';
-                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' ) {
+                                       if ( join( '', array_slice( $ar[0], -2 ) ) === 'ія' ) {
                                                $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ії';
-                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ка' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ки';
-                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ти' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'тей';
-                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ди' ) {
+                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) === 'ти' ) {
+                                               $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'т';
+                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) === 'ди' ) {
                                                $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'дів';
-                                       } elseif ( join( '', array_slice( $ar[0], -3 ) ) == 'ник' ) {
+                                       } elseif ( join( '', array_slice( $ar[0], -3 ) ) === 'ник' ) {
                                                $word = join( '', array_slice( $ar[0], 0, -3 ) ) . 'ника';
                                        }
                                        break;
-                               case 'dative':  # давальний відмінок
-                                       # stub
-                                       break;
                                case 'accusative': # знахідний відмінок
-                                       if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вікі' )
-                                               || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вікі' )
-                                       ) {
-                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' ) {
+                                       if ( join( '', array_slice( $ar[0], -2 ) ) === 'ія' ) {
                                                $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ію';
                                        }
                                        break;
-                               case 'instrumental':  # орудний відмінок
-                                       # stub
-                                       break;
-                               case 'prepositional': # місцевий відмінок
-                                       # stub
-                                       break;
                        }
                }
                return $word;
@@ -99,7 +80,11 @@ class LanguageUk extends Language {
         */
        function commafy( $_ ) {
                if ( !preg_match( '/^\-?\d{1,4}(\.\d+)?$/', $_ ) ) {
-                       return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
+                       return strrev( (string)preg_replace(
+                               '/(\d{3})(?=\d)(?!\d*\.)/',
+                               '$1,',
+                               strrev( $_ )
+                       ) );
                } else {
                        return $_;
                }
index 611dbd6..2159313 100644 (file)
        "deletepage": "Delete page",
        "confirm": "Confirm",
        "excontent": "content was: \"$1\"",
-       "excontentauthor": "content was: \"$1\" (and the only contributor was \"[[Special:Contributions/$2|$2]]\")",
+       "excontentauthor": "content was: \"$1\", and the only contributor was \"[[Special:Contributions/$2|$2]]\" ([[User talk:$2|talk]])",
        "exbeforeblank": "content before blanking was: \"$1\"",
        "delete-confirm": "Delete \"$1\"",
        "delete-legend": "Delete",
index def341b..ccf040a 100644 (file)
@@ -33,8 +33,11 @@ $namespaceAliases = array(
        'Espezial' => NS_SPECIAL,
 );
 
-// Remove Spanish gender aliases (bug T39090)
-$namespaceGenderAliases = array();
+// T113890: Setting $namespaceGenderAliases for Aragonese (an)
+$namespaceGenderAliases = array(
+       NS_USER => array( 'male' => 'Usuario', 'female' => 'Usuaria' ),
+       NS_USER_TALK => array( 'male' => 'Descusión_usuario', 'female' => 'Descusión_usuaria' ),
+);
 
 $magicWords = array(
        'redirect'                  => array( '0', '#ENDRECERA', '#REENDRECERA', '#REDIRECCIÓN', '#REDIRECCION', '#REDIRECT' ),
index 9169f97..acd6ce0 100644 (file)
@@ -32,6 +32,11 @@ $namespaceAliases = array(
        'Imatge_Discussió' => NS_FILE_TALK,
 );
 
+$namespaceGenderAliases = array(
+       NS_USER => array( 'male' => 'Usuari', 'female' => 'Usuària' ),
+       NS_USER_TALK => array( 'male' => 'Usuari_Discussió', 'female' => 'Usuària_Discussió' ),
+); // T113616
+
 $specialPageAliases = array(
        'Activeusers'               => array( 'Usuaris_actius' ),
        'Allmessages'               => array( 'Missatges', 'MediaWiki' ),
index dfd97f5..4e6c067 100644 (file)
@@ -29,13 +29,13 @@ $namespaceNames = array(
 
 $namespaceAliases = array(
        'Imagen' => NS_FILE,
-       'Imagen_Discusión' => NS_FILE_TALK,
+       'Imagen_discusión' => NS_FILE_TALK,
 );
 
 $namespaceGenderAliases = array(
        NS_USER => array( 'male' => 'Usuario', 'female' => 'Usuaria' ),
-       NS_USER_TALK => array( 'male' => 'Usuario_Discusión', 'female' => 'Usuaria_Discusión' ),
-);
+       NS_USER_TALK => array( 'male' => 'Usuario_discusión', 'female' => 'Usuaria_discusión' ),
+); // T113499
 
 $specialPageAliases = array(
        'Activeusers'               => array( 'UsuariosActivos' ),
index 1af959b..bc66a64 100644 (file)
@@ -8,7 +8,11 @@
  *
  */
 
+
+$fallback = 'es';
+
 $namespaceNames = array(
        NS_TEMPLATE         => 'Prantilla',
 );
 
+$namespaceGenderAliases = array();
index d2dc213..fb637f7 100644 (file)
                }
 
                // Set up the help system
-               $( '.mw-help-field-data' )
+               $( '.config-help-field-data' )
                        .hide()
-                       .closest( '.mw-help-field-container' )
-                               .find( '.mw-help-field-hint' )
+                       .closest( '.config-help-field-container' )
+                               .find( '.config-help-field-hint' )
                                        .show()
                                        .click( function () {
                                                $( this )
-                                                       .closest( '.mw-help-field-container' )
-                                                               .find( '.mw-help-field-data' )
+                                                       .closest( '.config-help-field-container' )
+                                                               .find( '.config-help-field-data' )
                                                                        .slideToggle( 'fast' );
                                        } );
 
index a22874b..138045c 100644 (file)
@@ -9,29 +9,24 @@ mediaWiki.language.convertGrammar = function ( word, form ) {
        }
        switch ( form ) {
                case 'genitive': // родовий відмінок
-                       if ( word.slice( -4 ) !== 'вікі' && word.slice( -4 ) !== 'Вікі' ) {
-                               if ( word.slice( -1 ) === 'ь' ) {
-                                       word = word.slice( 0, -1 ) + 'я';
-                               } else if ( word.slice( -2 ) === 'ія' ) {
-                                       word = word.slice( 0, -2 ) + 'ії';
-                               } else if ( word.slice( -2 ) === 'ка' ) {
-                                       word = word.slice( 0, -2 ) + 'ки';
-                               } else if ( word.slice( -2 ) === 'ти' ) {
-                                       word = word.slice( 0, -2 ) + 'тей';
-                               } else if ( word.slice( -2 ) === 'ды' ) {
-                                       word = word.slice( 0, -2 ) + 'дов';
-                               } else if ( word.slice( -3 ) === 'ник' ) {
-                                       word = word.slice( 0, -3 ) + 'ника';
-                               }
+                       if ( word.slice( -2 ) === 'ія' ) {
+                               word = word.slice( 0, -2 ) + 'ії';
+                       } else if ( word.slice( -2 ) === 'ти' ) {
+                               word = word.slice( 0, -2 ) + 'т';
+                       } else if ( word.slice( -2 ) === 'ди' ) {
+                               word = word.slice( 0, -2 ) + 'дів';
+                       } else if ( word.slice( -3 ) === 'ник' ) {
+                               word = word.slice( 0, -3 ) + 'ника';
                        }
+
                        break;
                case 'accusative': // знахідний відмінок
-                       if ( word.slice( -4 ) !== 'вікі' && word.slice( -4 ) !== 'Вікі' ) {
-                               if ( word.slice( -2 ) === 'ія' ) {
-                                       word = word.slice( 0, -2 ) + 'ію';
-                               }
+                       if ( word.slice( -2 ) === 'ія' ) {
+                               word = word.slice( 0, -2 ) + 'ію';
                        }
+
                        break;
        }
+
        return word;
 };
index 961c02b..dd37051 100644 (file)
@@ -116,16 +116,6 @@ abbr[title],
        unicode-bidi: isolate;
 }
 
-/**
- * Links to redirects appear italicized on [[Special:AllPages]], [[Special:PrefixIndex]],
- * [[Special:Watchlist/edit]] and in category listings.
- */
-.allpagesredirect,
-.redirect-in-category,
-.watchlistredir {
-       font-style: italic;
-}
-
 /* Comment portions of RC entries */
 span.comment {
        font-style: italic;
index a13ec3c..60544d3 100644 (file)
@@ -39,6 +39,9 @@ ul.mw-allpages-chunk li {
        vertical-align: top;
        width: 31%;
 }
+.allpagesredirect {
+       font-style: italic;
+}
 
 /* Special:BlockList */
 table.mw-blocklist span.mw-usertoollinks,
@@ -52,6 +55,11 @@ span.mw-blocklist-actions {
        font-weight: bold;
 }
 
+/* Special:EditWatchlist */
+.watchlistredir {
+       font-style: italic;
+}
+
 /* Special:EmailUser */
 td#mw-emailuser-sender,
 td#mw-emailuser-recipient {
index 9051bcf..5912df6 100644 (file)
@@ -69,4 +69,42 @@ class LanguageUkTest extends LanguageClassesTestCase {
                        array( 'other', 121 ),
                );
        }
+
+       /**
+        * @dataProvider providerGrammar
+        * @covers Language::convertGrammar
+        */
+       public function testGrammar( $result, $word, $case ) {
+               $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
+       }
+
+       public static function providerGrammar() {
+               return array(
+                       array(
+                               'Вікіпедії',
+                               'Вікіпедія',
+                               'genitive',
+                       ),
+                       array(
+                               'Віківидів',
+                               'Віківиди',
+                               'genitive',
+                       ),
+                       array(
+                               'Вікіцитат',
+                               'Вікіцитати',
+                               'genitive',
+                       ),
+                       array(
+                               'Вікіпідручника',
+                               'Вікіпідручник',
+                               'genitive',
+                       ),
+                       array(
+                               'Вікіпедію',
+                               'Вікіпедія',
+                               'accusative',
+                       ),
+               );
+       }
 }
index c71111f..b0ecd4e 100644 (file)
                ],
 
                uk: [
-                       {
-                               word: 'тесть',
-                               grammarForm: 'genitive',
-                               expected: 'тестя',
-                               description: 'Grammar test for genitive case'
-                       },
                        {
                                word: 'Вікіпедія',
                                grammarForm: 'genitive',
                                description: 'Grammar test for genitive case'
                        },
                        {
-                               word: 'установка',
-                               grammarForm: 'genitive',
-                               expected: 'установки',
-                               description: 'Grammar test for genitive case'
-                       },
-                       {
-                               word: 'похоти',
+                               word: 'Віківиди',
                                grammarForm: 'genitive',
-                               expected: 'поÑ\85оÑ\82ей',
+                               expected: 'Ð\92Ñ\96кÑ\96видÑ\96в',
                                description: 'Grammar test for genitive case'
                        },
                        {
-                               word: 'доводÑ\8b',
+                               word: 'Ð\92Ñ\96кÑ\96Ñ\86иÑ\82аÑ\82и',
                                grammarForm: 'genitive',
-                               expected: 'доводов',
+                               expected: 'Ð\92Ñ\96кÑ\96Ñ\86иÑ\82аÑ\82',
                                description: 'Grammar test for genitive case'
                        },
                        {
-                               word: 'пеÑ\81Ñ\87аник',
+                               word: 'Ð\92Ñ\96кÑ\96пÑ\96дÑ\80Ñ\83Ñ\87ник',
                                grammarForm: 'genitive',
-                               expected: 'пеÑ\81Ñ\87аника',
+                               expected: 'Ð\92Ñ\96кÑ\96пÑ\96дÑ\80Ñ\83Ñ\87ника',
                                description: 'Grammar test for genitive case'
                        },
                        {