-
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
Wrong translations when <translate> is used with v-if #111
Comments
I'm experiencing this same issue in my Vue application code. For example, on forms that conditionally render different sections (i.e. this one), I have repeatedly noticed that whatever text was translated first will show up even in completely unrelated conditional branches; even though other aspects of the HTML are properly rendered, the translated text is pulled from the same element in the same position in the wrong conditional tree. It's almost as though the translation is being cached by its position in the DOM, and this cache isn't taking into account changes to the DOM by conditional rendering. I have noticed that switching to |
We could try If it can't be fixed, then we should know the performance overhead of workarounds to minimize the impact. |
I think I have observed this issue some time ago as well, and setting a different |
Found the solution in the docs after doing a bit of horizontal scrolling:
|
We're using your plugin in our open-source project, see demo.photoprism.org
I noticed that
v-if
MAY cause wrong translations with<translate>
like in our conditional navigation, so I changed<translate>Private</translate>
to<span v-translate>Private</span>
(otherwise it was translated as "Photos", not "Private"):https://github.com/photoprism/photoprism/blob/develop/frontend/src/component/p-navigation.vue#L119
However, that also doesn't do the trick in our account settings dialog, so now I'm testing
{{ $gettext('Edit Account') }}
instead. Any drawbacks this might have vs<translate>
?See https://github.com/photoprism/photoprism/blob/develop/frontend/src/dialog/account/p-account-edit-dialog.vue
Also: Is there a way
<translate>
can be fixed/improved?The text was updated successfully, but these errors were encountered: