-
Notifications
You must be signed in to change notification settings - Fork 52
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
Better support for HTML tags inside translated strings #58
Comments
Why closing this? :-( |
Because it has over one year and zero follow-up, which is our policy pertaining to old issues. I could reopen this if you plan on opening a pull request to fix it, or if anybody plusses it. |
I mean, this is a requirement for the following issues to be fixed:
Which I think have some activity? |
OK, I'll reopen it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(This is a followup to Polyconseil/vue-gettext#93.)
As an example, let's look at the following simple Vue template:
Currently this is extracted as:
I would propose that instead of requiring HTML to be embedded inside translation, which opens your to XSS attacks, and which makes it possible only to use standard HTML but not things like Vue components inside translations, we would parse such string in a smarter way to allow Vue library like
vue-gettext
to render those HTML segments through Vue.I would suggest that the above is parsed as:
Because it is HTML, we can collapse whitespace. Moreover, we provide a placeholder to interpolate the internal HTML in. So in a way, only top-level text nodes would be used and everything else would be delegated to placeholder and library to fill.
translate-name
can be used to control the name of the placeholder (otherwise by default we could use some sequence number).We should also support parsing the case where internal
<div>
is translated as well. In that casefoo
should become anothermsgId
.The text was updated successfully, but these errors were encountered: