{"action":"created","issue":{"url":"https://api.github.com/repos/jamesarosen/ember-i18n/issues/269","labels_url":"https://api.github.com/repos/jamesarosen/ember-i18n/issues/269/labels{/name}","comments_url":"https://api.github.com/repos/jamesarosen/ember-i18n/issues/269/comments","events_url":"https://api.github.com/repos/jamesarosen/ember-i18n/issues/269/events","html_url":"https://github.com/jamesarosen/ember-i18n/issues/269","id":93845345,"number":269,"title":"translation service is not available inside an object","user":{"login":"jludev1","id":6843070,"avatar_url":"https://avatars.githubusercontent.com/u/6843070?v=3","gravatar_id":"","url":"https://api.github.com/users/jludev1","html_url":"https://github.com/jludev1","followers_url":"https://api.github.com/users/jludev1/followers","following_url":"https://api.github.com/users/jludev1/following{/other_user}","gists_url":"https://api.github.com/users/jludev1/gists{/gist_id}","starred_url":"https://api.github.com/users/jludev1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jludev1/subscriptions","organizations_url":"https://api.github.com/users/jludev1/orgs","repos_url":"https://api.github.com/users/jludev1/repos","events_url":"https://api.github.com/users/jludev1/events{/privacy}","received_events_url":"https://api.github.com/users/jludev1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-08T17:23:26Z","updated_at":"2015-07-09T09:34:13Z","closed_at":null,"body":"In code below, \r\n```javascript \r\nimport Ember from 'ember';\r\nimport { translationMacro as t } from \"ember-i18n\";\r\n\r\nexport default Ember.Controller.extend({\r\n  title: t('user’),\r\n\r\n  createButton: {\r\n      title:  t(‘create'), \r\n      action: ‘create'\r\n   },\r\n}\r\n```\r\nt(...) works for title.  \r\nBut t(...) does not work for createButton.title as 'this' in this.get('i18n') is not the controller when t() is called.\r\nIs there a way to handle such scenario?\r\n "},"comment":{"url":"https://api.github.com/repos/jamesarosen/ember-i18n/issues/comments/119889564","html_url":"https://github.com/jamesarosen/ember-i18n/issues/269#issuecomment-119889564","issue_url":"https://api.github.com/repos/jamesarosen/ember-i18n/issues/269","id":119889564,"user":{"login":"jamesarosen","id":2406,"avatar_url":"https://avatars.githubusercontent.com/u/2406?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesarosen","html_url":"https://github.com/jamesarosen","followers_url":"https://api.github.com/users/jamesarosen/followers","following_url":"https://api.github.com/users/jamesarosen/following{/other_user}","gists_url":"https://api.github.com/users/jamesarosen/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesarosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesarosen/subscriptions","organizations_url":"https://api.github.com/users/jamesarosen/orgs","repos_url":"https://api.github.com/users/jamesarosen/repos","events_url":"https://api.github.com/users/jamesarosen/events{/privacy}","received_events_url":"https://api.github.com/users/jamesarosen/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T09:34:13Z","updated_at":"2015-07-09T09:34:13Z","body":"Of course. That does suggest another solution, though. First, you build a custom computed property macro:\r\n```js\r\nfunction hasI18n(obj) {\r\n  return Ember.computed(function() {\r\n    return Ember.Object.createWithMixins(obj, {\r\n      container: this.get('container'),\r\n      i18n: Ember.inject.service()\r\n    });\r\n  });\r\n}\r\n```\r\nThen you use that to write a shorthand version of my initial solution:\r\n```js\r\ncreateButton: hasI18n({\r\n  title:  t(‘create'), \r\n  action: ‘create'\r\n}),\r\n```"}}