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.

Easier way to set attribute directly?

See original GitHub issue

First of all, great project! Your blog post about vue-i18n resonates.

But I wonder if it’s a way to set attributes more directly. Let’s say I have this image where I want to localize the alt text: <img :src="logo" alt="Logo of company X" />

As I understand it, I can do:

<img :src="logo" v-bind="$ta('logo')" />

And have a .ftl definition of:

logo =
  .alt = Logo of company X

Is it possible to set it more directly? In vue-i18n-next I can reference the language tag directly:

<img :src="logo" :alt="t('logoAltText')" />

As I understand it, this is not supported now, or maybe it is? If not, do you think it could be? I see the $ta pattern great for translating two or more attributes, but if there is only one, it would be nice to reference the language tag directly?

Again thank you for your work!

EDIT Solved, see my reply to myself 😄

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fippcommented, Jun 9, 2022

By googling “fluent vue” or “vue fluent” I believe 😃

I asked around at my company’s slack channel for tips about i18n, and another team recommended me projectfluent with weblate as localization tool. So far so good!

0reactions
Demivancommented, Jun 9, 2022

By the way there is a Pontoon project by Mozilla. If you need a self-hosted alternative to Weblate

Read more comments on GitHub >

github_iconTop Results From Across the Web

Element.setAttribute() - Web APIs | MDN
Using setAttribute() to modify certain attributes, most notably value in XUL, works inconsistently, as the attribute specifies the default value ...
Read more >
What is the point to use the setAttribute method when there is ...
It's useful when you want to set an attribute which can't be a property of the node (because there's already a property with...
Read more >
5 Ways to Control Attributes in Python. An Example Led Guide
Another way to control the value of attributes is via a custom decorator. In keeping with our theme, let's create the same class,...
Read more >
use always get and set methods is a bad practique, is call ...
I think that in OOP you always should call an attribute by the get method. For example: On set public setAtribute(Atribute atr){ this.atr...
Read more >
Python: How to directly modifying an attributes value - YouTube
Learning Apache Airflow with Python in easy way in 40 Minutes · 4-5: Attributes in XML Files · Python: How to modify an...
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