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
I have a list of paragraphs that I want to translate and render each one with a <p>. But some have a link in it that I want to inject via component interpolation like this:
// en.js{paragraphs: ['foo bar {link}','another paragraph',],}
// index.vue
<!-- how to render this for each paragraph --><i18n-ttag="p" keypath="paragraphs"><template#link><ahref="link" /></template></i18n-t>
It is possible to get the array of translations via $tm, but how to interpolate each translation?
Suggested solution
Maybe there is already a solution that I don't know of. Can I maybe iterate over $tm and interpolate each translated string individually?
dword-design
changed the title
How to use component interpolation for array translations
How to use component interpolation for array (multiple) translations
Aug 30, 2023
Clear and concise description of the problem
I have a list of paragraphs that I want to translate and render each one with a
<p>
. But some have a link in it that I want to inject via component interpolation like this:It is possible to get the array of translations via
$tm
, but how to interpolate each translation?Suggested solution
Maybe there is already a solution that I don't know of. Can I maybe iterate over
$tm
and interpolate each translated string individually?Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: