Skip to content
This repository was archived by the owner on May 19, 2022. It is now read-only.

v-t and HTML in Translation Strings #114

Open
straub opened this issue Aug 7, 2020 · 0 comments
Open

v-t and HTML in Translation Strings #114

straub opened this issue Aug 7, 2020 · 0 comments

Comments

@straub
Copy link

straub commented Aug 7, 2020

In my apps I have several cases where I'd like to use v-t, but my translations often include HTML content. Since v-t uses el.textContent (https://github.com/panter/vue-i18next/blob/master/src/directive.js#L68), I have to resort to other workarounds like v-html="$t()", which are more verbose and trigger ESLint warnings (b/c ESLint can't know my translations are safe).

Would you be open to a PR that adds an option for v-t to use el.innerHTML instead? Or possibly prefer another approach? I'm willing to put in the work!

Thanks for your time :)

@straub straub changed the title v-t And HTML in Translation Strings v-t and HTML in Translation Strings Aug 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant