jenkins-bot has submitted this change and it was merged.

Change subject: Handle message properties nicely
......................................................................


Handle message properties nicely

Change-Id: I1eee4c7cb9d4e9ebf46713ff941365a7502ce5aa
---
M resources/js/ext.translate.special.translationstash.js
1 file changed, 13 insertions(+), 2 deletions(-)

Approvals:
  Santhosh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/js/ext.translate.special.translationstash.js 
b/resources/js/ext.translate.special.translationstash.js
index a6e91ae..0b45cc6 100644
--- a/resources/js/ext.translate.special.translationstash.js
+++ b/resources/js/ext.translate.special.translationstash.js
@@ -25,7 +25,7 @@
                        mclanguage: language,
                        mcoffset: offset,
                        mclimit: limit,
-                       mcprop: 'definition|properties'
+                       mcprop: 'definition'
                } );
 
                return deferred.promise();
@@ -39,7 +39,13 @@
                        targetLanguage = $messageTable.data( 'targetlangcode' ),
                        targetLanguageDir = $.uls.data.getDir( targetLanguage ),
                        status = message.properties.status,
-                       statusClass = 'tux-status-' + status;
+                       statusClass = 'tux-status-' + status,
+                       statusMsg;
+
+                       if ( status === 'translated' ) {
+                               // tux-status-translated
+                               statusMsg = 'tux-status-' + status;
+                       }
 
                $messageWrapper = $( '<div>' )
                        .addClass( 'row tux-message' );
@@ -76,6 +82,7 @@
                                        .append(
                                                $( '<span>' )
                                                        .addClass( statusClass )
+                                                       .text( statusMsg ? 
mw.msg( statusMsg ) : '' )
                                        ),
                                $( '<div>' )
                                        .addClass( 'two column tux-list-edit 
text-right' )
@@ -109,9 +116,13 @@
                        .done( function ( result ) {
                                var messages = result.query.messagecollection;
                                $.each( messages, function ( index, message ) {
+                                       message.properties = {};
+                                       message.properties.status = 
'untranslated';
+
                                        message.group = messagegroup;
                                        if ( userTranslations[message.title] ) {
                                                message.translation = 
userTranslations[message.title].value;
+                                               message.properties.status = 
'translated';
                                        }
 
                                        addMessage( message );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1eee4c7cb9d4e9ebf46713ff941365a7502ce5aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to