RCFilters: Correct language for invert button
authorMoriel Schottlender <moriel@gmail.com>
Mon, 17 Jul 2017 22:38:32 +0000 (15:38 -0700)
committerMoriel Schottlender <moriel@gmail.com>
Mon, 17 Jul 2017 22:38:32 +0000 (15:38 -0700)
Bug: T166912
Change-Id: Iabbbe2c76d5dc51f2aa49646c84b8eba7bc692a1

languages/i18n/en.json
languages/i18n/qqq.json
resources/Resources.php
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuHeaderWidget.js

index 4d51c9e..64f9b7b 100644 (file)
        "rcfilters-tag-prefix-namespace": ":$1",
        "rcfilters-tag-prefix-namespace-inverted": "<strong>:not</strong> $1",
        "rcfilters-tag-prefix-tags": "#$1",
+       "rcfilters-exclude-button-off": "Exclude selected",
+       "rcfilters-exclude-button-on": "Excluding selected",
        "rcfilters-view-tags": "Tagged edits",
        "rcfilters-view-namespaces-tooltip": "Filter results by namespace",
        "rcfilters-view-tags-tooltip": "Filter results using edit tags",
index 44335fc..d98f8b0 100644 (file)
        "rcfilters-tag-prefix-namespace": "Prefix for the namespace tags in [[Special:RecentChanges]]. Namespace tags use a colon (:) as prefix. Please keep this format.\n\nParameters:\n* $1 - Filter name.",
        "rcfilters-tag-prefix-namespace-inverted": "Prefix for the namespace inverted tags in [[Special:RecentChanges]]. Namespace tags use a colon (:) as prefix. Please keep this format.\n\nParameters:\n* $1 - Filter name.\n{{Identical|Not}}",
        "rcfilters-tag-prefix-tags": "Prefix for the edit tags in [[Special:RecentChanges]]. Edit tags use a hash (#) as prefix. Please keep this format.\n\nParameters:\n* $1 - Tag display name.",
+       "rcfilters-exclude-button-off": "Title for the button that excludes selected namespaces, when it is not yet active.",
+       "rcfilters-exclude-button-on": "Title for the button that excludes selected namespaces, when it is not yet active.",
        "rcfilters-view-tags": "Title for the tags view in [[Special:RecentChanges]]\n{{Identical|Tag}}",
        "rcfilters-view-namespaces-tooltip": "Tooltip for the button that loads the namespace view in [[Special:RecentChanges]]",
        "rcfilters-view-tags-tooltip": "Tooltip for the button that loads the tags view in [[Special:RecentChanges]]",
index a8cf91d..afc1c0e 100644 (file)
@@ -1857,6 +1857,8 @@ return [
                        'rcfilters-tag-prefix-namespace',
                        'rcfilters-tag-prefix-namespace-inverted',
                        'rcfilters-tag-prefix-tags',
+                       'rcfilters-exclude-button-off',
+                       'rcfilters-exclude-button-on',
                        'rcfilters-view-tags',
                        'rcfilters-view-namespaces-tooltip',
                        'rcfilters-view-tags-tooltip',
index d0ad8d5..da71d70 100644 (file)
                // Invert namespaces button
                this.invertNamespacesButton = new OO.ui.ToggleButtonWidget( {
                        icon: '',
-                       label: mw.msg( 'invert' ),
                        classes: [ 'mw-rcfilters-ui-filterMenuHeaderWidget-invertNamespacesButton' ]
                } );
                this.invertNamespacesButton.toggle( this.model.getCurrentView() === 'namespaces' );
+               this.updateInvertButton( this.model.areNamespacesInverted() );
 
                // Events
                this.backButton.connect( this, { click: 'onBackButtonClick' } );
         * @param {boolean} isInverted Namespaces selection is inverted
         */
        mw.rcfilters.ui.FilterMenuHeaderWidget.prototype.onModelInvertChange = function ( isInverted ) {
+               this.updateInvertButton( isInverted );
+       };
+
+       /**
+        * Update the state of the invert button
+        *
+        * @param {boolean} isInverted Namespaces selection is inverted
+        */
+       mw.rcfilters.ui.FilterMenuHeaderWidget.prototype.updateInvertButton = function ( isInverted ) {
                this.invertNamespacesButton.setActive( isInverted );
+               this.invertNamespacesButton.setLabel(
+                       isInverted ?
+                               mw.msg( 'rcfilters-exclude-button-on' ) :
+                               mw.msg( 'rcfilters-exclude-button-off' )
+               );
        };
 
        mw.rcfilters.ui.FilterMenuHeaderWidget.prototype.onBackButtonClick = function () {