Jarry1250 has uploaded a new change for review.

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


Change subject: Readd formatMessageBeforeTable hook
......................................................................

Readd formatMessageBeforeTable hook

The hook has a PHP variant in MessageTable.php, but that is not
replicated in TUX at the moment.

Includes documentation.

Change-Id: I1080132bf5c85d70722bddf8fc977db8c41dc3dd
---
M hooks.txt
M resources/js/ext.translate.messagetable.js
2 files changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/hooks.txt b/hooks.txt
index 52894d5..77094a2 100644
--- a/hooks.txt
+++ b/hooks.txt
@@ -156,6 +156,9 @@
 ;beforeSubmit: Provides an opportunity to modify a Translate translation form 
immediately before it is submitted
  jQuery          form: The form being submitted
 
+;formatMessageBeforeTable: Provides an opportunity to manipulate the display 
of translation strings (messages) in the main table
+ object          message: The message object, with a range of useful (and 
manipulable) properties
+
 ;showTranslationHelpers: Provides an opportunity to handle custom translation 
helpers
  object                result.helpers: JSON subset focussing on the helpers 
returned e.g. result.helpers.definition
  jQuery                        translateEditor.$editor: The current 
translation-editing form
diff --git a/resources/js/ext.translate.messagetable.js 
b/resources/js/ext.translate.messagetable.js
index 7d223b4..bd9232f 100644
--- a/resources/js/ext.translate.messagetable.js
+++ b/resources/js/ext.translate.messagetable.js
@@ -126,6 +126,9 @@
                add: function ( message ) {
                        var $message;
 
+                       // Prepare the message for display
+                       mw.translateHooks.run( 'formatMessageBeforeTable', 
message );
+
                        if ( this.mode === 'translate' ) {
                                this.addTranslate( message );
 

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

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

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

Reply via email to