Jarry1250 has uploaded a new change for review.

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

Change subject: Change default to UnsupportedTranslationAid
......................................................................

Change default to UnsupportedTranslationAid

This ensures that new translation aids get correctly noted as unsupported
in all message groups (until they are marked as supported). For most
message groups, this will simply be a case of adding them to the central
list (TranslationAid::getTypes).

Also, make showAssistantLanguages() resiliant to errors.

Change-Id: I7bae04ee2e6cf27b21cf95b10f98bc3463a7648d
---
M api/ApiQueryTranslationAids.php
M resources/js/ext.translate.editor.helpers.js
2 files changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/api/ApiQueryTranslationAids.php b/api/ApiQueryTranslationAids.php
index 60a996c..4e12064 100644
--- a/api/ApiQueryTranslationAids.php
+++ b/api/ApiQueryTranslationAids.php
@@ -50,7 +50,7 @@
                foreach ( $props as $type ) {
                        // Do not proceed if translation aid is not supported 
for this message group
                        if ( !isset( $types[$type] ) ) {
-                               continue;
+                               $types[$type] = 'UnsupportedTranslationAid';
                        }
 
                        $start = microtime( true );
diff --git a/resources/js/ext.translate.editor.helpers.js 
b/resources/js/ext.translate.editor.helpers.js
index 9c08552..fb592df 100644
--- a/resources/js/ext.translate.editor.helpers.js
+++ b/resources/js/ext.translate.editor.helpers.js
@@ -208,6 +208,10 @@
                 * @param {array} translations An inotherlanguages array as 
returned by the translation helpers API.
                 */
                showAssistantLanguages: function ( translations ) {
+                       if( translations.error ) {
+                               // Do not proceed if errored/unsupported
+                               return;
+                       }
                        var translateEditor = this,
                                $translationTextarea;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bae04ee2e6cf27b21cf95b10f98bc3463a7648d
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