gregbell/active_admin — pull request #2044 by Daxter (2013-04-03 04:11:34+00:00)
Title: Properly translate renamed resources

This is for #1884, and is a re-wiring of #1885.

The initial problem that #1885 solved was that if you used the `:as` option, translation just didn't happen:
```ruby
def resource_label
if @options[:as]
# just return the string
else
# actually do translation
end
end
```

Unfortunately, to do so #1885 added a lot of duplicated code. This PR is an attempt to find a middle ground.

I had to create my own `translate` method, because for some reason `String#human` wasn't properly respecting `i18n_key`
and the `activerecord.models` I18n scope.

But the result is that now you can rename a resource:
```ruby
ActiveAdmin.register Foo, as: 'Bar'
```

and can have custom translations for `Bar`
```yaml
en:
activerecord:
models:
bar:
one: "Baz"
other: "All the Bazs!"
```