question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

isBooleanAttr for the HTML attribute 'translate'

See original GitHub issue

Version

2.6.11

Reproduction link

https://jsfiddle.net/hgaL8t5n/

Steps to reproduce

Use translate=no in a template

What is expected?

template=no to be rendered in the HTML

What is actually happening?

translate=translate is being rendered instead

You can use devtools to inspect the rendered HTML in the reproducible JSFiddle example.


There is a isBooleanAttr-variable somewhere in the Vue code which marks translate as a boolean, probably to be used like the disabled attribute works.

This is incorrect for two reasons:

  1. “translate” is not a valid value for the attribute (only “”, “yes” and “no” are valid). See the spec: https://html.spec.whatwg.org/multipage/dom.html#attr-translate
  2. this translate-attribute is mostly used to indicate not to translate it, so when specifying “no”, people actually mean “no”

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
posvacommented, May 13, 2020

Maybe we should just remove it from the list. I don’t know the reason it was initially added

0reactions
quoctienlam2605commented, Sep 17, 2020

Hello-word

Read more comments on GitHub >

github_iconTop Results From Across the Web

translate - HTML: HyperText Markup Language | MDN
The translate global attribute is an enumerated attribute that is used to specify whether an element's translatable attribute values and its ...
Read more >
Using HTML's translate attribute - W3C
HTML5 has a list of attributes that are to be translated by default, but these attributes should not be translated if they are...
Read more >
HTML Global translate Attribute - W3Schools
The translate attribute specifies whether the content of an element should be translated or not.
Read more >
What is the translate attribute in HTML? - Educative.io
In HTML, the translate attribute is used to identify whether the text content of an element can be translated to another language or...
Read more >
How to enable HTML attribute translation?
In modern web applications it is common to use custom HTML attributes like data-* which later can get parsed by Javascript. By default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found