-
Notifications
You must be signed in to change notification settings - Fork 62
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
Multiple modules #115
Comments
Update: I did a quick follow-up in the documentation, and I do now notice that I can only use the plugin once.
However, do you know of any way that I can resolve my issue? By that I mean being able to handle multiple language/localisation handlers? |
Thank you for submitting this issue. This is indeed a very interesting and important use case that is currently not really well supported. The idea with the two separate modules is great. Unfortunately, it will not work as the two plugin invocations register the translation functions on the vue instance (i.e. the $t) with the same names and therefore collide with each other. What you can do, is use the $tlang method or translateIn filter to pass the language that should be used for a translation and base this on an other value that you set specifically.
Please let me know if this works for you, as we are currently in the process of developing version 2 of the plugin and might need to think about this usecase some more. |
Hi,
Is it possible to use the plugin for storing localization information and translations multiple times? What I mean by this, is I would like to have a way to implement an application wide language, and a language that is independent of the app - for example a document language.
I am currently building an application where users would for example log in with the language set to German, but when they create a pdf document for example, with one of the tools in the app, they should have the possiblity of setting/toggling the translation of the document between German and English. This should not effect the application language though, which happens when I change the locale with
Vue.i18n.set(newLocale)
.I thought it would be possible to simply use the plugin twice, as follows:
which I thought would register the internationalize plugin on the vue instance, and will generate helper functions in my Store - once for the default
i18n
module name and thendocumentTranslations
for the second module name. This however, doesn't seem to work, and will always only work for the first one (I only see thei18n
module in my store).Am I missing something or misunderstanding the way this works? Is what I am trying to achieve possible?
The text was updated successfully, but these errors were encountered: