BazingaJsTranslationBundle
BazingaJsTranslationBundle copied to clipboard
Not detecting language
Hello,
I'm having a struggle since it's not working for me (I've running Symfony 3.4 +js-translation-bundle v2.6.5)
<script src="{{ asset('bundles/bazingajstranslation/js/translator.min.js') }}"></script>
<script src="{{ url('bazinga_jstranslation_js', { 'domain': 'vue' }) }}?locales=fr,en"></script>
When I have a {_locale} in french (let's say /fr/homepage), the bundle dumps only the english key. I have to add ?locales=fr,en to be sure french locale is added.
Well, the translation loader controller does not use the request locale to decide what locales should be loaded. It loads what the query string tells it to load (allowing better caching as it does not need to vary based on everything impacting the locale detection).