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

Enum collection in yml now singular instead of plural #141

Open
jjinkxy opened this issue Jun 13, 2018 · 2 comments
Open

Enum collection in yml now singular instead of plural #141

jjinkxy opened this issue Jun 13, 2018 · 2 comments
Assignees

Comments

@jjinkxy
Copy link

jjinkxy commented Jun 13, 2018

I just want to double check, but in the 1.x version it was advised to name the enum collection in the plural form in the i18n yaml file eg.

de:
   enums:
     genders:
       female: 'Frau'
       male: 'Mann'

Now, for 2.x, its advised to name them in the singular form eg.

de:
   enums:
     gender:
       female: 'Frau'
       male: 'Mann'

Is this correct? Otherwise the ViewHelpers wont work?

If so, could this be added to the 1.x-to-2.x-Migration-Guide?

@drobny drobny self-assigned this Jun 20, 2018
@drobny
Copy link
Collaborator

drobny commented Jun 20, 2018

@jjinkxy Sorry for the delay, will do my best to have a look at this within the next couple of days 👍

@drobny
Copy link
Collaborator

drobny commented Jun 22, 2018

Hi @jjinkxy looks like you can use singular or plural case in your localisation file and then use the corresponding singular or plural key when you call the ViewHelpers methods i.e. for your 1.x example enum_option_pairs(User, :genders) which would pick up the plural block in your locale files and similarly for 2.x you would call enum_option_pairs(User, :gender) so it is the way you call the method rather than the restriction of the library.

I appreciate that all the examples in the read me / code use the singular form. If you think it is worth clarifying this in the migration guide / read me feel free to submit a PR 😄

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

3 participants