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 pluralization in component interpolation. #1684

Open
3 tasks done
doubaozia opened this issue Sep 22, 2023 · 0 comments
Open
3 tasks done

Use pluralization in component interpolation. #1684

doubaozia opened this issue Sep 22, 2023 · 0 comments
Labels
Status: Proposal Request for comments

Comments

@doubaozia
Copy link

Clear and concise description of the problem

We should use pluralization in component interpolation, but there's no usage document found. And I checked the source code found it not supported yet.
This is a simple example below:
<i18n path="total-items" tag="p"> <span class="text-info">{{ this.selectedLength }}</span> </i18n>
The corresponding message is like:
{ 'en-US': { 'total-items': 'total {n} item | total {n} items' } }
The text should be changed according to the "this.selectedLength" variable.

Suggested solution

These are the choices solution:

  1. Add new props to the "i18n" component such as plural="true" and params="{ n: xxx }"
  2. Add a new component called "i18n-plural" with the prop params="{ n: xxx }"

Alternative

No response

Additional context

No response

Validations

@doubaozia doubaozia added the Status: Proposal Request for comments label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

1 participant