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

Label pluralization #974

Closed
wvengen opened this issue Jan 11, 2014 · 1 comment
Closed

Label pluralization #974

wvengen opened this issue Jan 11, 2014 · 1 comment

Comments

@wvengen
Copy link
Contributor

wvengen commented Jan 11, 2014

I've just started to introduce pluralization for activerecord attributes in a project, and noticed that simple_form uses the singular form. In most cases I'd like to show the plural form.

Simple_form could always show the plural, but this may not always be appropriate. Some examples of what could be wanted:

  1. text field labeled "number of units" (pl)
  2. checkbox labeled "breakfast" (sg)
  3. select labeled "choice" (sg)
  4. multi-valued select labeled "selection" (sg)
  5. multi-valued select labeled "your picks" (pl)

If the attribute is only singular (like the checkbox, either yes or no), then the translation would only contain the singular text. If the attribute can be plural, the translation is either plural already, or contains pluralisations. So showing the plural, if it exists, could work in all those cases.

Would it make sense to pass :count => 2 (or more) by default to I18n.t, to have a slightly more sensible default? Or would many existing labels break?

wvengen added a commit to wvengen/foodsoft that referenced this issue Jan 11, 2014
@rafaelfranca
Copy link
Collaborator

I'm not sure if this should be default. Most cases will use singular. In my opinion this is something that need to be handled in the application side.

Thank you for your suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants