Skip to content

Commit

Permalink
Merge pull request #99 from silviorelli/silviorelli-i18n-docs
Browse files Browse the repository at this point in the history
Docs for translations in i18n yaml file
  • Loading branch information
lwe committed Apr 17, 2015
2 parents e650731 + d284698 commit 2189bbd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,23 @@ so expect them to change in future versions of SimpleEnum.
translate_enum user, :gender # => "Frau" # assuming :de and translations exist
te user, :gender # translate_enum is also aliased to te
```

Provide translations in the i18n yaml file like:

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

- Build a select tag with a translated dropdown and symbol as value:

```ruby
select :user, :gender, enum_option_pairs(User, :gender)
```

- ...and one with the index as value:

```ruby
Expand Down

0 comments on commit 2189bbd

Please sign in to comment.