{"action":"created","issue":{"url":"https://api.github.com/repos/ckan/ckan/issues/3211","repository_url":"https://api.github.com/repos/ckan/ckan","labels_url":"https://api.github.com/repos/ckan/ckan/issues/3211/labels{/name}","comments_url":"https://api.github.com/repos/ckan/ckan/issues/3211/comments","events_url":"https://api.github.com/repos/ckan/ckan/issues/3211/events","html_url":"https://github.com/ckan/ckan/pull/3211","id":172481733,"number":3211,"title":"[#3151] Extractable plural translations in JavaScript [WIP]","user":{"login":"torfsen","id":2877717,"avatar_url":"https://avatars.githubusercontent.com/u/2877717?v=3","gravatar_id":"","url":"https://api.github.com/users/torfsen","html_url":"https://github.com/torfsen","followers_url":"https://api.github.com/users/torfsen/followers","following_url":"https://api.github.com/users/torfsen/following{/other_user}","gists_url":"https://api.github.com/users/torfsen/gists{/gist_id}","starred_url":"https://api.github.com/users/torfsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torfsen/subscriptions","organizations_url":"https://api.github.com/users/torfsen/orgs","repos_url":"https://api.github.com/users/torfsen/repos","events_url":"https://api.github.com/users/torfsen/events{/privacy}","received_events_url":"https://api.github.com/users/torfsen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-22T15:26:01Z","updated_at":"2016-11-17T14:27:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ckan/ckan/pulls/3211","html_url":"https://github.com/ckan/ckan/pull/3211","diff_url":"https://github.com/ckan/ckan/pull/3211.diff","patch_url":"https://github.com/ckan/ckan/pull/3211.patch"},"body":"This PR makes plural translations in JS extractable (#3151).\n\nAs discussed in #3151, this PR adds two new JS functions `ckan.i18n._` and `ckan.i18n.ngettext` for singular and plural translations. In contrast to the previous `ckan.i18n.translate` function they do not expose the Jed instance which we use for the actual translation but return the fully translated strings (with inserted placeholder values where appropriate).\n\nCorrespondingly, JS CKAN modules now have `this._` and `this.ngettext` methods as shortcuts for the functions described above. The methods replace the old `this.i18n` / `this.options.i18n` functionality. Similarly, module declaration functions should not take `ckan.i18n` and `ckan.i18n.translate` arguments anymore.\n\nThe existing modules have been updated accordingly.\n\nThe old behavior has been left in place and should still work but is marked as deprecated. The changes should therefore be backwards-compatible.\n\nThe PR is a WIP, in particular the documentation has not been updated. However, the main changes are implemented and I think it's a good time to get some feedback to make sure that we agree on the details.\n\nI haven't included the resulting changes in `ckan.pot` (i.e. the now extracted plural strings) since, as far as I understand, the actual translations are not managed via PRs.\n"},"comment":{"url":"https://api.github.com/repos/ckan/ckan/issues/comments/261259860","html_url":"https://github.com/ckan/ckan/pull/3211#issuecomment-261259860","issue_url":"https://api.github.com/repos/ckan/ckan/issues/3211","id":261259860,"user":{"login":"amercader","id":200230,"avatar_url":"https://avatars.githubusercontent.com/u/200230?v=3","gravatar_id":"","url":"https://api.github.com/users/amercader","html_url":"https://github.com/amercader","followers_url":"https://api.github.com/users/amercader/followers","following_url":"https://api.github.com/users/amercader/following{/other_user}","gists_url":"https://api.github.com/users/amercader/gists{/gist_id}","starred_url":"https://api.github.com/users/amercader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amercader/subscriptions","organizations_url":"https://api.github.com/users/amercader/orgs","repos_url":"https://api.github.com/users/amercader/repos","events_url":"https://api.github.com/users/amercader/events{/privacy}","received_events_url":"https://api.github.com/users/amercader/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T14:27:11Z","updated_at":"2016-11-17T14:27:11Z","body":"@torfsen is this still needed after #3272? If so is it ready for reviewing?"}}
{"actor":{"display_login":"amercader"}}