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

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, 10 insertions(+), 0 deletions(-)

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



diff --git a/api/ApiQueryTranslationAids.php b/api/ApiQueryTranslationAids.php
index 70ef669..c9e8982 100644
--- a/api/ApiQueryTranslationAids.php
+++ b/api/ApiQueryTranslationAids.php
@@ -54,6 +54,11 @@
                // Create list of aids, populate web services queries
                $aids = array();
                foreach ( $props as $type ) {
+                       // Do not proceed if translation aid is not supported 
for this message group
+                       if ( !isset( $types[$type] ) ) {
+                               $types[$type] = 'UnsupportedTranslationAid';
+                       }
+
                        $class = $types[$type];
                        $obj = new $class( $group, $handle, $this );
 
diff --git a/resources/js/ext.translate.editor.helpers.js 
b/resources/js/ext.translate.editor.helpers.js
index 1eb87bb..1da5c6a 100644
--- a/resources/js/ext.translate.editor.helpers.js
+++ b/resources/js/ext.translate.editor.helpers.js
@@ -213,6 +213,11 @@
                        var translateEditor = this,
                                $translationTextarea;
 
+                       if ( translations.error ) {
+                               // Do not proceed if errored/unsupported
+                               return;
+                       }
+
                        $translationTextarea = this.$editor.find( 
'.tux-textarea-translation' );
 
                        $.each( translations, function ( index ) {

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

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

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

Reply via email to