Skip to content

Commit a621f97

Browse files
committed
Update DefaultPatternGenerationStrategy.php
Changes from this pull request: schmittjoh#146
1 parent eda6c5f commit a621f97

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Router/DefaultPatternGenerationStrategy.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function generateI18nPatterns($routeName, Route $route)
4444
{
4545
$patterns = array();
4646
foreach ($route->getOption('i18n_locales') ?: $this->locales as $locale) {
47-
// Check if translation exists in the translation catalogue to avoid errors being logged by
47+
// Check if translation exists in the translation catalogue to avoid errors being logged by
4848
// the new LoggingTranslator of Symfony 2.6. However, the LoggingTranslator did not implement
4949
// the interface until Symfony 2.6.5, so an extra check is needed.
5050
if ($this->translator instanceof TranslatorBagInterface || $this->translator instanceof LoggingTranslator) {
@@ -71,6 +71,11 @@ public function generateI18nPatterns($routeName, Route $route)
7171
$i18nPattern = $route->getOption('i18n_prefix').$i18nPattern;
7272
}
7373
}
74+
else if ((self::STRATEGY_PREFIX_EXCEPT_DEFAULT === $this->strategy && $this->defaultLocale === $locale)
75+
&& (true === $route->getOption('sticky_18n_prefix'))
76+
&& (null !== $route->getOption('i18n_prefix'))) {
77+
$i18nPattern = $route->getOption('i18n_prefix').$i18nPattern;
78+
}
7479

7580
$patterns[$i18nPattern][] = $locale;
7681
}

0 commit comments

Comments
 (0)