Gets all supported languages of the translator plugin.
array An array of language codes which are provided by the translator plugin (remote language codes).
Overrides TranslatorInterface::getSupportedRemoteLanguages
public function getSupportedRemoteLanguages() {
if ($plugin = $this
->getPlugin()) {
if (empty($this->remoteLanguages) && ($cache = \Drupal::cache('data')
->get('tmgmt_remote_languages:' . $this->name))) {
$this->remoteLanguages = $cache->data;
}
if (empty($this->remoteLanguages)) {
$this->remoteLanguages = $plugin
->getSupportedRemoteLanguages($this);
$info = $plugin
->getPluginDefinition();
if (!isset($info['language_cache']) || !empty($info['language_cache'])) {
\Drupal::cache('data')
->set('tmgmt_remote_languages:' . $this->name, $this->remoteLanguages, Cache::PERMANENT, $this
->getCacheTags());
}
}
}
return $this->remoteLanguages;
}