StaticTranslation::__construct

public StaticTranslation::__construct($translations = array()) Constructs a translator from an array of translations. Parameters array $translations: Array of override strings indexed by language and context File core/lib/Drupal/Core/StringTranslation/Translator/StaticTranslation.php, line 26 Class StaticTranslation String translator with a static cache for translations. Namespace Drupal\Core\StringTranslation\Translator Code public function __construct($translations = array()) { $t

StaticTranslation::reset

public StaticTranslation::reset() Resets translation cache. Since most translation systems implement some form of caching, this provides a way to delete that cache. Overrides TranslatorInterface::reset File core/lib/Drupal/Core/StringTranslation/Translator/StaticTranslation.php, line 48 Class StaticTranslation String translator with a static cache for translations. Namespace Drupal\Core\StringTranslation\Translator Code public function reset() { $this->translations = array(); }

StaticTranslation::getStringTranslation

public StaticTranslation::getStringTranslation($langcode, $string, $context) Retrieves English string to given language. Parameters string $langcode: Language code to translate to. string $string: The source string. string $context: The string context. Return value string|false Translated string if there is a translation, FALSE if not. Overrides TranslatorInterface::getStringTranslation File core/lib/Drupal/Core/StringTranslation/Translator/StaticTranslation.php, line 33 Class StaticTrans

StaticTranslation::getLanguage

protected StaticTranslation::getLanguage($langcode) Retrieves translations for a given language. Parameters string $langcode: The langcode of the language. Return value array A multidimensional array of translations, indexed by the context the source string belongs to. The second level is using original strings as keys. An empty array will be returned when no translations are available. File core/lib/Drupal/Core/StringTranslation/Translator/StaticTranslation.php, line 63 Class StaticTrans

StaticTranslation::$translations

String translations Array of cached translations indexed by language and context. Type: array File core/lib/Drupal/Core/StringTranslation/Translator/StaticTranslation.php, line 18 Class StaticTranslation String translator with a static cache for translations. Namespace Drupal\Core\StringTranslation\Translator Code protected $translations;

StaticTranslation

String translator with a static cache for translations. This is a high performance way to provide a handful of string replacements. Hierarchy class \Drupal\Core\StringTranslation\Translator\StaticTranslation implements TranslatorInterface File core/lib/Drupal/Core/StringTranslation/Translator/StaticTranslation.php, line 10 Namespace Drupal\Core\StringTranslation\Translator Members Name Modifiers Type Description StaticTranslation::$translations protected property String

StaticMenuLinkOverridesInterface::saveOverride

public StaticMenuLinkOverridesInterface::saveOverride($id, array $definition) Saves the override. Parameters string $id: A menu link plugin ID. array $definition: The definition values to override. Supported keys: menu_name parent weight expanded enabled Return value array A list of properties which got saved. File core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php, line 80 Class StaticMenuLinkOverridesInterface Defines an interface for objects which overrides menu links de

StaticMenuLinkOverridesInterface::reload

public StaticMenuLinkOverridesInterface::reload() Reloads the overrides from config. Forces all overrides to be reloaded from config storage to compare the override value with the value submitted during test form submission. File core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php, line 16 Class StaticMenuLinkOverridesInterface Defines an interface for objects which overrides menu links defined in YAML. Namespace Drupal\Core\Menu Code public function reload();

StaticMenuLinkOverridesInterface::loadOverride

public StaticMenuLinkOverridesInterface::loadOverride($id) Loads any overrides to the definition of a static (YAML-defined) link. Parameters string $id: A menu link plugin ID. Return value array|null An override with following supported keys: parent weight menu_name expanded enabled or NULL if there is no override for the given ID. File core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php, line 33 Class StaticMenuLinkOverridesInterface Defines an interface for objects which o

StaticMenuLinkOverridesInterface::loadMultipleOverrides

public StaticMenuLinkOverridesInterface::loadMultipleOverrides(array $ids) Loads overrides to multiple definitions of a static (YAML-defined) link. Parameters array $ids: Array of menu link plugin IDs. Return value array One or override keys by plugin ID. See also \Drupal\Core\Menu\StaticMenuLinkOverridesInterface File core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php, line 62 Class StaticMenuLinkOverridesInterface Defines an interface for objects which overrides menu links