public function TMGMTDefaultTranslatorPluginController::getSupportedTargetLanguages in Translation Management Tool 7
Returns all available target languages that are supported by this service when given a source language.
Parameters
TMGMTTranslator $translator: The translator entity.
$source_language: The source language.
Return value
array An array of remote languages in ISO format.
Overrides TMGMTTranslatorPluginControllerInterface::getSupportedTargetLanguages
2 calls to TMGMTDefaultTranslatorPluginController::getSupportedTargetLanguages()
- TMGMTDefaultTranslatorPluginController::getSupportedLanguagePairs in plugin/
tmgmt.plugin.translator.inc - Default implementation that gets target languages for each remote language. This approach is ineffective and therefore it is advised that a plugin should provide own implementation.
- TMGMTLocalTranslatorPluginController::getSupportedTargetLanguages in translators/
tmgmt_local/ includes/ tmgmt_local.plugin.inc - Returns all available target languages that are supported by this service when given a source language.
2 methods override TMGMTDefaultTranslatorPluginController::getSupportedTargetLanguages()
- TMGMTLocalTranslatorPluginController::getSupportedTargetLanguages in translators/
tmgmt_local/ includes/ tmgmt_local.plugin.inc - Returns all available target languages that are supported by this service when given a source language.
- TMGMTTestTranslatorPluginController::getSupportedTargetLanguages in tests/
tmgmt_test.plugin.translator.inc - Returns all available target languages that are supported by this service when given a source language.
File
- plugin/
tmgmt.plugin.translator.inc, line 137 - Contains the abstract translator base plugin class.
Class
- TMGMTDefaultTranslatorPluginController
- Default controller class for service plugins.
Code
public function getSupportedTargetLanguages(TMGMTTranslator $translator, $source_language) {
$languages = entity_metadata_language_list();
unset($languages[LANGUAGE_NONE], $languages[$source_language]);
return drupal_map_assoc(array_keys($languages));
}