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

Named Interpolation with Pluralization Produces Incorrect Output #2032

Closed
4 tasks done
alizadeh118 opened this issue Nov 27, 2024 · 1 comment · Fixed by #2033
Closed
4 tasks done

Named Interpolation with Pluralization Produces Incorrect Output #2032

alizadeh118 opened this issue Nov 27, 2024 · 1 comment · Fixed by #2033
Labels
Status: Review Needed Request for review comments Type: Documentation A documetation fixes

Comments

@alizadeh118
Copy link

Reporting a bug?

Named interpolation is not working with pluralization as expected.
The official example demonstrates using named interpolation for n with the value too many. However, using the exact code in a minimal reproduction produces a different output, which does not include the interpolated value (too many).

Expected behavior

The n parameter is expected to be replaced with the interpolated value (e.g., too many in this example).

Reproduction

https://stackblitz.com/edit/vitejs-vite-dpxmpk?file=src%2FApp.vue

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M1
    Memory: 57.31 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.5.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 131.0.6778.86
    Firefox: 131.0.3
    Safari: 17.0
  npmPackages:
    @vue/compat: ^3.5.13 => 3.5.13 
    vue: ^3.5.13 => 3.5.13 
    vue-chartjs: ^5.2.0 => 5.2.0 
    vue-directive-tooltip: ^1.4.0 => 1.6.3 
    vue-draggable-plus: ^0.2.6 => 0.2.6 
    vue-i18n: ^10.0.4 => 10.0.4 
    vue-loader: ^17.4.2 => 17.4.2 
    vue-persian-datetime-picker: ^2.10.3 => 2.10.4 
    vue-round-filter: ^1.1.2 => 1.1.2 
    vue-router: ^4.4.5 => 4.5.0 
    vue-screen: ^2.4.0 => 2.4.0 
    vue-select: ^3.1.0 => 3.18.3 
    vue-server-renderer: 2.4.4 => 2.4.4 
    vue-spinner: ^1.0.2 => 1.0.4 
    vue-strap: github:wffranco/vue-strap => 2.0.2 
    vue2-highcharts: ^1.2.5 => 1.2.5 
    vue3-click-away: ^1.2.4 => 1.2.4 
    vuedraggable: ^2.16.0 => 2.24.3

Screenshot

No response

Additional context

No response

Validations

@alizadeh118 alizadeh118 added the Status: Review Needed Request for review comments label Nov 27, 2024
@kazupon kazupon added the Type: Documentation A documetation fixes label Nov 28, 2024
@kazupon
Copy link
Member

kazupon commented Nov 28, 2024

Thank you for your reporting!

sorry, docs is wrong.
you need to use via named options, the below:

<p>{{ $t('banana', 100, { named: { n: 'too many' } }) }}</p>

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Request for review comments Type: Documentation A documetation fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants