Translation::get

public Translation::get() Gets the value of an annotation. Overrides AnnotationInterface::get File core/lib/Drupal/Core/Annotation/Translation.php, line 90 Class Translation Defines a translatable annotation object. Namespace Drupal\Core\Annotation Code public function get() { return $this->translation; }

Translation::__construct

public Translation::__construct(array $values) Constructs a new class instance. Parses values passed into this class through the t() function in Drupal and handles an optional context for the string. Parameters array $values: Possible array keys: value (required): the string that is to be translated. arguments (optional): an array with placeholder replacements, keyed by placeholder. context (optional): a string that describes the context of "value"; File core/lib/Drupal/Core/Annotation/Tr

TranslationInterface

Interface for the translation.manager translation service. Hierarchy interface \Drupal\Core\StringTranslation\TranslationInterface Related topics Internationalization Internationalization and translation File core/lib/Drupal/Core/StringTranslation/TranslationInterface.php, line 10 Namespace Drupal\Core\StringTranslation Members Name Modifiers Type Description TranslationInterface::formatPlural public function Formats a string containing a count of items. TranslationI

TranslationInterface::formatPlural

public TranslationInterface::formatPlural($count, $singular, $plural, array $args = array(), array $options = array()) Formats a string containing a count of items. This function ensures that the string is pluralized correctly. Since TranslationInterface::translate() is called by this function, make sure not to pass already-localized strings to it. See PluralTranslatableMarkup::createFromTranslatedString() for that. For example: $output = $string_translation->formatPlural($node->comment

TranslationInterface::translate

public TranslationInterface::translate($string, array $args = array(), array $options = array()) Translates a string to the current language or to a given language. Never call this translate() method directly. In order for strings to be localized, make them available in one of the ways supported by the Localization API. When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise create a new \Drupal\Core\StringTranslation\TranslatableMarkup object. Para

TranslationManager

Defines a chained translation implementation combining multiple translators. Hierarchy class \Drupal\Core\StringTranslation\TranslationManager implements TranslationInterface, TranslatorInterface File core/lib/Drupal/Core/StringTranslation/TranslationManager.php, line 11 Namespace Drupal\Core\StringTranslation Members Name Modifiers Type Description TranslationManager::$defaultLangcode protected property The default langcode used in translations. TranslationManager::$s

TranslationManager::$defaultLangcode

The default langcode used in translations. A language code. Type: string File core/lib/Drupal/Core/StringTranslation/TranslationManager.php, line 44 Class TranslationManager Defines a chained translation implementation combining multiple translators. Namespace Drupal\Core\StringTranslation Code protected $defaultLangcode;

TranslationManager::$sortedTranslators

An array of translators, sorted by priority. If this is NULL a rebuild will be triggered. Type: null|\Drupal\Core\StringTranslation\Translator\TranslatorInterface[] See also \Drupal\Core\StringTranslation\TranslationManager::addTranslator() \Drupal\Core\StringTranslation\TranslationManager::sortTranslators() File core/lib/Drupal/Core/StringTranslation/TranslationManager.php, line 36 Class TranslationManager Defines a chained translation implementation combining multiple translators. Nam

TranslationManager::$translators

An unsorted array of arrays of active translators. An associative array. The keys are integers that indicate priority. Values are arrays of TranslatorInterface objects. Type: \Drupal\Core\StringTranslation\Translator\TranslatorInterface[][] See also \Drupal\Core\StringTranslation\TranslationManager::addTranslator() \Drupal\Core\StringTranslation\TranslationManager::sortTranslators() File core/lib/Drupal/Core/StringTranslation/TranslationManager.php, line 24 Class TranslationManager Define

TranslationManager::addTranslator

public TranslationManager::addTranslator(TranslatorInterface $translator, $priority = 0) Appends a translation system to the translation chain. Parameters \Drupal\Core\StringTranslation\Translator\TranslatorInterface $translator: The translation interface to be appended to the translation chain. int $priority: The priority of the logger being added. Return value $this File core/lib/Drupal/Core/StringTranslation/TranslationManager.php, line 66 Class TranslationManager Defines a chained tr