示例#1
0
 /**
  * @Transform :localeName
  */
 public function castToLocaleName($localeCode)
 {
     try {
         return $this->localeNameConverter->convertCodeToName($localeCode);
     } catch (\InvalidArgumentException $exception) {
         return $localeCode;
     }
 }
示例#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();
 }
示例#3
0
 function it_converts_locales_code_to_name(LocaleConverterInterface $localeConverter)
 {
     $localeConverter->convertCodeToName('fr_FR')->willReturn('French (France)');
     $this->convertCodeToName('fr_FR')->shouldReturn('French (France)');
 }
示例#4
0
 /**
  * {@inheritdoc}
  */
 public function convertCodeToName($localeCode)
 {
     return $this->localeConverter->convertCodeToName($localeCode);
 }