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

Improve selector usages in the wiki #364

Open
juliancoffee opened this issue Jan 17, 2024 · 1 comment
Open

Improve selector usages in the wiki #364

juliancoffee opened this issue Jan 17, 2024 · 1 comment

Comments

@juliancoffee
Copy link

# ✅ All variants are language-specific. The [0] variant adds
# flavor to the translation. The default variant still works 
# for all values of the selector, even if "0 new notifications"
# sounds a bit off.
new-notifications =
    { $num ->
        [0] No new notifications.
        [one] New notification.
       *[other] { $num } new notifications.
    }

Good Practices shows this example as good practice, which is better than other ones, but fluent code itself might give the wrong impression. [one] doesn't generally mean 1. Just like [few] doesn't mean "something between 2 and 5".
[one] means "all numbers that inflate by the same rules like number 1", which in English corresponds to the number 1, but that's just a happy accident if any, and examples should use [1].

@heyakyra
Copy link

Tangentially, there's much more examples of different functionality on the Mozilla localization docs. Maybe wouldn't be needed if more of that was here

https://mozilla-l10n.github.io/localizer-documentation/tools/fluent

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