Amire80 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/232684

Change subject: Show "From/To any language" after selecting it in the 
translation list
......................................................................

Show "From/To any language" after selecting it in the translation list

Bug: T109590
Change-Id: I1d5cad6d778bb5f011a698f4fd3cb32443a1ba3e
---
M modules/dashboard/ext.cx.translationlist.js
1 file changed, 19 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/84/232684/1

diff --git a/modules/dashboard/ext.cx.translationlist.js 
b/modules/dashboard/ext.cx.translationlist.js
index 9ed86d1..2dde5da 100644
--- a/modules/dashboard/ext.cx.translationlist.js
+++ b/modules/dashboard/ext.cx.translationlist.js
@@ -403,22 +403,37 @@
                } );
 
                this.$sourceLanguageFilter.on( 'change', function () {
-                       var code = $( this ).val();
+                       var text,
+                               code = $( this ).val();
 
                        setFilter( 'sourceLanguage', code );
 
+                       if ( code === '' ) {
+                               text = mw.msg( 
'cx-translation-filter-from-any-language' );
+                       } else {
+                               text = $.uls.data.getAutonym( code );
+                       }
+
                        translationList.$sourceLanguageFilter
                                .siblings( 
'.translation-language-select-content' )
-                               .text( $.uls.data.getAutonym( code ) );
+                               .text( text );
                } );
 
                this.$targetLanguageFilter.on( 'change', function () {
-                       var code = $( this ).val();
+                       var text,
+                               code = $( this ).val();
 
                        setFilter( 'targetLanguage', code );
+
+                       if ( code === '' ) {
+                               text = mw.msg( 
'cx-translation-filter-to-any-language' );
+                       } else {
+                               text = $.uls.data.getAutonym( code );
+                       }
+
                        translationList.$targetLanguageFilter
                                .siblings( 
'.translation-language-select-content' )
-                               .text( $.uls.data.getAutonym( code ) );
+                               .text( text );
                } );
 
                this.$container.on( 'click', '.cx-discard-translation', 
function ( e ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/232684
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d5cad6d778bb5f011a698f4fd3cb32443a1ba3e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to