Retrieves English string to given language.
string $langcode: Language code to translate to.
string $string: The source string.
string $context: The string context.
string|FALSE Translated string if there is a translation, FALSE if not.
Overrides TranslatorInterface::getStringTranslation
public function getStringTranslation($langcode, $string, $context) {
// If the language is not suitable for locale module, just return.
if ($langcode == Language::LANGCODE_SYSTEM || $langcode == 'en' && !variable_get('locale_translate_english', FALSE)) {
return FALSE;
}
// Strings are cached by langcode, context and roles, using instances of the
// LocaleLookup class to handle string lookup and caching.
if (!isset($this->translations[$langcode][$context])) {
$this->translations[$langcode][$context] = new LocaleLookup($langcode, $context, $this->storage);
}
$translation = $this->translations[$langcode][$context][$string];
return $translation === TRUE ? FALSE : $translation;
}