{"action":"created","issue":{"url":"https://api.github.com/repos/ocombe/ng2-translate/issues/369","repository_url":"https://api.github.com/repos/ocombe/ng2-translate","labels_url":"https://api.github.com/repos/ocombe/ng2-translate/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/ocombe/ng2-translate/issues/369/comments","events_url":"https://api.github.com/repos/ocombe/ng2-translate/issues/369/events","html_url":"https://github.com/ocombe/ng2-translate/issues/369","id":196852373,"number":369,"title":"how to retain original innerText while missing translator?","user":{"login":"fishen","id":17705466,"avatar_url":"https://avatars.githubusercontent.com/u/17705466?v=3","gravatar_id":"","url":"https://api.github.com/users/fishen","html_url":"https://github.com/fishen","followers_url":"https://api.github.com/users/fishen/followers","following_url":"https://api.github.com/users/fishen/following{/other_user}","gists_url":"https://api.github.com/users/fishen/gists{/gist_id}","starred_url":"https://api.github.com/users/fishen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fishen/subscriptions","organizations_url":"https://api.github.com/users/fishen/orgs","repos_url":"https://api.github.com/users/fishen/repos","events_url":"https://api.github.com/users/fishen/events{/privacy}","received_events_url":"https://api.github.com/users/fishen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-21T05:54:20Z","updated_at":"2016-12-22T02:45:44Z","closed_at":"2016-12-21T16:17:00Z","body":"The key name is impertinent, I implemented MissingTranslationHandler and got default value from interpolateParams:\r\n\r\n```\r\nexport class MyMissingTranslationHandler implements MissingTranslationHandler {\r\n    handle(params: MissingTranslationHandlerParams) {\r\n        let defaultValue = params.interpolateParams ? params.interpolateParams['default'] : null;\r\n        defaultValue = defaultValue || params.key;\r\n        return defaultValue;\r\n    }\r\n}\r\n```\r\n`<h1 [translate]=\"'login'\" [translateParams]=\"{default:'登录'}\">登录</h1>`\r\n\r\nIt works, but too complicated.Is there a simpler way to implement it? like following code:\r\n\r\n`<h1 [translate]=\"'login'\">登录</h1>`"},"comment":{"url":"https://api.github.com/repos/ocombe/ng2-translate/issues/comments/268704522","html_url":"https://github.com/ocombe/ng2-translate/issues/369#issuecomment-268704522","issue_url":"https://api.github.com/repos/ocombe/ng2-translate/issues/369","id":268704522,"user":{"login":"fishen","id":17705466,"avatar_url":"https://avatars.githubusercontent.com/u/17705466?v=3","gravatar_id":"","url":"https://api.github.com/users/fishen","html_url":"https://github.com/fishen","followers_url":"https://api.github.com/users/fishen/followers","following_url":"https://api.github.com/users/fishen/following{/other_user}","gists_url":"https://api.github.com/users/fishen/gists{/gist_id}","starred_url":"https://api.github.com/users/fishen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fishen/subscriptions","organizations_url":"https://api.github.com/users/fishen/orgs","repos_url":"https://api.github.com/users/fishen/repos","events_url":"https://api.github.com/users/fishen/events{/privacy}","received_events_url":"https://api.github.com/users/fishen/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T02:45:44Z","updated_at":"2016-12-22T02:45:44Z","body":"Thanks! @ocombe. The drective 'translate' solved this problem, but it requires that the key and the text are equal. I think an alias might be more generic while getting the translator from api.  "}}
{"actor":{"display_login":"fishen"}}