Rails i18n view helpers for things like crud actions, models and and attributes
Ruby HTML CSS JavaScript
Latest commit 3f004bb May 14, 2017 @huerlisi committed on GitHub Merge pull request #7 from casaper/docs/extended_examples_in_readme
Extended the README.md with more examples
Permalink
Failed to load latest commit information.
app fix(ListLinkHelpers): pass class options Dec 8, 2015
bin Use Engine, not Railtie class. Jul 1, 2014
config/locales Add locale for cancel crud action. Feb 13, 2015
lib Bump to 2.0.1 Dec 15, 2015
spec
.gitignore Update gitignore. Jul 1, 2014
.travis.yml Enable docker containers on travis. Jan 7, 2015
CHANGELOG Update CHANGELOG for 2.0.0. Feb 27, 2015
Gemfile Sync Gemfile with has_vcards and update all gems. Jan 7, 2015
Gemfile.lock Sync Gemfile with has_vcards and update all gems. Jan 7, 2015
MIT-LICENSE Move copyright to license. Jun 30, 2014
README.md Extended the Readme with much more examples May 12, 2017
Rakefile Use rspec. Jul 1, 2014
i18n_rails_helpers.gemspec Add sqlite3 to dev dependencies. Jul 1, 2014

README.md

I18nRailsHelpers

Build Status

Rails i18n view helpers for things like crud actions, models and and attributes.

Install

In Rails simply add this to your Gemfile:

gem 'i18n_rails_helpers'

Examples

t_attr

t_attr('first_name', Patient) # en: 'First name' de: 'Vorname' - when called from views of any controller
t_attr('first_name')          # en: 'First name' de: 'Vorname' - when called in patients_controller views
t_attr(:first_name)           # en: 'First name' de: 'Vorname' - can also be called with symbols

t_title

t_title(:index)   # en: "%{model} index" ,  de: "%{model} Liste"
t_title(:edit)    # en: "Edit %{model}",    de: "%{model} bearbeiten"
t_title(:update)  # en: "Edit %{model}",    de: "%{model} bearbeiten"
t_title(:show)    # en: "Show %{model}",    de: "%{model} anzeigen"
t_title(:new)     # en: "New %{model}",     de: "%{model} erfassen"
t_title(:create)  # en: "New %{model}",     de: "%{model} erfassen"
t_title(:delete)  # en: "Delete %{model}",  de: "%{model} löschen"
t_title(:destroy) # en: "Delete %{model}",  de: "%{model} löschen"

t_action

t_action(:index)    # en: "Index",     de: "Liste"
t_action(:edit)     # en: "Edit",      de: "Bearbeiten"
t_action(:update)   # en: "Edit",      de: "Bearbeiten"
t_action(:show)     # en: "Show",      de: "Anzeigen"
t_action(:new)      # en: "New",       de: "Erfassen"
t_action(:create)   # en: "New",       de: "Erfassen"
t_action(:delete)   # en: "Delete",    de: "Löschen"
t_action(:destroy)  # en: "Delete",    de: "Löschen"
t_action(:cancel)   # en: "Abbrechen", de: "Abbrechen"
t_action(:back)     # en: "Back",      de: "Zurück"
t_action(:previous) # en: "Previous",  de: "Zurück"
t_action(:next)     # en: "Next",      de: "Weiter"

t_confirm_delete

t_confirm_delete(@account) # en: 'Really delete account Kasse?' de: 'Konto Kasse wirklich löschen?'

t_select_prompt

t_select_prompt(@account) # en: 'Select Account' de: 'Konto auswählen'

License

Released under the MIT license.