-
Notifications
You must be signed in to change notification settings - Fork 55
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
Problem with translations not updating when using v-if #29
Labels
Comments
@kennyki excellent work, thanx! A good way to generate a unique key is to use a |
Sure @kemar. Will work on it soon. |
kennyki
added a commit
to kennyki/vue-gettext
that referenced
this issue
Jun 28, 2017
…e elements correctly. This fixes Polyconseil#29
Thank you very much @kennyki :) |
Glad that I could help :-) |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stumbled upon this issue with
v-if
on thev-translate
directive in my project, however the same issue can be replicated with thetranslate
directive.In the component spec, try:
It will output:
Root cause
It is because of:
as explained in the section of special attribute 'key'
Solution 1
Add
key
attribute manually totranslate
orv-translate
This is the immediate fix for anyone having this issue.
However this is not really ideal because we need to ensure that the keys are unique within each
v-if
block.Solution 2
Improve
translate
andv-translate
to auto-generatekey
attribute if it's not present. I'll be looking at this, need to find a good way to generate unique keys.Any idea?
The text was updated successfully, but these errors were encountered: