Skip to content
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

HTML in params #120

Closed
alexcroox opened this issue Mar 7, 2017 · 2 comments
Closed

HTML in params #120

alexcroox opened this issue Mar 7, 2017 · 2 comments

Comments

@alexcroox
Copy link

alexcroox commented Mar 7, 2017

I would like to reduce the amount of html in locale config and remove the maintenance nightmare if I need to modify the markup inside of it, across multiple languages.

Consider the following example:

This is a test sentence which cannot 
<a href="https://example.com" class="test-class test-another-class">be split</a> 
or it will not make sense

The best solution I can come up with is:

{
    "en": {
        "example": "This is a test sentence which cannot {linkOpen}be split{linkClose} or it will not make sense"
    }
}

and then in the component template

<p v-html="$t('example', { 
    'linkOpen': `<a href="https://example/com" class="test-class test-another-class">`,
    'linkClose: '</a>'
    }) 
"></p>

However this does not work as it seems the $t params do not accept html

@zeev-kell
Copy link

+1

@kazupon
Copy link
Owner

kazupon commented Apr 5, 2017

related #37
I think that this feature can support component interpolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants