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

Change subject: Partial fix for busted check that a translation exists
......................................................................


Partial fix for busted check that a translation exists

Existing logic omitted an argument to wfMessage, meaning we only
ever returned true for messages that existed in some language and
had parameters to substitute. This version fixes that heinous error,
but we still return false when the translated message is equal to
the English message.

Bug: T129277
Change-Id: I8a3e5080b015a7f87e7898045c3b9e41b4375334
---
M gateway_common/MessageUtils.php
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/gateway_common/MessageUtils.php b/gateway_common/MessageUtils.php
index 8f445d9..533ba0e 100644
--- a/gateway_common/MessageUtils.php
+++ b/gateway_common/MessageUtils.php
@@ -45,7 +45,7 @@
        /**
         * messageExists returns true if a translatable message has been defined
         * for the string and language that have been passed in, false if none 
is
-        * present.
+        * present or if the translation is the same as the English.
         * @param string $msg_key The message string to look up.
         * @param string $language A valid mediawiki language code.
         * @return boolean - true if message exists, otherwise false.
@@ -59,11 +59,11 @@
                        }
 
                        # get the english version of the message
-                       $msg_en = WmfFramework::formatMessage( $msg_key, 'en' );
+                       $msg_en = WmfFramework::formatMessage( $msg_key, 
array(), 'en' );
                        # attempt to get the message in the specified language
-                       $msg_lang = WmfFramework::formatMessage( $msg_key, 
$language );
+                       $msg_lang = WmfFramework::formatMessage( $msg_key, 
array(), $language );
 
-                       # if the messages are the same, the message fellback to 
English, return false
+                       # if the messages are the same, the message fell back 
to English, return false
                        return strcmp( $msg_en, $msg_lang ) != 0;
                }
                return false;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a3e5080b015a7f87e7898045c3b9e41b4375334
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Cdentinger <cdentin...@wikimedia.org>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: XenoRyet <dkozlow...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to