Skip to content
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

Fallback translatations not loaded #307

Open
ohaag opened this issue Dec 22, 2020 · 0 comments
Open

Fallback translatations not loaded #307

ohaag opened this issue Dec 22, 2020 · 0 comments

Comments

@ohaag
Copy link

ohaag commented Dec 22, 2020

Hello,

I'm currently having some trouble with the fallback behaviour.
In this method, shouldn't the fallbackLocale be added to the default locales ?

$locales = array($request->getLocale());

Because, currently it will use the explicitly specified locales or the request locale .
In every cases, Translator fallback is not working cause fallbackLocale is just not included in the return of route 'bazinga_jstranslation_js'.

As a workaround I have to include the fallbackLocale manually as mentioned here : #214 (comment)
<script src="{{ url('bazinga_jstranslation_js',{"locales": app.request.locale ~ ",en"}) }}"></script>

Example:

  • Default locale : fr
  • Locale : it
  • Fallback : en

User was by default in FR, he switched in IT but there's a missing translation key 'app.country'. It should be loaded from EN translations but it's not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant