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

Use Component interpolation for Poralization #1006

Closed
xiezht opened this issue Sep 29, 2020 · 2 comments
Closed

Use Component interpolation for Poralization #1006

xiezht opened this issue Sep 29, 2020 · 2 comments
Labels
Type: Feature Includes new features

Comments

@xiezht
Copy link

xiezht commented Sep 29, 2020

vue & vue-i18n version

  • vue 2.5
  • vue-i18n: 8.21

Description

I would like to use Poraliztion of i18n. At the same time, i want to add some style to the text which will be replaced by i18n.

en: {
    term1: 'no apple | one apple | {count} apples'
}

// I want it to be rendered like following when the variable `count` is larger 1: 
<span>
   <span class="highlight"> count </span> apples.
</span>

So i want to use the Component Interpolation to do that.

<i18n path="term1">
   <span place="count">{{ currentCount }}</span>
</i18n>

But it seems there is no way to combine Component Interpolation with Poralization feature.

Could anyone give me some suggestion to solve for this problem ?

@kazupon kazupon added the Type: Feature Includes new features label Oct 17, 2020
@kazupon
Copy link
Owner

kazupon commented Nov 21, 2020

vue-i18n v9 or later, we can use plural prop at translation component
https://vue-i18n-next.intlify.dev/migration/features.html#translation-component

@kazupon
Copy link
Owner

kazupon commented Mar 5, 2021

we supported in Vue I18n v9.
https://vue-i18n.intlify.dev/api/component.html#translationprops
please try it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Includes new features
Projects
None yet
Development

No branches or pull requests

2 participants