BazingaJsTranslationBundle icon indicating copy to clipboard operation
BazingaJsTranslationBundle copied to clipboard

Not detecting language

Open tristanbes opened this issue 7 years ago • 1 comments

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.

tristanbes avatar Dec 06 '17 12:12 tristanbes

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).

stof avatar Jul 26 '18 17:07 stof