{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1672","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1672/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1672/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1672/events","html_url":"https://github.com/jhipster/generator-jhipster/pull/1672","id":92771089,"number":1672,"title":"*implementation of enum i18n","user":{"login":"jabelardo","id":3663543,"avatar_url":"https://avatars.githubusercontent.com/u/3663543?v=3","gravatar_id":"","url":"https://api.github.com/users/jabelardo","html_url":"https://github.com/jabelardo","followers_url":"https://api.github.com/users/jabelardo/followers","following_url":"https://api.github.com/users/jabelardo/following{/other_user}","gists_url":"https://api.github.com/users/jabelardo/gists{/gist_id}","starred_url":"https://api.github.com/users/jabelardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabelardo/subscriptions","organizations_url":"https://api.github.com/users/jabelardo/orgs","repos_url":"https://api.github.com/users/jabelardo/repos","events_url":"https://api.github.com/users/jabelardo/events{/privacy}","received_events_url":"https://api.github.com/users/jabelardo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-03T01:28:28Z","updated_at":"2015-07-04T15:32:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/1672","html_url":"https://github.com/jhipster/generator-jhipster/pull/1672","diff_url":"https://github.com/jhipster/generator-jhipster/pull/1672.diff","patch_url":"https://github.com/jhipster/generator-jhipster/pull/1672.patch"},"body":"* implementation of enum i18n\r\n* ~~fix dependency problem with mapstruct requiring an exclusion in springfox-swagger2~~ (to be discussed in a separate thread)\r\n* ~~fixed bad path in liquidbase entities includes~~ (to be discussed in a separate thread)\r\n\r\n@jdubois this PR have a i18n framework for enums based on  angular-translate-interpolation-messageformat\r\n"},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/118523730","html_url":"https://github.com/jhipster/generator-jhipster/pull/1672#issuecomment-118523730","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1672","id":118523730,"user":{"login":"gzsombor","id":66230,"avatar_url":"https://avatars.githubusercontent.com/u/66230?v=3","gravatar_id":"","url":"https://api.github.com/users/gzsombor","html_url":"https://github.com/gzsombor","followers_url":"https://api.github.com/users/gzsombor/followers","following_url":"https://api.github.com/users/gzsombor/following{/other_user}","gists_url":"https://api.github.com/users/gzsombor/gists{/gist_id}","starred_url":"https://api.github.com/users/gzsombor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gzsombor/subscriptions","organizations_url":"https://api.github.com/users/gzsombor/orgs","repos_url":"https://api.github.com/users/gzsombor/repos","events_url":"https://api.github.com/users/gzsombor/events{/privacy}","received_events_url":"https://api.github.com/users/gzsombor/received_events","type":"User","site_admin":false},"created_at":"2015-07-04T15:32:26Z","updated_at":"2015-07-04T15:32:26Z","body":"It would be better, if you could create a filter for the translation functionality, so it can be reused everywhere:\r\n\r\nangular\r\n.module('<%= angularAppName %>')\r\n.filter('<%= enumPrefix %>Filter', ['$translate', function($translate) {\r\nreturn function(input) {\r\nreturn $translate.instant('<%= angularAppName %>.<%= enumName %>.' + input);\r\n};\r\n}]);\r\n\r\nAnd after, whereever you want to display the enum, you can use this filter, and you dont need to remember, what are the translation keys"}}