You are here

public function TMGMTDefaultTranslatorPluginController::getRemoteLanguagesMappings in Translation Management Tool 7

Gets existing remote languages mappings.

This method is responsible to provide all local to remote language pairs.

Parameters

TMGMTTranslator $translator: Translator entity for which to get mappings.

Return value

array An array of local => remote language codes.

Overrides TMGMTTranslatorPluginControllerInterface::getRemoteLanguagesMappings

File

plugin/tmgmt.plugin.translator.inc, line 79
Contains the abstract translator base plugin class.

Class

TMGMTDefaultTranslatorPluginController
Default controller class for service plugins.

Code

public function getRemoteLanguagesMappings(TMGMTTranslator $translator) {
  if (!empty($this->remoteLanguagesMappings)) {
    return $this->remoteLanguagesMappings;
  }
  foreach (language_list() as $language => $info) {
    $this->remoteLanguagesMappings[$language] = $this
      ->mapToRemoteLanguage($translator, $language);
  }
  return $this->remoteLanguagesMappings;
}