public function validate($value, $possibleValues = []) { if (!is_array($value)) { throw new InvalidValueException(Translate::t("The value must be an array.")); } foreach ($value as $val) { if (!in_array($val, $possibleValues)) { throw new InvalidValueException(sprintf(Translate::t("The value must be one of the following: “%s”."), implode(Translate::x("quotation inside collection", "”, “"), $possibleValues))); } } }
public function testX() { // without a locale and a textdomain loaded, // the translation service should just return the original string. $this->assertSame("foobar", Translate::x("foo", "foobar")); }
/** * Get name. * * @return string */ public function getName() { return Translate::x("timezone", $this->name); }
public static function getFirstDayOfWeek() { return (int) Translate::x("first day of week; 0: Sunday, 1: Monday", "0"); }
/** * Get name. * * @return string */ public function getName() { return Translate::x("payment module", $this->name); }
public function x($ctxt, $string) { return Translate::x($ctxt, $string); }
/** * Get name. * * @return string */ public function getName() { return Translate::x("language", $this->name); }
/** * Get name. * * @return string */ public function getName() { return Translate::x("user capability", $this->name); }
public function getName() { return $this->context ? Translate::x($this->context, $this->value) : Translate::t($this->value); }
/** * Get name. * * @return string */ public function getName() { return Translate::x("currency", $this->name); }
/** * Get name. * * @return string */ public function getName() { return Translate::x("country", $this->name); }
public function x($context, $string) { return $this->getMultilangString(function () use($context, $string) { return Translate::x($context, $string); }); }
/** * Get name. * * @return string */ public function getName() { return Translate::x("logging category", $this->name); }
/** * Get name. * * @return string */ public function getName() { return Translate::x("user role", $this->name); }