{"action":"created","comment":{"url":"https://api.github.com/repos/internetarchive/openlibrary/pulls/comments/174314708","pull_request_review_id":103648449,"id":174314708,"diff_hunk":"@@ -132,7 +135,7 @@ <h1>$_(\"Edit Author\")</h1>\n             </div>\n \n         $if ctx.user and ctx.user.is_admin():\n-            <div class=\"adminOnly\" style=\"position:absolute;top:50px;right:20px;\"><button type=\"submit\" value=\"$_('Delete Record')\" name=\"_delete\" title=\"$_('Delete this macro?')\" id=\"deleteTop\">$_(\"Delete Record\")</button></div>\n+            <div class=\"adminOnly\" style=\"position:absolute;top:50px;right:20px;\"><button type=\"submit\" value=\"$_('Delete Record')\" name=\"_delete\" title=\"$_('Delete Record')\" id=\"deleteTop\">$_(\"Delete Record\")</button></div>","path":"openlibrary/templates/type/author/edit.html","position":17,"original_position":17,"commit_id":"f5d6f6b795b2209e048da0904fc643df45bdacef","original_commit_id":"be85cd4c3cd065c50a2e62b301c5723539f86ab1","user":{"login":"hornc","id":905545,"avatar_url":"https://avatars0.githubusercontent.com/u/905545?v=4","gravatar_id":"","url":"https://api.github.com/users/hornc","html_url":"https://github.com/hornc","followers_url":"https://api.github.com/users/hornc/followers","following_url":"https://api.github.com/users/hornc/following{/other_user}","gists_url":"https://api.github.com/users/hornc/gists{/gist_id}","starred_url":"https://api.github.com/users/hornc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hornc/subscriptions","organizations_url":"https://api.github.com/users/hornc/orgs","repos_url":"https://api.github.com/users/hornc/repos","events_url":"https://api.github.com/users/hornc/events{/privacy}","received_events_url":"https://api.github.com/users/hornc/received_events","type":"User","site_admin":false},"body":"I noticed a few while doing this, and noticed at least one you squished when I rebased. Agree that it would be a great separate task to tidy up UI and CSS!","created_at":"2018-03-13T23:21:13Z","updated_at":"2018-03-13T23:21:13Z","html_url":"https://github.com/internetarchive/openlibrary/pull/801#discussion_r174314708","pull_request_url":"https://api.github.com/repos/internetarchive/openlibrary/pulls/801","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/internetarchive/openlibrary/pulls/comments/174314708"},"html":{"href":"https://github.com/internetarchive/openlibrary/pull/801#discussion_r174314708"},"pull_request":{"href":"https://api.github.com/repos/internetarchive/openlibrary/pulls/801"}},"in_reply_to_id":174313486},"pull_request":{"url":"https://api.github.com/repos/internetarchive/openlibrary/pulls/801","id":169353334,"html_url":"https://github.com/internetarchive/openlibrary/pull/801","diff_url":"https://github.com/internetarchive/openlibrary/pull/801.diff","patch_url":"https://github.com/internetarchive/openlibrary/pull/801.patch","issue_url":"https://api.github.com/repos/internetarchive/openlibrary/issues/801","number":801,"state":"open","locked":false,"title":"WIP: I18n update","user":{"login":"hornc","id":905545,"avatar_url":"https://avatars0.githubusercontent.com/u/905545?v=4","gravatar_id":"","url":"https://api.github.com/users/hornc","html_url":"https://github.com/hornc","followers_url":"https://api.github.com/users/hornc/followers","following_url":"https://api.github.com/users/hornc/following{/other_user}","gists_url":"https://api.github.com/users/hornc/gists{/gist_id}","starred_url":"https://api.github.com/users/hornc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hornc/subscriptions","organizations_url":"https://api.github.com/users/hornc/orgs","repos_url":"https://api.github.com/users/hornc/repos","events_url":"https://api.github.com/users/hornc/events{/privacy}","received_events_url":"https://api.github.com/users/hornc/received_events","type":"User","site_admin":false},"body":"* Update Babel from 0.9.6 to 2.5.3\r\n* Fixes to enable scripts/i18n-messages to perform extract/compile/update tasks again\r\n* Begin tidying up duplicate and unnecessary strings\r\n* Regenerate messages.pot\r\n* Move Czech translation to correct path\r\n    once deployed view at https://openlibrary.org/?lang=cs\r\n* Update cs/messages.po with latest strings\r\n\r\n**TODO:**\r\n\r\n- [x] Reduce size of .pot by removing deprecated pages' strings from translations.\r\n\r\n### OL i18n\r\nThe most recent attempt at internationalisation appears to be the python Babel method, documented here: https://github.com/internetarchive/openlibrary/blob/master/openlibrary/i18n/__init__.py  which encloses messages to be translated in python templates with: `$_()` (shortcut to: `gettext()`)\r\n\r\nThere is another method from Infogami which has many `strings.xx` files located https://github.com/internetarchive/openlibrary/tree/master/openlibrary/plugins/openlibrary/i18n\r\n\r\nThese are used in templates with:\r\n```\r\n$ _t = i18n.get_namespace('/')\r\n$_t.change_language\r\n```\r\nSEARCH: https://github.com/internetarchive/openlibrary/search?utf8=%E2%9C%93&q=i18n.get_namespace&type=\r\n\r\nWhere the namespace is some sub dir of https://github.com/internetarchive/openlibrary/tree/master/openlibrary/plugins/openlibrary/i18n , and `change_language` in the example above is the key for the translated message. Both forms are triggered by URL params `?lang=xx`  where `xx` is the 2 char language code. \r\n\r\nSee https://openlibrary.org/i18n for the list (and the previous note on i18n status from 2010!)\r\nThe Babel method seems a lot more managable, but I have not dug into the older method too far. I believe there are some valid translations in the older data, and it is possible they are still used somewhere. We should transition to one unified method though.\r\n\r\nThe `gettext` method uses:\r\n`from openlibrary.i18n import gettext`\r\nor\r\n`from openlibrary.i18n import gettext as _` (see https://github.com/internetarchive/openlibrary/blob/ad4ab0b61755d010775692facaf5bff989648473/openlibrary/core/helpers.py )\r\n\r\nOther things I found while looking at this area: \r\nA template for choosing language: https://github.com/internetarchive/openlibrary/blob/master/openlibrary/macros/change_language.html  (older Infogami method)\r\n\r\nand potential duplicate (or unused) functionality within https://github.com/internetarchive/openlibrary/tree/master/openlibrary/macros and https://github.com/internetarchive/openlibrary/tree/master/openlibrary/templates\r\n\r\n### Next steps\r\n* Clean up messaging; Check that main pages and user-flows are covered by good msg labels for translation. Proper use of `$_()` in templates.\r\n\r\nIn this current PR I have gone for maximal inclusion of templates (and am probably still missing some from odd locations), but this includes the Admin interface templates, other under-the-hood pages, and templates of presumably deprecated functionality (Edit Libraries?). I wonder if it will be more effective to only include specific templates by name in \r\n`i18n.extract_messages([\"openlibrary/plugins/upstream\", \"openlibrary/plugins/search/templates\", \"openlibrary/macros\", \"openlibrary/templates\"])`  (from https://github.com/internetarchive/openlibrary/blob/master/scripts/i18n-messages#L23) rather than entire directories which appear to be dumping grounds for legacy views?  It has been good to get a full list of all the message strings, but at 3000+ lines in `messages.pot` it is clear that there is junk in there too. I'd like to tidy it further before merging. It'd be nice to have some help! :)","created_at":"2018-02-15T12:03:42Z","updated_at":"2018-03-13T23:21:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5ae50ea6a7df95a2c705f657a7c8064cf40c9a2","assignee":{"login":"hornc","id":905545,"avatar_url":"https://avatars0.githubusercontent.com/u/905545?v=4","gravatar_id":"","url":"https://api.github.com/users/hornc","html_url":"https://github.com/hornc","followers_url":"https://api.github.com/users/hornc/followers","following_url":"https://api.github.com/users/hornc/following{/other_user}","gists_url":"https://api.github.com/users/hornc/gists{/gist_id}","starred_url":"https://api.github.com/users/hornc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hornc/subscriptions","organizations_url":"https://api.github.com/users/hornc/orgs","repos_url":"https://api.github.com/users/hornc/repos","events_url":"https://api.github.com/users/hornc/events{/privacy}","received_events_url":"https://api.github.com/users/hornc/received_events","type":"User","site_admin":false},"assignees":[{"login":"hornc","id":905545,"avatar_url":"https://avatars0.githubusercontent.com/u/905545?v=4","gravatar_id":"","url":"https://api.github.com/users/hornc","html_url":"https://github.com/hornc","followers_url":"https://api.github.com/users/hornc/followers","following_url":"https://api.github.com/users/hornc/following{/other_user}","gists_url":"https://api.github.com/users/hornc/gists{/gist_id}","starred_url":"https://api.github.com/users/hornc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hornc/subscriptions","organizations_url":"https://api.github.com/users/hornc/orgs","repos_url":"https://api.github.com/users/hornc/repos","events_url":"https://api.github.com/users/hornc/events{/privacy}","received_events_url":"https://api.github.com/users/hornc/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/internetarchive/openlibrary/pulls/801/commits","review_comments_url":"https://api.github.com/repos/internetarchive/openlibrary/pulls/801/comments","review_comment_url":"https://api.github.com/repos/internetarchive/openlibrary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/internetarchive/openlibrary/issues/801/comments","statuses_url":"https://api.github.com/repos/internetarchive/openlibrary/statuses/f5d6f6b795b2209e048da0904fc643df45bdacef","head":{"label":"hornc:i18n-update","ref":"i18n-update","sha":"f5d6f6b795b2209e048da0904fc643df45bdacef","user":{"login":"hornc","id":905545,"avatar_url":"https://avatars0.githubusercontent.com/u/905545?v=4","gravatar_id":"","url":"https://api.github.com/users/hornc","html_url":"https://github.com/hornc","followers_url":"https://api.github.com/users/hornc/followers","following_url":"https://api.github.com/users/hornc/following{/other_user}","gists_url":"https://api.github.com/users/hornc/gists{/gist_id}","starred_url":"https://api.github.com/users/hornc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hornc/subscriptions","organizations_url":"https://api.github.com/users/hornc/orgs","repos_url":"https://api.github.com/users/hornc/repos","events_url":"https://api.github.com/users/hornc/events{/privacy}","received_events_url":"https://api.github.com/users/hornc/received_events","type":"User","site_admin":false},"repo":{"id":24747134,"name":"openlibrary-1","full_name":"hornc/openlibrary-1","owner":{"login":"hornc","id":905545,"avatar_url":"https://avatars0.githubusercontent.com/u/905545?v=4","gravatar_id":"","url":"https://api.github.com/users/hornc","html_url":"https://github.com/hornc","followers_url":"https://api.github.com/users/hornc/followers","following_url":"https://api.github.com/users/hornc/following{/other_user}","gists_url":"https://api.github.com/users/hornc/gists{/gist_id}","starred_url":"https://api.github.com/users/hornc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hornc/subscriptions","organizations_url":"https://api.github.com/users/hornc/orgs","repos_url":"https://api.github.com/users/hornc/repos","events_url":"https://api.github.com/users/hornc/events{/privacy}","received_events_url":"https://api.github.com/users/hornc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hornc/openlibrary-1","description":"One webpage for every book ever published!","fork":true,"url":"https://api.github.com/repos/hornc/openlibrary-1","forks_url":"https://api.github.com/repos/hornc/openlibrary-1/forks","keys_url":"https://api.github.com/repos/hornc/openlibrary-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hornc/openlibrary-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hornc/openlibrary-1/teams","hooks_url":"https://api.github.com/repos/hornc/openlibrary-1/hooks","issue_events_url":"https://api.github.com/repos/hornc/openlibrary-1/issues/events{/number}","events_url":"https://api.github.com/repos/hornc/openlibrary-1/events","assignees_url":"https://api.github.com/repos/hornc/openlibrary-1/assignees{/user}","branches_url":"https://api.github.com/repos/hornc/openlibrary-1/branches{/branch}","tags_url":"https://api.github.com/repos/hornc/openlibrary-1/tags","blobs_url":"https://api.github.com/repos/hornc/openlibrary-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hornc/openlibrary-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hornc/openlibrary-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/hornc/openlibrary-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hornc/openlibrary-1/statuses/{sha}","languages_url":"https://api.github.com/repos/hornc/openlibrary-1/languages","stargazers_url":"https://api.github.com/repos/hornc/openlibrary-1/stargazers","contributors_url":"https://api.github.com/repos/hornc/openlibrary-1/contributors","subscribers_url":"https://api.github.com/repos/hornc/openlibrary-1/subscribers","subscription_url":"https://api.github.com/repos/hornc/openlibrary-1/subscription","commits_url":"https://api.github.com/repos/hornc/openlibrary-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/hornc/openlibrary-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/hornc/openlibrary-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/hornc/openlibrary-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/hornc/openlibrary-1/contents/{+path}","compare_url":"https://api.github.com/repos/hornc/openlibrary-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hornc/openlibrary-1/merges","archive_url":"https://api.github.com/repos/hornc/openlibrary-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hornc/openlibrary-1/downloads","issues_url":"https://api.github.com/repos/hornc/openlibrary-1/issues{/number}","pulls_url":"https://api.github.com/repos/hornc/openlibrary-1/pulls{/number}","milestones_url":"https://api.github.com/repos/hornc/openlibrary-1/milestones{/number}","notifications_url":"https://api.github.com/repos/hornc/openlibrary-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hornc/openlibrary-1/labels{/name}","releases_url":"https://api.github.com/repos/hornc/openlibrary-1/releases{/id}","deployments_url":"https://api.github.com/repos/hornc/openlibrary-1/deployments","created_at":"2014-10-03T04:49:32Z","updated_at":"2017-04-07T09:33:30Z","pushed_at":"2018-03-13T23:11:54Z","git_url":"git://github.com/hornc/openlibrary-1.git","ssh_url":"git@github.com:hornc/openlibrary-1.git","clone_url":"https://github.com/hornc/openlibrary-1.git","svn_url":"https://github.com/hornc/openlibrary-1","homepage":"https://openlibrary.org","size":41830,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"internetarchive:master","ref":"master","sha":"03392ad6dc7dccc9c54afa331738ef67ab9af705","user":{"login":"internetarchive","id":130493,"avatar_url":"https://avatars3.githubusercontent.com/u/130493?v=4","gravatar_id":"","url":"https://api.github.com/users/internetarchive","html_url":"https://github.com/internetarchive","followers_url":"https://api.github.com/users/internetarchive/followers","following_url":"https://api.github.com/users/internetarchive/following{/other_user}","gists_url":"https://api.github.com/users/internetarchive/gists{/gist_id}","starred_url":"https://api.github.com/users/internetarchive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/internetarchive/subscriptions","organizations_url":"https://api.github.com/users/internetarchive/orgs","repos_url":"https://api.github.com/users/internetarchive/repos","events_url":"https://api.github.com/users/internetarchive/events{/privacy}","received_events_url":"https://api.github.com/users/internetarchive/received_events","type":"Organization","site_admin":false},"repo":{"id":69609,"name":"openlibrary","full_name":"internetarchive/openlibrary","owner":{"login":"internetarchive","id":130493,"avatar_url":"https://avatars3.githubusercontent.com/u/130493?v=4","gravatar_id":"","url":"https://api.github.com/users/internetarchive","html_url":"https://github.com/internetarchive","followers_url":"https://api.github.com/users/internetarchive/followers","following_url":"https://api.github.com/users/internetarchive/following{/other_user}","gists_url":"https://api.github.com/users/internetarchive/gists{/gist_id}","starred_url":"https://api.github.com/users/internetarchive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/internetarchive/subscriptions","organizations_url":"https://api.github.com/users/internetarchive/orgs","repos_url":"https://api.github.com/users/internetarchive/repos","events_url":"https://api.github.com/users/internetarchive/events{/privacy}","received_events_url":"https://api.github.com/users/internetarchive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/internetarchive/openlibrary","description":"One webpage for every book ever published!","fork":false,"url":"https://api.github.com/repos/internetarchive/openlibrary","forks_url":"https://api.github.com/repos/internetarchive/openlibrary/forks","keys_url":"https://api.github.com/repos/internetarchive/openlibrary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/internetarchive/openlibrary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/internetarchive/openlibrary/teams","hooks_url":"https://api.github.com/repos/internetarchive/openlibrary/hooks","issue_events_url":"https://api.github.com/repos/internetarchive/openlibrary/issues/events{/number}","events_url":"https://api.github.com/repos/internetarchive/openlibrary/events","assignees_url":"https://api.github.com/repos/internetarchive/openlibrary/assignees{/user}","branches_url":"https://api.github.com/repos/internetarchive/openlibrary/branches{/branch}","tags_url":"https://api.github.com/repos/internetarchive/openlibrary/tags","blobs_url":"https://api.github.com/repos/internetarchive/openlibrary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/internetarchive/openlibrary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/internetarchive/openlibrary/git/refs{/sha}","trees_url":"https://api.github.com/repos/internetarchive/openlibrary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/internetarchive/openlibrary/statuses/{sha}","languages_url":"https://api.github.com/repos/internetarchive/openlibrary/languages","stargazers_url":"https://api.github.com/repos/internetarchive/openlibrary/stargazers","contributors_url":"https://api.github.com/repos/internetarchive/openlibrary/contributors","subscribers_url":"https://api.github.com/repos/internetarchive/openlibrary/subscribers","subscription_url":"https://api.github.com/repos/internetarchive/openlibrary/subscription","commits_url":"https://api.github.com/repos/internetarchive/openlibrary/commits{/sha}","git_commits_url":"https://api.github.com/repos/internetarchive/openlibrary/git/commits{/sha}","comments_url":"https://api.github.com/repos/internetarchive/openlibrary/comments{/number}","issue_comment_url":"https://api.github.com/repos/internetarchive/openlibrary/issues/comments{/number}","contents_url":"https://api.github.com/repos/internetarchive/openlibrary/contents/{+path}","compare_url":"https://api.github.com/repos/internetarchive/openlibrary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/internetarchive/openlibrary/merges","archive_url":"https://api.github.com/repos/internetarchive/openlibrary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/internetarchive/openlibrary/downloads","issues_url":"https://api.github.com/repos/internetarchive/openlibrary/issues{/number}","pulls_url":"https://api.github.com/repos/internetarchive/openlibrary/pulls{/number}","milestones_url":"https://api.github.com/repos/internetarchive/openlibrary/milestones{/number}","notifications_url":"https://api.github.com/repos/internetarchive/openlibrary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/internetarchive/openlibrary/labels{/name}","releases_url":"https://api.github.com/repos/internetarchive/openlibrary/releases{/id}","deployments_url":"https://api.github.com/repos/internetarchive/openlibrary/deployments","created_at":"2008-10-30T05:20:14Z","updated_at":"2018-03-13T21:12:53Z","pushed_at":"2018-03-13T23:11:56Z","git_url":"git://github.com/internetarchive/openlibrary.git","ssh_url":"git@github.com:internetarchive/openlibrary.git","clone_url":"https://github.com/internetarchive/openlibrary.git","svn_url":"https://github.com/internetarchive/openlibrary","homepage":"https://openlibrary.org","size":44147,"stargazers_count":347,"watchers_count":347,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":133,"mirror_url":null,"archived":false,"open_issues_count":285,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":133,"open_issues":285,"watchers":347,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/internetarchive/openlibrary/pulls/801"},"html":{"href":"https://github.com/internetarchive/openlibrary/pull/801"},"issue":{"href":"https://api.github.com/repos/internetarchive/openlibrary/issues/801"},"comments":{"href":"https://api.github.com/repos/internetarchive/openlibrary/issues/801/comments"},"review_comments":{"href":"https://api.github.com/repos/internetarchive/openlibrary/pulls/801/comments"},"review_comment":{"href":"https://api.github.com/repos/internetarchive/openlibrary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/internetarchive/openlibrary/pulls/801/commits"},"statuses":{"href":"https://api.github.com/repos/internetarchive/openlibrary/statuses/f5d6f6b795b2209e048da0904fc643df45bdacef"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"hornc"}}