public function LingotekConfigTranslationService::getConfigSourceLocale in Lingotek Translation 3.3.x
Same name and namespace in other branches
- 8 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
- 3.8.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigSourceLocale()
Gets the translation source locale of a given entity.
Parameters
\Drupal\config_translation\ConfigNamesMapper $mapper: The entity which we want to get the source locale.
Return value
string The locale as expected by the Lingotek service.
Overrides LingotekConfigTranslationServiceInterface::getConfigSourceLocale
1 call to LingotekConfigTranslationService::getConfigSourceLocale()
- LingotekConfigTranslationService::uploadConfig in src/
LingotekConfigTranslationService.php - Uploads a document to the Lingotek service.
File
- src/
LingotekConfigTranslationService.php, line 913
Class
- LingotekConfigTranslationService
- Service for managing Lingotek configuration translations.
Namespace
Drupal\lingotekCode
public function getConfigSourceLocale(ConfigNamesMapper $mapper) {
$locale = NULL;
$source_langcode = $mapper
->getLangcode();
if (!in_array($source_langcode, [
LanguageInterface::LANGCODE_NOT_SPECIFIED,
LanguageInterface::LANGCODE_NOT_APPLICABLE,
])) {
$locale = $this->languageLocaleMapper
->getLocaleForLangcode($source_langcode);
}
return $locale;
}