Catch up the changes made in the following tmgmt issue: https://www.drupal.org/node/2538198

TranslatorPluginInterface won't have the following methods any more:
- public function getRemoteLanguagesMappings(TranslatorInterface $translator);
- public function mapToRemoteLanguage(TranslatorInterface $translator, $language);
- public function mapToLocalLanguage(TranslatorInterface $translator, $language);

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

edurenye’s picture

Status: Active » Needs review
FileSize
1.03 KB

In local this patch passes the tests.

edurenye’s picture

Now it maps properly, and passes the tests in local.
There's still problems with the translation, but seems to not be related.

Status: Needs review » Needs work

The last submitted patch, 2: catch_up_change_in_tmgmt-2541290-2.patch, failed testing.

edurenye’s picture

Status: Needs work » Needs review

Finally I could test it and it works perfectly, was just configuration problem.

edurenye’s picture

Title: Catch up change in tmgmt » Catch up change in tmgmt, no need to map languages any more

Better title.

miro_dietiker’s picture

Status: Needs review » Needs work
+++ b/src/Plugin/tmgmt/Translator/MicrosoftTranslator.php
@@ -202,20 +201,13 @@ class MicrosoftTranslator extends TranslatorPluginBase implements ContainerFacto
+    if (array_key_exists($source_language, $remote_languages)) {

Hm, remote languages should not be filtered by the (local) source language. This is a different language domain. Instead the source languate should be mapped to remote languages first.

Berdir’s picture

The mapping happens in the translator now.

$source_language is already mapped to the remote source language. this is something else. Microsoft translator doesn't have mappings, just a list of languages. If the source languages is one of the supported languages, then we can translate into all the other languages, if not, then we can not translate into any language for this source language.

However, leaving at needs work to improve the comments because what's there now doesn't make much sense.

Berdir’s picture

Also, we should rename all $language to $langcode when it is just a language code. But not in this patch.

edurenye’s picture

Status: Needs work » Needs review
FileSize
2.27 KB
1.02 KB

Ok, I changed the documentation.

Status: Needs review » Needs work

The last submitted patch, 9: catch_up_change_in_tmgmt-2541290-9.patch, failed testing.

edurenye’s picture

Status: Needs work » Needs review

Berdir’s picture

Status: Needs review » Fixed

Committed.

  • Berdir committed 3bc092b on 8.x-1.x authored by edurenye
    Issue #2541290 by edurenye: Catch up change in tmgmt, no need to map...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.