-
Notifications
You must be signed in to change notification settings - Fork 462
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
Can't access non-loaded lazy locales using $t #740
Comments
The Interestingly, there is no way to trigger loading of additional locales right now, short of changing to a given locale. I guess it makes sense to add that. Then you would need to manually ensure that all locales you want to use are loaded before you try to get the translations for that locale. Would that work for you? You would need to programmatically call something like [1] https://kazupon.github.io/vue-i18n/api/#vue-injected-methods |
Thank you for the quick answer and sorry about that late response from my side. Of course - any possibility to add additional language "on the fly" would be nice to have in case of my problem. Although best would be if I could select some language i.e. in $t and that language would be lazy-loaded automatically, but as I said above - adding it manually and checking if lang is loaded before usage sounds good as well. |
That's technically not doable as |
Makes sense. Manual loading locale sounds good too :) Pozdrawiam :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any updates on this? |
@rchl any updates? |
Hello.
I was trying to put two different languages on the same page.
In my example, I'm trying to pull messages for two different languages i.e. polish and french.
The idea is to get language from a browser (fr) and compare it to language from URL(pl) which will show the message about difference and choose between two of them. That message should be in those two languages that I've got from the browser and URL.
I tried use v-t directive with the locale attribute, but it seems to not work as I expected.
Tried also $t with same effect.
After checking i18n object I had only current language messages (in this situation polish) and both strings were translated into polish only...
My nuxt-i18n config
Is there any possibility to use both languages on the same page?
The text was updated successfully, but these errors were encountered: