Commit 3e839344 authored by alexpott's avatar alexpott

Issue #2049709 by plopesc: TranslationManager::translate() should be on an interface.

parent 265940c8
<?php
/**
* @file
* Contains \Drupal\Core\StringTranslation\TranslationInterface.
*/
namespace Drupal\Core\StringTranslation;
interface TranslationInterface {
/**
* Translates a string to the current language or to a given language.
*
* @param string $string
* A string containing the English string to translate.
* @param array $args
* An associative array of replacements to make after translation. Based
* on the first character of the key, the value is escaped and/or themed.
* See \Drupal\Core\Utility\String::format() for details.
* @param array $options
* An associative array of additional options, with the following elements:
* - 'langcode': The language code to translate to a language other than
* what is used to display the page.
* - 'context': The context the source string belongs to.
*
* @return string
* The translated string.
*
* @see \Drupal\Core\Utility\String::format()
*/
public function translate($string, array $args = array(), array $options = array());
}
......@@ -13,7 +13,7 @@
/**
* Defines a chained translation implementation combining multiple translators.
*/
class TranslationManager implements TranslatorInterface {
class TranslationManager implements TranslationInterface, TranslatorInterface {
/**
* An array of active translators keyed by priority.
......@@ -105,25 +105,7 @@ public function getStringTranslation($langcode, $string, $context) {
}
/**
* Translates a string to the current language or to a given language.
*
* @param string $string
* A string containing the English string to translate.
* @param array $args
* An associative array of replacements to make after translation. Based
* on the first character of the key, the value is escaped and/or themed.
* See \Drupal\Core\Utility\String::format() for details.
* @param array $options
* An associative array of additional options, with the following elements:
* - 'langcode': The language code to translate to a language other than
* what is used to display the page.
* - 'context': The context the source string belongs to.
*
* @return string
* The translated string.
*
* @see t()
* @see \Drupal\Core\Utility\String::format()
* {@inheritdoc}
*/
public function translate($string, array $args = array(), array $options = array()) {
// Merge in defaults.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment