String translator using overrides from variables.
This is a high performance way to provide a handful of string replacements. See settings.php for examples.
Expanded class hierarchy of CustomStrings
class CustomStrings extends StaticTranslation {
/**
* {@inheritdoc}
*/
protected function loadLanguage($langcode) {
return variable_get('locale_custom_strings_' . $langcode, array());
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CustomStrings:: |
protected | function |
Add translations for new language. Overrides StaticTranslation:: |
|
StaticTranslation:: |
protected | property | String translations | |
StaticTranslation:: |
public | function |
Retrieves English string to given language. Overrides TranslatorInterface:: |
|
StaticTranslation:: |
public | function |
Resets translation cache. Overrides TranslatorInterface:: |
|
StaticTranslation:: |
public | function | Constructs a translator from an array of translations. | 1 |