Mohamad El-Husseini
2012-Apr-27 14:18 UTC
What naming conventions do you use when writing i18n yaml files?
Do you follow naming conventions when writing i18n yaml files? If so, what
are they?
For example, say you have a "Save changes" button that PUTs to
users_controller.update. What would you call it?
users.edit.update_button
users.edit.updatebutton
users.edit.button_update
users.edit.save_changes
etc...
What about flash messages? I have them organized as such now:
controller.action.flash_success and controller.action.flash_error.
Any thoughts on naming conventions? Dashes? Underscores?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/UMmgpRg6SVwJ.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Tim Shaffer
2012-Apr-27 18:55 UTC
Re: What naming conventions do you use when writing i18n yaml files?
For your first example, Rails already has built-in keys for submit buttons
that you can change globally:
en:
helpers:
submit:
create: "Create %{model}"
update: "Update %{model}"
Or only for a specific model:
en:
helpers:
submit:
post:
create: "Create the new post"
update: "Update existing post"
Those are used automatically when you use <%= f.submit %>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/RArjEcDCiqQJ.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.