예제 #1
0
 /**
  * @Transform :language
  * @Transform :localeCode
  * @Transform /^"([^"]+)" locale$/
  * @Transform /^in the "([^"]+)" locale$/
  */
 public function castToLocaleCode($localeName)
 {
     try {
         return $this->localeNameConverter->convertNameToCode($localeName);
     } catch (\InvalidArgumentException $exception) {
         return $localeName;
     }
 }
예제 #2
0
 /**
  * @Given /^(it) uses the "([^"]+)" locale by default$/
  */
 public function itUsesTheLocaleByDefault(ChannelInterface $channel, $localeName)
 {
     $locale = $this->provideLocale($this->localeConverter->convertNameToCode($localeName));
     $this->localeManager->flush();
     $channel->addLocale($locale);
     $channel->setDefaultLocale($locale);
     $this->channelManager->flush();
 }