-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.6.x] Translation Component not properly functioning #12941
Comments
I forgot to mention that if I add |
@craigh I also have hundreds of rows saying |
It seems like this is an issue with the LoggingTranslator, which was added in Symfony 2.6: https://github.com/symfony/Translation/blob/master/LoggingTranslator.php#L102-123 @aitboudad can you please take a look at this, as you created this translator? |
@aitboudad - our zikula package is quite large (compared to symfony) and the example I was using is an additional module to intentionally throw an exception (for testing). If you like I can talk you through setting that up? zikula: https://github.com/zikula/core |
@craigh of course, just I found an exception here :p http://zikula.org/library/ |
hmmm. that doesn't demonstrate the problem because that install is still on Symfony 2.5.x 😉 you'll have to install the full product |
ops I don't see what's going wrong here, "WARNING - Translation not found" it's related to jms/i18n-routing-bundle (missing translate routes)
You can ignore logging "routes" channel if you want avoid hundreds of rows or disable logging translation. |
@cmfcmf can you comment here? (your implementation of routes, etc) |
The warnings are caused by the I18n-Routing bundle indeed. Here it checks whether or not a translation for a given route pattern exists: if ($routeName === $i18nPattern = $this->translator->trans($routeName, array(), $this->translationDomain, $locale)) {
$i18nPattern = $route->getPattern();
} Example:
Because our Route patterns already are in English (and therefore need no translation to English), the NO branch is executed all the times. This then causes the warnings in the logging translator. Maybe the I18n-Routing bundle should not try to translate the Route pattern and then check if it differs from the original pattern, but rather do something like this: // Check if route is translated.
if (!$this->translator->getCatalogue($locale)->has($routeName, $this->translationDomain)) {
// No translation found.
$i18nPattern = $route->getPattern();
} else {
// Get translation.
$i18nPattern = $this->translator->trans($routeName, array(), $this->translationDomain, $locale)
} Conclusion: The warnings are produced by the I18n-Routing bundle, which might need to be fixed. |
I can confirm that setting |
@aitboudad - closing this ticket as it appears to be a problem with schmittjoh/JMSI18nRoutingBundle, I'm hoping they will find a fix! thank you for your attention 😄 |
Sorry to interrupt, Help! |
@Cedoriku Would you mind preparing a simple example reproducing the problem ? |
Yes I will do that tomorrow morning ASAP. For each option, we get a line of that kind (don't have it in front of me right now): Translation.WARNING.Translation not found [...] {id:"The option label", domaine:message, locale:fr} |
After reflexion, we're actually not sure if the crash comes from that problem, as we just encountered it. It may come from other bugs in our code, but searching about it, we found that log problem. |
the proper log message is: |
@Cedoriku So to be sure, can you disable logging to check if the problem persist or not ? # app/config/config.yml
framework:
translator: { logging: false } |
Ok. |
… avoid trans options. (aitboudad) This PR was merged into the 2.7 branch. Discussion ---------- [2.7][Form][choice] added choice_translation_domain to avoid trans options. | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Fixed tickets | ~ | Tests pass? | yes | License | MIT see #12941 (comment) Commits ------- 5a33c2c [Form][choice] added choice_translation_domain to avoid trans options.
Hi I have a similar issue: Here is my twig snippet to reproduce the behavior:
This code will produce false missing translation warnings. |
It appears that the Translation Component is present, but failing to operate properly. For example if I intentionally throw an exception, I get hundreds of rows saying
WARNING - Translation not found.
this was not true before the upgrade to 2.6.x
this is in use in the Zikula project and in complete dev mode at the moment. We are also have composer issues since the changeover to 2.6.x
any help is appreciated.
ping @Guite @cmfcmf
The text was updated successfully, but these errors were encountered: