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
Easier way to set attribute directly? #772
Comments
d'oh, i'm stupid. don't know why I didn't realize, but I can already do this:
|
@fipp Thanks for your kind words. Glad you liked the project. <img :src="logo" v-t:logo /> Using I have updated docs with a note that discourages using |
How about setting the attribute directly like so @Demivan, see any problems with that (what I meant in my reply, changed from <img :src="logo" :alt="$t('logoAltText')" /> |
This one is fine. I use this pattern all the time if I need to localize just one attribute. But if there are more attributes I thought about adding |
I'm curious to know, how did you find the project? |
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! |
By the way there is a Pontoon project by Mozilla. If you need a self-hosted alternative to Weblate |
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:
And have a
.ftl
definition of:Is it possible to set it more directly? In
vue-i18n-next
I can reference the language tag directly: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 :D
The text was updated successfully, but these errors were encountered: