You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<div:markdown>
# Why?
The `markdown` feature saves *time* and _lines of code_
in some cases:
- blablabla
- ...
</div>
This would be particularly useful with text generated from i18n.
We could output text in any language with just
<div:markdown>
{{ $t('my_text') }}
</div>
by writing this in en.json:
"my_text": "As we like both, the [chocolate](chocolink) that you bring *may* be dark or with milk."
and in de.json:
"my_text": "Da wir beide mögen, *darf* die [Schokolade](chocolink), die du bringst, dunkel oder mit Milch sein."
(chocolink would be a variable/ref in the component calling $t)
... instead of the current situation where we deal with two very different structures (you noticed that the languages put the bold word and the link in incompatible orders) and we therefore need to:
hard-code language structures with v-ifv-else and stuff like <a><b>,
create more code, slowing development down,
create redundant language data (json + html), if one is changed then the other breaks (bad maintainability):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Imagine if Vue allowed for something like
This would be particularly useful with text generated from
i18n
.We could output text in any language with just
by writing this in en.json:
and in de.json:
(
chocolink
would be a variable/ref in the component calling$t
)... instead of the current situation where we deal with two very different structures (you noticed that the languages put the bold word and the link in incompatible orders) and we therefore need to:
v-if
v-else
and stuff like<a>
<b>
,Beta Was this translation helpful? Give feedback.
All reactions