/** * @depends testWhetherSetupLocaleSetsUpTheGivenLocale */ public function testWhetherTranslateReturnsTheContextForm() { Translator::setupLocale('de_DE'); $result = Translator::translate('context service', 'icingatest', 'test2'); $expected = 'context dienst test2'; $this->assertEquals($expected, $result, 'Translator::translate() could not return the translated context form'); }
/** * Translate a string * * @param string $text The string to translate * @param string|null $context Optional parameter for context based translation * * @return string The translated string */ protected function translate($text, $context = null) { return Translator::translate($text, $this->getTranslationDomain(), $context); }
public function testWhetherTranslateReturnsTheInputStringInCaseTheGivenDomainIsNotValid() { $this->assertEquals('test', Translator::translate('test', 'invalid_domain')); }
public function translate($text, $context = null) { return Translator::translate($text, $this->translationDomain, $context); }
/** * Translate a string * * Autoselects the module domain, if any, and falls back to the global one if no translation could be found. * * @param string $text The string to translate * * @return string The translated string */ public function translate($text) { $domain = $this->moduleName === null ? 'icinga' : $this->moduleName; return Translator::translate($text, $domain); }
/** * Translate a string * * Autoselects the module domain, if any, and falls back to the global one if no translation could be found. * * @param string $text The string to translate * * @return string The translated string */ public function translate($text) { $module = $this->getRequest()->getModuleName(); $domain = $module === 'default' ? 'icinga' : $module; return Translator::translate($text, $domain); }
/** * (non-PHPDoc) * @see Translator::translate() For the function documentation. */ function mt($domain, $messageId, $context = null) { return Translator::translate($messageId, $domain, $context); }
public function translate($text) { return Translator::translate($text, $this->translationDomain); }
function mt($domain, $messageId) { return Translator::translate($messageId, $domain); }