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

"all" string pluralization shorthand #2544

Open
spy-v2 bot opened this issue Jan 30, 2023 · 0 comments
Open

"all" string pluralization shorthand #2544

spy-v2 bot opened this issue Jan 30, 2023 · 0 comments
Assignees

Comments

@spy-v2
Copy link

spy-v2 bot commented Jan 30, 2023

Slack Thread

Chema Balsas [2023-01-30 02:48PM UTC]

with 0 now acting as kind of a none key, I wonder if there could be an equivalent all in the spec for the cases where you’re showing {count} of {total} and count === total . Based on our conversation, I see how that’s suited for an if statement and probably not a true pluralzation context, but it would be sweet if this could also be somehow accounted for since it’s another variation over the string that we use to have :thinking_face:

Michael Overmeyer [2023-01-30 02:50PM UTC]

So the string would change to Cancel all orders? Instead of Cancel 192 orders?

Chema Balsas [2023-01-30 03:19PM UTC]

exactly!

Chema Balsas [2023-01-30 03:19PM UTC]

or to all orders cancelled from 4 of 8 orders cancelled

Chema Balsas [2023-01-30 03:22PM UTC]

I didn’t see this in the spec on a quick search (but I’m not familiar with it). This requiring 2 vars, I guess it could work like this:

i18n.translate('localized.key', {
  count: countNumber,
  total: totalNumber.
  all: countNumber === totalNumber
})

technically this would just hide the if , but it also keeps all the strings closer together (by meaning, if not semantically)

Michael Overmeyer [2023-01-30 03:40PM UTC]

It's interesting. Not sure I'd be interested in doing that right now, given that it's niche / the first time I've heard about it.

I'll log a ticket all the same so we can consider it.
The 0 and 1 cases were more of a no-brainer, since it brings us closer to the CLDR spec, while this would be us inventing new conventions.

Chema Balsas [2023-01-30 03:46PM UTC]

👍

@movermeyer movermeyer self-assigned this Jan 30, 2023
@movermeyer movermeyer changed the title 'all' string shorthand "all" string pluralization shorthand Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant