v-t directive if not path, support translate the innerText?
See original GitHub issuedemo:
<h5 class="h3" v-t>Pages</h5>
if support that it can improve the code speed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
vt directive if not path, support translate the innerText ... - Issuehunt
What you want is when v-t directive was empty, it should translate the keypath Pages like v-t="'Pages'". You should change the following code:...
Read more >Custom Directive | Vue I18n
You can translate not only with $t , but also with the v-t custom directive. String syntax #. You can pass the keypath...
Read more >Custom directive localization | Vue I18n
Custom directive localization. Support Version. 7.3+. You can translate not only with v-t custom directive, but also with the $t method.
Read more >angular.translate not working in the context of <br> in HTML
If you put translation inside an html element, all the child elements will be overwritten by the translation value. Instead you can try...
Read more >Performance optimization of vue-i18n - Medium
Translation performance is `compiler module > custom directive v-t > $t ... In this way, vue-i18n reduce the translation cost so as not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This looks like a feature that angular-translate supports for a long time: angular-translate directive I’ve used this a lot in Angularjs projects and really like it.
Writing
{{ $('
and') }}
adds quite some cognitive load. The same goes forv-t="'
and'"
.Instead of writing
you can write
$t
.I like this proposal.
I also believe that this syntax must be accepted. And the example given is invalidated by the following fact that:
Does not work perfectly and deletes the span tag internally. But it can be circumvented using another tag:
I believe that the same thing can be done in the use that was mentioned above
What @icai talked about is that it would be interesting to add the syntax that by adding the empty v-t suffix within an element, it will take its content and translate it as if it were the way. Example below:
This code will have the same result as:
I believe that in the way that is being proposed in this issue it would be much more pleasant to read the code than to see the element tags that are often full of information.