Skip to content
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

translate="no" in Vue3 is not work #5462

Closed
EryouHao opened this issue Feb 20, 2022 · 4 comments · Fixed by #5485
Closed

translate="no" in Vue3 is not work #5462

EryouHao opened this issue Feb 20, 2022 · 4 comments · Fixed by #5485
Labels
has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working 🔩 p2-edge-case

Comments

@EryouHao
Copy link

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

  1. npm init vue@latest
  2. write code like this:
<div translate="no">Hello Vue.js</div>
<div translate="yes">Hello Vue.js</div>

What is expected?

Expect something like this.

What is actually happening?

Actually:

@posva
Copy link
Member

posva commented Feb 20, 2022

This is because translate attribute exists as dom properties but must be set as a boolean. Maybe we should handle this special case for the "no" value.

For the moment you can either set boolean values or use the ^ in front of the attribute:

<div ^translate="no">
    Hello Vue.js
  </div>
  <div :translate="false">
    Hello Vue.js
  </div>

@posva posva added 🐞 bug Something isn't working has workaround A workaround has been found to avoid the problem 🔩 p2-edge-case labels Feb 20, 2022
@Rolanddoda
Copy link

@posva can you explain more about the ^ in front of the attribute trick?

@posva
Copy link
Member

posva commented Feb 20, 2022

Same a .attr modifier for v-bind

@jairoblatt
Copy link

@Rolanddoda .attr - force a binding to be set as a DOM attribute.

https://vuejs.org/api/built-in-directives.html#v-bind

@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working 🔩 p2-edge-case
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants