Jarry1250 has uploaded a new change for review.

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

Change subject: Modify TranslateTranslationAids so it does something useful
......................................................................

Modify TranslateTranslationAids so it does something useful

At the moment, it just adds the hook to documentation but doesn't
actually implement it i.e. it's as useful as a chocolate teapot.

Although this is technically a breaking change, I find it hard to imagine
that any code was relying on this semi-functional hook.

Change-Id: I0255847c207682aa115340e906268ab9d8e1690c
---
M api/ApiQueryTranslationAids.php
M hooks.txt
M translationaids/TranslationAid.php
3 files changed, 2 insertions(+), 3 deletions(-)


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

diff --git a/api/ApiQueryTranslationAids.php b/api/ApiQueryTranslationAids.php
index c44fcc0..60a996c 100644
--- a/api/ApiQueryTranslationAids.php
+++ b/api/ApiQueryTranslationAids.php
@@ -78,8 +78,6 @@
 
        public function getAllowedParams() {
                $props = array_keys( TranslationAid::getTypes() );
-               wfRunHooks( 'TranslateTranslationAids', array( &$props ) );
-
                return array(
                        'title' => array(
                                ApiBase::PARAM_TYPE => 'string',
diff --git a/hooks.txt b/hooks.txt
index 45b2f94..3315335 100644
--- a/hooks.txt
+++ b/hooks.txt
@@ -147,7 +147,7 @@
  string          $language: Language code of the language of which language 
names are in
 
 ;TranslateTranslationAids: Make new translation aids available to any message 
group (which must choose an implementation in its getTranslationAids() method).
- array          &$types: List of translation aid identifiers, numerically 
indexed
+ array          &$types: Array of translation aid identifiers (key) and their 
associated classnames (value)
 
 ;AddNewAccount: Replica of the core hook, see 
https://www.mediawiki.org/wiki/Manual:Hooks/AddNewAccount
 
diff --git a/translationaids/TranslationAid.php 
b/translationaids/TranslationAid.php
index 9c0f26a..a85e112 100644
--- a/translationaids/TranslationAid.php
+++ b/translationaids/TranslationAid.php
@@ -146,6 +146,7 @@
                        'gettext' => 'GettextDocumentationAid',
                        'insertables' => 'InsertablesAid',
                );
+               wfRunHooks( 'TranslateTranslationAids', array( &$types ) );
 
                return $types;
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0255847c207682aa115340e906268ab9d8e1690c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Jarry1250 <jarry1...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to