public function LanguageLocaleMapper::getLocaleForLangcode in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 4.0.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.0.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.1.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.2.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.3.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.4.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.5.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.6.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.7.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
- 3.8.x src/LanguageLocaleMapper.php \Drupal\lingotek\LanguageLocaleMapper::getLocaleForLangcode()
Gets the Lingotek locale for the given Drupal langcode.
Parameters
string $langcode: The Drupal langcode.
Return value
ConfigurableLanguageInterface|NULL The Lingotek locale.
Overrides LanguageLocaleMapperInterface::getLocaleForLangcode
File
- src/
LanguageLocaleMapper.php, line 51
Class
Namespace
Drupal\lingotekCode
public function getLocaleForLangcode($langcode) {
/** @var ConfigurableLanguageInterface $config_language */
$config_language = ConfigurableLanguage::load($langcode);
$locale = NULL;
if ($config_language) {
$locale = $config_language
->getThirdPartySetting('lingotek', 'locale', LingotekLocale::convertDrupal2Lingotek($langcode));
}
return $locale;
}