Santhosh has uploaded a new change for review.

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


Change subject: Allow insert from helper language
......................................................................

Allow insert from helper language

Change-Id: Ic950baf9b31e660d696ffa0f8ba287af3892db05
---
M resources/js/ext.translate.editor.helpers.js
1 file changed, 34 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/52/51352/1

diff --git a/resources/js/ext.translate.editor.helpers.js 
b/resources/js/ext.translate.editor.helpers.js
index 1f74da7..9b59c28 100644
--- a/resources/js/ext.translate.editor.helpers.js
+++ b/resources/js/ext.translate.editor.helpers.js
@@ -181,7 +181,10 @@
                 * @param {array} translations An inotherlanguages array as 
returned by the translation helpers API.
                 */
                showAssistantLanguages: function ( translations ) {
-                       var translateEditor = this;
+                       var translateEditor = this,
+                               $translationTextarea;
+
+                       $translationTextarea = this.$editor.find( 'textarea' );
 
                        $.each( translations, function ( index ) {
                                var $otherLanguage,
@@ -194,20 +197,37 @@
                                        .addClass( 'row in-other-language' )
                                        .append(
                                                $( '<div>' )
-                                                       .addClass( 'nine 
columns' )
-                                                       .attr( {
-                                                               lang: 
translation.language,
-                                                               dir: 
translationDir
-                                                       } )
-                                                       .text( 
translation.value ),
+                                               .addClass( 'row 
in-other-language-top' )
+                                               .append(
+                                                       $( '<div>' )
+                                                               .addClass( 
'nine columns' )
+                                                               .attr( {
+                                                                       lang: 
translation.language,
+                                                                       dir: 
translationDir
+                                                               } )
+                                                               .text( 
translation.value ),
+                                                       $( '<div>' )
+                                                               .addClass( 
'three columns language text-right' )
+                                                               .attr( {
+                                                                       lang: 
translation.language,
+                                                                       dir: 
translationDir
+                                                               } )
+                                                               .text( 
$.uls.data.getAutonym( translation.language ) )
+                                               ),
                                                $( '<div>' )
-                                                       .addClass( 'three 
columns language text-right' )
-                                                       .attr( {
-                                                               lang: 
translation.language,
-                                                               dir: 
translationDir
-                                                       } )
-                                                       .text( 
$.uls.data.getAutonym( translation.language ) )
-                               );
+                                               .addClass( 'row 
in-other-language-bottom' )
+                                               .append(
+                                                       $( '<a>' )
+                                                               .addClass( 
'nine columns use-this-translation' )
+                                                               .text( mw.msg( 
'tux-editor-use-this-translation' ) )
+                                                               .on( 'click', 
function () {
+                                                                       
$translationTextarea
+                                                                               
.val( translation.value )
+                                                                               
.focus()
+                                                                               
.trigger( 'input' );
+                                                               } )
+                                               )
+                                       );
 
                                translateEditor.$editor.find( 
'.in-other-languages-title' )
                                        .removeClass( 'hide' )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic950baf9b31e660d696ffa0f8ba287af3892db05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

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

Reply via email to