Logic to deal with different language codes at client and server that stand for the same language.
For those plugins where such feature has no use there is a plugin setting "map_remote_languages" which can be set to FALSE.
There are several methods defined by TranslatorInterface and implemented in Translator that deal with mappings info.
The above methods should not need reimplementation unless special logic is needed. However following methods provide only the fallback behaviour and therefore it is recommended that each plugin provides its specific implementation.
lang_code => lang_code format. It says with what languages the remote system can deal with. These codes are in the remote format.
Mapping remote to local language codes is done when determining the language capabilities of the remote system. All following logic should then solely work with local language codes. There are two methods defined by the TranslatorInterface interface. To do the mapping a plugin must implement getSupportedTargetLanguages() defined in the TranslatorPluginInterface.
Mapping of local to remote language codes is done upon translation job request in the TranslatorPluginControllerInterface::requestTranslation() plugin implementation.