{"action":"created","issue":{"url":"https://api.github.com/repos/ttag-org/ttag-cli/issues/46","repository_url":"https://api.github.com/repos/ttag-org/ttag-cli","labels_url":"https://api.github.com/repos/ttag-org/ttag-cli/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/ttag-org/ttag-cli/issues/46/comments","events_url":"https://api.github.com/repos/ttag-org/ttag-cli/issues/46/events","html_url":"https://github.com/ttag-org/ttag-cli/issues/46","id":359262809,"node_id":"MDU6SXNzdWUzNTkyNjI4MDk=","number":46,"title":"Extract translations when ttag is defined globally","user":{"login":"hackedbellini","id":134025,"node_id":"MDQ6VXNlcjEzNDAyNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/134025?v=4","gravatar_id":"","url":"https://api.github.com/users/hackedbellini","html_url":"https://github.com/hackedbellini","followers_url":"https://api.github.com/users/hackedbellini/followers","following_url":"https://api.github.com/users/hackedbellini/following{/other_user}","gists_url":"https://api.github.com/users/hackedbellini/gists{/gist_id}","starred_url":"https://api.github.com/users/hackedbellini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackedbellini/subscriptions","organizations_url":"https://api.github.com/users/hackedbellini/orgs","repos_url":"https://api.github.com/users/hackedbellini/repos","events_url":"https://api.github.com/users/hackedbellini/events{/privacy}","received_events_url":"https://api.github.com/users/hackedbellini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-11T23:41:01Z","updated_at":"2018-09-12T12:47:32Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm trying to change my project from xgettext to ttag. Before I used `jed` and exported a `_` globally (using `window._ = <function>`)\r\n\r\nTrying to use `ttag update` it seems to only get strings from the file that I imported ttag. It would take me a lot of time to add an import in every file that has a `_()` in it.\r\n\r\nIs there an easier way of doing that? Is that a bug or something?"},"comment":{"url":"https://api.github.com/repos/ttag-org/ttag-cli/issues/comments/420635172","html_url":"https://github.com/ttag-org/ttag-cli/issues/46#issuecomment-420635172","issue_url":"https://api.github.com/repos/ttag-org/ttag-cli/issues/46","id":420635172,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDYzNTE3Mg==","user":{"login":"AlexMost","id":1831767,"node_id":"MDQ6VXNlcjE4MzE3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1831767?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexMost","html_url":"https://github.com/AlexMost","followers_url":"https://api.github.com/users/AlexMost/followers","following_url":"https://api.github.com/users/AlexMost/following{/other_user}","gists_url":"https://api.github.com/users/AlexMost/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexMost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexMost/subscriptions","organizations_url":"https://api.github.com/users/AlexMost/orgs","repos_url":"https://api.github.com/users/AlexMost/repos","events_url":"https://api.github.com/users/AlexMost/events{/privacy}","received_events_url":"https://api.github.com/users/AlexMost/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T12:47:32Z","updated_at":"2018-09-12T12:47:32Z","author_association":"MEMBER","body":"Another one option is to create jscodeshift that will add an appropriate `import` or `require` to each file that uses `_` function:\r\n\r\nbefore:\r\n```js\r\n_('test');\r\n```\r\n\r\nafter:\r\n```\r\nimport { gettext as _ } from 'ttag';\r\n_('test');\r\n```"}}
{"actor":{"display_login":"AlexMost"}}