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