{"action":"created","issue":{"url":"https://api.github.com/repos/privat/nit/issues/1289","labels_url":"https://api.github.com/repos/privat/nit/issues/1289/labels{/name}","comments_url":"https://api.github.com/repos/privat/nit/issues/1289/comments","events_url":"https://api.github.com/repos/privat/nit/issues/1289/events","html_url":"https://github.com/privat/nit/pull/1289","id":69949225,"number":1289,"title":"i18n annotation","user":{"login":"R4PaSs","id":1444825,"avatar_url":"https://avatars.githubusercontent.com/u/1444825?v=3","gravatar_id":"","url":"https://api.github.com/users/R4PaSs","html_url":"https://github.com/R4PaSs","followers_url":"https://api.github.com/users/R4PaSs/followers","following_url":"https://api.github.com/users/R4PaSs/following{/other_user}","gists_url":"https://api.github.com/users/R4PaSs/gists{/gist_id}","starred_url":"https://api.github.com/users/R4PaSs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/R4PaSs/subscriptions","organizations_url":"https://api.github.com/users/R4PaSs/orgs","repos_url":"https://api.github.com/users/R4PaSs/repos","events_url":"https://api.github.com/users/R4PaSs/events{/privacy}","received_events_url":"https://api.github.com/users/R4PaSs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/privat/nit/labels/need_review","name":"need_review","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-04-21T20:52:31Z","updated_at":"2015-04-24T16:54:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/privat/nit/pulls/1289","html_url":"https://github.com/privat/nit/pull/1289","diff_url":"https://github.com/privat/nit/pull/1289.diff","patch_url":"https://github.com/privat/nit/pull/1289.patch"},"body":"So here's the POC of a new annotation for the compiler: i18n !\r\n\r\nRight now, you can append it to a module declaration with the locale of your choice.\r\n\r\nIt then generates a .pot template file and a .po file for the language you chose when defining your module.\r\n\r\nThe generation of the corresponding .mo (using msgfmt) file is still of the responsability of the user.\r\n\r\nThere's still several modifications to do for real usability, namely the support of superstrings, the possibility to untranslate a literal string via some kind of notranslate annotation (though if no translation is found, the key is kept as argument, so this should not be an issue).\r\n\r\nSo now, when using another value for the $LANGUAGE environment value, a different message will be printed when executing a Nit program, have fun !\r\n\r\nNOTE: I have not yet added a test since I'm not sure how we should proceed. I guess we could just try to generate a .po file and .mo file for the example with a bash script and change the locale on the test server, I'm not sure how to do so, if you have an idea, please let me know."},"comment":{"url":"https://api.github.com/repos/privat/nit/issues/comments/95991002","html_url":"https://github.com/privat/nit/pull/1289#issuecomment-95991002","issue_url":"https://api.github.com/repos/privat/nit/issues/1289","id":95991002,"user":{"login":"R4PaSs","id":1444825,"avatar_url":"https://avatars.githubusercontent.com/u/1444825?v=3","gravatar_id":"","url":"https://api.github.com/users/R4PaSs","html_url":"https://github.com/R4PaSs","followers_url":"https://api.github.com/users/R4PaSs/followers","following_url":"https://api.github.com/users/R4PaSs/following{/other_user}","gists_url":"https://api.github.com/users/R4PaSs/gists{/gist_id}","starred_url":"https://api.github.com/users/R4PaSs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/R4PaSs/subscriptions","organizations_url":"https://api.github.com/users/R4PaSs/orgs","repos_url":"https://api.github.com/users/R4PaSs/repos","events_url":"https://api.github.com/users/R4PaSs/events{/privacy}","received_events_url":"https://api.github.com/users/R4PaSs/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T16:54:20Z","updated_at":"2015-04-24T16:54:20Z","body":"Reroll with the function that I forgot to update with @privat's remarks, sorry !"}}