StringTranslation.php in Service Container 7.2
File
src/StringTranslation/StringTranslation.php
View source
<?php
namespace Drupal\service_container\StringTranslation;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\service_container\Legacy\Drupal7;
class StringTranslation implements TranslationInterface {
protected $drupal7;
public function __construct(Drupal7 $drupal7) {
$this->drupal7 = $drupal7;
}
public function translate($string, array $args = array(), array $options = array()) {
return $this->drupal7
->t($string, $args, $options);
}
public function formatPlural($count, $singular, $plural, array $args = array(), array $options = array()) {
return $this->drupal7
->format_plural($count, $singular, $plural, $args, $options);
}
public function formatPluralTranslated($count, $translation, array $args = array(), array $options = array()) {
throw new \BadMethodCallException('StringTranslation::formatPluralTranslated is not implemented.');
}
public function getNumberOfPlurals($langCode = NULL) {
throw new \BadMethodCallException('StringTranslation::getNumberOfPlurals is not implemented.');
}
}