{"action":"opened","issue":{"url":"https://api.github.com/repos/LotusTM/Kotsu/issues/49","labels_url":"https://api.github.com/repos/LotusTM/Kotsu/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/LotusTM/Kotsu/issues/49/comments","events_url":"https://api.github.com/repos/LotusTM/Kotsu/issues/49/events","html_url":"https://github.com/LotusTM/Kotsu/issues/49","id":111788790,"number":49,"title":"Strings extraction","user":{"login":"ArmorDarks","id":4460311,"avatar_url":"https://avatars.githubusercontent.com/u/4460311?v=3","gravatar_id":"","url":"https://api.github.com/users/ArmorDarks","html_url":"https://github.com/ArmorDarks","followers_url":"https://api.github.com/users/ArmorDarks/followers","following_url":"https://api.github.com/users/ArmorDarks/following{/other_user}","gists_url":"https://api.github.com/users/ArmorDarks/gists{/gist_id}","starred_url":"https://api.github.com/users/ArmorDarks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArmorDarks/subscriptions","organizations_url":"https://api.github.com/users/ArmorDarks/orgs","repos_url":"https://api.github.com/users/ArmorDarks/repos","events_url":"https://api.github.com/users/ArmorDarks/events{/privacy}","received_events_url":"https://api.github.com/users/ArmorDarks/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LotusTM/Kotsu/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/LotusTM/Kotsu/labels/i18n","name":"i18n","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-16T08:47:11Z","updated_at":"2015-10-16T08:47:11Z","closed_at":null,"body":"There seems to be very few Node solutions for extraction of gettext strings into `.pot` file, which then could be used for translation into different locales, and all of them have issues:\r\n\r\n* **[jsxgettext](https://github.com/zaach/jsxgettext)**\r\n\r\n  Node implementation of `xgettext`\r\n\r\n  Pros:\r\n  * Pure Node implementation\r\n  * Supports Swig (thus works with Nunjucks)\r\n\r\n  Cons:\r\n  * Can extract only from singular and plural functions: https://github.com/zaach/jsxgettext/issues/95\r\n  * Can't extract context and domain, thus can't handle properly functions with such arguments: https://github.com/zaach/jsxgettext/issues/94\r\n  * Parser failing to parse some ordinary Nunjucks declarations (https://github.com/zaach/jsxgettext/issues/83 and https://github.com/zaach/jsxgettext/issues/78)\r\n  * Doesn't extract comments from Nunjucks: https://github.com/zaach/jsxgettext/issues/86\r\n  * Doesn't merge extracted strings properly: https://github.com/zaach/jsxgettext/issues/90\r\n  * Doesn't support custom function names properly (minor): https://github.com/zaach/jsxgettext/issues/93\r\n\r\n* **[grunt-i18n-abide](https://github.com/mozilla/grunt-i18n-abide)**\r\n\r\n  Ready Grunt task with set of useful gettext-related tools\r\n\r\n  Pros:\r\n     * Set of ready tools for Grunt\r\n\r\n   Cons:\r\n      * Uses [jsxgettext](https://github.com/zaach/jsxgettext) for extraction, thus has same issues\r\n      * Doesn't work in Windows environment: https://github.com/mozilla/grunt-i18n-abide/issues/47\r\n\r\n* **[grunt-xgettext](https://github.com/arendjr/grunt-xgettext)**\r\n\r\n  Another Node/Grunt implementation of `xgettext`\r\n\r\n  Pros:\r\n     * Pure Node implementation\r\n     * Supports context\r\n\r\n   Cons:\r\n     * Doesn't support custom function names properly (minor): https://github.com/arendjr/grunt-xgettext/issues/8\r\n     * Doesn't have native support for Jinja or Nunjucks: https://github.com/arendjr/grunt-xgettext/issues/21\r\n\r\n       Can parse in `html` mode, but in such case there are a lot of limitations\r\n     \r\n     * Can extract comments in expected form only from JavaScript: https://github.com/arendjr/grunt-xgettext#context-and-comments\r\n     * Doesn't support domains: https://github.com/arendjr/grunt-xgettext/issues/6\r\n\r\n* **Python Babel**\r\n\r\n  Some more informations:\r\n  * http://babel.edgewall.org/\r\n  * http://babel.pocoo.org/docs/messages/#message-extraction\r\n  * [Python Babel for Jinja](http://jinja.pocoo.org/docs/dev/integration/)\r\n\r\n  *Note: didn't test yet*\r\n\r\n  Pros:\r\n  * Has Jinja integration\r\n  * Can do everything that native `gettext` can (I suppose)\r\n\r\n  Cons:\r\n  * Hostile environment\r\n  * External dependency\r\n\r\n* **[POEdit](https://poedit.net/)**\r\n\r\n  Works with inbuilt `gettext`, can extract from JS, PHP, etc. JS and PHP extractors seems to be working for Nunjucks\r\n\r\n  Pros:\r\n  * Seems to be working\r\n\r\n  Cons:\r\n  * External dependency\r\n  * No API or CLI, only standalone program\r\n  * Doesn't have explicit support for Jinja or Nunjucks, but JS and PHP parsers seems to work\r\n\r\n* **Native `xgettext`**\r\n\r\n  Pros:\r\n  * Works\r\n\r\n  Cons:\r\n  * External dependency\r\n  * Doesn't have explicit support for Jinja or Nunjucks, but JS and PHP parsers seems to work\r\n  * Needs wrapper for processing batch files"}}