{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/administrate/issues/298","labels_url":"https://api.github.com/repos/thoughtbot/administrate/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/issues/298/comments","events_url":"https://api.github.com/repos/thoughtbot/administrate/issues/298/events","html_url":"https://github.com/thoughtbot/administrate/pull/298","id":120647486,"number":298,"title":"Support translations for ActiveRecord models","user":{"login":"graysonwright","id":829576,"avatar_url":"https://avatars.githubusercontent.com/u/829576?v=3","gravatar_id":"","url":"https://api.github.com/users/graysonwright","html_url":"https://github.com/graysonwright","followers_url":"https://api.github.com/users/graysonwright/followers","following_url":"https://api.github.com/users/graysonwright/following{/other_user}","gists_url":"https://api.github.com/users/graysonwright/gists{/gist_id}","starred_url":"https://api.github.com/users/graysonwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graysonwright/subscriptions","organizations_url":"https://api.github.com/users/graysonwright/orgs","repos_url":"https://api.github.com/users/graysonwright/repos","events_url":"https://api.github.com/users/graysonwright/events{/privacy}","received_events_url":"https://api.github.com/users/graysonwright/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thoughtbot/administrate/labels/In%20Review","name":"In Review","color":"e6e6e6"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-06T17:38:11Z","updated_at":"2015-12-07T17:05:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thoughtbot/administrate/pulls/298","html_url":"https://github.com/thoughtbot/administrate/pull/298","diff_url":"https://github.com/thoughtbot/administrate/pull/298.diff","patch_url":"https://github.com/thoughtbot/administrate/pull/298.patch"},"body":"## Problem:\r\n\r\nDevelopers are unable to display their ActiveRecord classes in the UI by\r\nany other name than the titleized class name.\r\n\r\nFor example, if a team is building an admin dashboard that will be used in\r\nRussian, they may have ActiveRecord models with English names, that need to\r\nbe translated before they're displayed in the UI.\r\n\r\n## Solution:\r\n\r\nRails has support for [translating ActiveRecord Models][1], which relies on\r\ndefining I18n translations under the `activerecord.models` namespace.\r\n\r\nRails expects translations in the form:\r\n\r\n```yaml\r\nen:\r\n activerecord:\r\n   models:\r\n     user:\r\n       one: Customer\r\n       other: Customers\r\n```\r\n\r\nThe separate `one` and `other` keys allow Rails to display the correct\r\nplural or singular form of the word, depending on the context.\r\n\r\nWe've used Rails' built-in [`ActiveModel::Name#human` method][2] to correctly pull\r\nthe translations out of I18n, with sane fallbacks if the translation is not\r\ndefined.\r\n\r\n[1]: http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models\r\n[2]: http://api.rubyonrails.org/classes/ActiveModel/Name.html#method-i-human"},"comment":{"url":"https://api.github.com/repos/thoughtbot/administrate/issues/comments/162594154","html_url":"https://github.com/thoughtbot/administrate/pull/298#issuecomment-162594154","issue_url":"https://api.github.com/repos/thoughtbot/administrate/issues/298","id":162594154,"user":{"login":"mcmire","id":7371,"avatar_url":"https://avatars.githubusercontent.com/u/7371?v=3","gravatar_id":"","url":"https://api.github.com/users/mcmire","html_url":"https://github.com/mcmire","followers_url":"https://api.github.com/users/mcmire/followers","following_url":"https://api.github.com/users/mcmire/following{/other_user}","gists_url":"https://api.github.com/users/mcmire/gists{/gist_id}","starred_url":"https://api.github.com/users/mcmire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcmire/subscriptions","organizations_url":"https://api.github.com/users/mcmire/orgs","repos_url":"https://api.github.com/users/mcmire/repos","events_url":"https://api.github.com/users/mcmire/events{/privacy}","received_events_url":"https://api.github.com/users/mcmire/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T17:05:39Z","updated_at":"2015-12-07T17:05:39Z","body":"I had one comment, and I would also agree with Joël about why `count: 0` is being used above. Other than these two things I'm good with this."}}