{"action":"created","issue":{"url":"https://api.github.com/repos/ember-intl/ember-intl/issues/579","repository_url":"https://api.github.com/repos/ember-intl/ember-intl","labels_url":"https://api.github.com/repos/ember-intl/ember-intl/issues/579/labels{/name}","comments_url":"https://api.github.com/repos/ember-intl/ember-intl/issues/579/comments","events_url":"https://api.github.com/repos/ember-intl/ember-intl/issues/579/events","html_url":"https://github.com/ember-intl/ember-intl/issues/579","id":328956901,"node_id":"MDU6SXNzdWUzMjg5NTY5MDE=","number":579,"title":"Passthrough options hash to missing-message","user":{"login":"buschtoens","id":834636,"node_id":"MDQ6VXNlcjgzNDYzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/834636?v=4","gravatar_id":"","url":"https://api.github.com/users/buschtoens","html_url":"https://github.com/buschtoens","followers_url":"https://api.github.com/users/buschtoens/followers","following_url":"https://api.github.com/users/buschtoens/following{/other_user}","gists_url":"https://api.github.com/users/buschtoens/gists{/gist_id}","starred_url":"https://api.github.com/users/buschtoens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buschtoens/subscriptions","organizations_url":"https://api.github.com/users/buschtoens/orgs","repos_url":"https://api.github.com/users/buschtoens/repos","events_url":"https://api.github.com/users/buschtoens/events{/privacy}","received_events_url":"https://api.github.com/users/buschtoens/received_events","type":"User","site_admin":false},"labels":[{"id":171077007,"node_id":"MDU6TGFiZWwxNzEwNzcwMDc=","url":"https://api.github.com/repos/ember-intl/ember-intl/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-04T08:31:15Z","updated_at":"2018-06-06T11:45:50Z","closed_at":null,"author_association":"NONE","body":"It would be great, if the [`missing-message`](https://github.com/ember-intl/ember-intl/blob/2273bbe1269e125135ab5da9c3077e9dd1280e7b/docs/missing-translations.md) util could also get access to the options hash. This would allow a setup like this:\r\n\r\n```hbs\r\n{{t \"some.optional.translation\" allowMissing=true}}\r\n{{t \"some.required.translation\"}} {{!-- allowMissing=false is the implicit default --}}\r\n```\r\n\r\n```js\r\n// app/utils/intl/missing-message.js:\r\n\r\nexport default function missingMessage(key, locales, options) {\r\n  if (options.allowMissing) {\r\n    return ''; // return empty string in order to not crash consumers\r\n  }\r\n  assert(`[ember-intl] Missing translation for key: \"${key}\" for locales: \"${locales}\"`);\r\n}\r\n```\r\n\r\nThis is not a dupe of https://github.com/ember-intl/ember-intl/issues/553, which is about conditionally throwing hard errors at build time. This issue is about conditionally throwing errors at run time."},"comment":{"url":"https://api.github.com/repos/ember-intl/ember-intl/issues/comments/395040280","html_url":"https://github.com/ember-intl/ember-intl/issues/579#issuecomment-395040280","issue_url":"https://api.github.com/repos/ember-intl/ember-intl/issues/579","id":395040280,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTA0MDI4MA==","user":{"login":"buschtoens","id":834636,"node_id":"MDQ6VXNlcjgzNDYzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/834636?v=4","gravatar_id":"","url":"https://api.github.com/users/buschtoens","html_url":"https://github.com/buschtoens","followers_url":"https://api.github.com/users/buschtoens/followers","following_url":"https://api.github.com/users/buschtoens/following{/other_user}","gists_url":"https://api.github.com/users/buschtoens/gists{/gist_id}","starred_url":"https://api.github.com/users/buschtoens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buschtoens/subscriptions","organizations_url":"https://api.github.com/users/buschtoens/orgs","repos_url":"https://api.github.com/users/buschtoens/repos","events_url":"https://api.github.com/users/buschtoens/events{/privacy}","received_events_url":"https://api.github.com/users/buschtoens/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T11:45:50Z","updated_at":"2018-06-06T11:45:50Z","author_association":"NONE","body":"The problem is, that `resilient` and `allowMissing` have slightly different semantics.\r\n\r\nLetting `missingMessage` handle the `resilient` logic instead of having `lookup` do it\r\n\r\nhttps://github.com/ember-intl/ember-intl/blob/96a63c31f5d1f05970c4957c496a9f708225150e/addon/services/intl.js#L102-L113\r\n\r\nwould mean that users could accidentally break the `defaults` logic of `t`,\r\n\r\nhttps://github.com/ember-intl/ember-intl/blob/96a63c31f5d1f05970c4957c496a9f708225150e/addon/services/intl.js#L116-L131\r\n\r\nbecause `missingMessage` would need to know, if there are still some defaults left to try, before returning a fallback string, which could potentially be truthy and therefore break the `!msg` condition in L124."}}
{"actor":{"display_login":"buschtoens"}}