Nikerabbit has uploaded a new change for review.

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

Change subject: Cxserver: use the new mt list api
......................................................................

Cxserver: use the new mt list api

Change-Id: If4802bdb809409de95818668d3479afdc2c91648
---
M webservices/CxserverWebService.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/webservices/CxserverWebService.php 
b/webservices/CxserverWebService.php
index e27f57c..6a3f00a 100644
--- a/webservices/CxserverWebService.php
+++ b/webservices/CxserverWebService.php
@@ -28,7 +28,7 @@
 
                $pairs = array();
 
-               $url = $this->config['host'] . '/languagepairs';
+               $url = $this->config['host'] . '/v1/list/mt';
                // BC for MW <= 1.24
                $json = Http::request(
                        'GET',
@@ -42,7 +42,7 @@
                        throw new TranslationWebServiceException( $exception );
                }
 
-               foreach ( $response as $source => $targets ) {
+               foreach ( $response['Apertium'] as $source => $targets ) {
                        foreach ( $targets as $target ) {
                                $pairs[$source][$target] = true;
                        }
@@ -58,7 +58,7 @@
 
                $text = trim( $text );
                $text = $this->wrapUntranslatable( $text );
-               $url = $this->config['host'] . "/mt/$from/$to";
+               $url = $this->config['host'] . "/v1/mt/$from/$to/Apertium";
 
                return TranslationQuery::factory( $url )
                        ->timeout( $this->config['timeout'] )

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

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

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

Reply via email to