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

Plural form with default message #140

Open
7nights opened this issue Sep 3, 2020 · 1 comment
Open

Plural form with default message #140

7nights opened this issue Sep 3, 2020 · 1 comment

Comments

@7nights
Copy link

7nights commented Sep 3, 2020

In the example you can use variables with defaultMessage like
intl.get('HELLO', { name }).d(`Hello, ${name}`); // "Hello, Tony". But is there anyway to get defaultMessage to work with locale template like
intl.get('HELLO', { num }).d("You have {num, plural, =0 {no photos.} =1 {one photo.} other {# photos.}}" )" }) . For example, maybe add a parameter to intl.get: intl.get(key, variables, defaultMessage) or you may need to do some refactoring to make it work with current apis.

@cwtuan
Copy link
Collaborator

cwtuan commented Sep 4, 2020

Currently, the defaultMessage is just support the ES6 string template.
I will take this into consideration for next major release.

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

2 participants