question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for pluralization locales in component interpolation

See original GitHub issue

In order to avoid having to add markup to translations it would be helpful if component interpolation would also work for pluralization locales.

const messages = {
  en: {
    comments: 'No comments | {n} comment | {n} comments'
  }
}
<i18n path="comments" tag="p">
  <b place="n">{{ comments.length }}</b>
</i18n>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:35
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
ymhrcommented, Mar 25, 2019

What about an alternative implementation like:

<i18n path="some.path" :plural="3" />

It feels weird that there’s some significant functionality in this library that you can’t use if you’re using the <i18n /> tag, unless I am missing something?

7reactions
mariomkacommented, Apr 28, 2020

Something new? It will be so useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component interpolation | Vue I18n
Support Version. 7.0+. Sometimes, we need to localize with a locale message that was included in a HTML tag or component. For example:....
Read more >
Internationalization in React: Interpolation, Formatting and ...
Any string related specific changes based on locales. Plurals. In this example, we will see the date and string formatting. First, we will ......
Read more >
Component Interpolation | Vue I18n - Intlify
Component Interpolation #. Basic Usage #. Sometimes, we need to localize with a locale message that was included in a HTML tag or...
Read more >
React localization with i18next - LogRocket Blog
Learn how to localize React apps for an international audience with the internationalization framework, i18next.
Read more >
The Ultimate Vue Localization Guide | Phrase
We added router support and opted out of TypeScript when the ... Resource » The Component Interpolation section of the official guide covers ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found