{"action":"closed","number":264,"pull_request":{"url":"https://api.github.com/repos/quokkaproject/quokka/pulls/264","id":40284643,"html_url":"https://github.com/quokkaproject/quokka/pull/264","diff_url":"https://github.com/quokkaproject/quokka/pull/264.diff","patch_url":"https://github.com/quokkaproject/quokka/pull/264.patch","issue_url":"https://api.github.com/repos/quokkaproject/quokka/issues/264","number":264,"state":"closed","locked":false,"title":"This PR should fix #261","user":{"login":"realli","id":3313107,"avatar_url":"https://avatars.githubusercontent.com/u/3313107?v=3","gravatar_id":"","url":"https://api.github.com/users/realli","html_url":"https://github.com/realli","followers_url":"https://api.github.com/users/realli/followers","following_url":"https://api.github.com/users/realli/following{/other_user}","gists_url":"https://api.github.com/users/realli/gists{/gist_id}","starred_url":"https://api.github.com/users/realli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realli/subscriptions","organizations_url":"https://api.github.com/users/realli/orgs","repos_url":"https://api.github.com/users/realli/repos","events_url":"https://api.github.com/users/realli/events{/privacy}","received_events_url":"https://api.github.com/users/realli/received_events","type":"User","site_admin":false},"body":"Change quokka scoped translations related function(`_, _l, _n`) to use the ones imported from `flask.ext.babelex`. That will use a default `Domain`. And `flask-admin` will still use its own `CustomDomain`.\r\nAlso added a zh_CN translation .po file.\r\n\r\nBy the way, in template files, you just use `_gettext`, and this function is introduced by `flask-admin`, which in turn will use `flask-admin`'s `Domain`. Code from `flask.ext.admin.base`:\r\n\r\n    def render(self, template, **kwargs)\r\n        .....\r\n        .....\r\n        kwargs['_gettext'] = babel.gettext\r\n        kwargs['_ngettext'] = babel.ngettext\r\n        kwargs['h'] = h\r\n\r\n        # Contribute extra arguments\r\n        kwargs.update(self._template_args)\r\n\r\n        return render_template(template, **kwargs)\r\n\r\nAnd I think it's OK to use `gettext` function, which is set by `flask.ext.babelex` when `babel.init_app()` is invoked. You may still want to use `_gettext` if you want to use the `flask-adimn`'s `Domain`.\r\n\r\nAnd to make `admin.register(Post, PostAdmin, category=_l('Content'), name=_l(\"Post\"))` work, the object `_l` returned (a `_LazyString`), should implements its `__hash__` method (`flask-admin` will use it as a key in dict). I created PR to mitsuhiko/speaklater, but haven't got respond, so I just change the requirement.txt to use my repo temporarily.\r\n\r\nIt's my pleasure to contribute to an open-source project! :laughing: ","created_at":"2015-07-18T01:55:39Z","updated_at":"2015-07-18T02:56:28Z","closed_at":"2015-07-18T02:56:28Z","merged_at":"2015-07-18T02:56:28Z","merge_commit_sha":"2af426af39ada5782f1ccc9c5521e9ea9f4e30c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/quokkaproject/quokka/pulls/264/commits","review_comments_url":"https://api.github.com/repos/quokkaproject/quokka/pulls/264/comments","review_comment_url":"https://api.github.com/repos/quokkaproject/quokka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quokkaproject/quokka/issues/264/comments","statuses_url":"https://api.github.com/repos/quokkaproject/quokka/statuses/203e057bcd65ff3b2787e18d1d52eb573f9e9253","head":{"label":"realli:development","ref":"development","sha":"203e057bcd65ff3b2787e18d1d52eb573f9e9253","user":{"login":"realli","id":3313107,"avatar_url":"https://avatars.githubusercontent.com/u/3313107?v=3","gravatar_id":"","url":"https://api.github.com/users/realli","html_url":"https://github.com/realli","followers_url":"https://api.github.com/users/realli/followers","following_url":"https://api.github.com/users/realli/following{/other_user}","gists_url":"https://api.github.com/users/realli/gists{/gist_id}","starred_url":"https://api.github.com/users/realli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realli/subscriptions","organizations_url":"https://api.github.com/users/realli/orgs","repos_url":"https://api.github.com/users/realli/repos","events_url":"https://api.github.com/users/realli/events{/privacy}","received_events_url":"https://api.github.com/users/realli/received_events","type":"User","site_admin":false},"repo":{"id":39244554,"name":"quokka","full_name":"realli/quokka","owner":{"login":"realli","id":3313107,"avatar_url":"https://avatars.githubusercontent.com/u/3313107?v=3","gravatar_id":"","url":"https://api.github.com/users/realli","html_url":"https://github.com/realli","followers_url":"https://api.github.com/users/realli/followers","following_url":"https://api.github.com/users/realli/following{/other_user}","gists_url":"https://api.github.com/users/realli/gists{/gist_id}","starred_url":"https://api.github.com/users/realli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realli/subscriptions","organizations_url":"https://api.github.com/users/realli/orgs","repos_url":"https://api.github.com/users/realli/repos","events_url":"https://api.github.com/users/realli/events{/privacy}","received_events_url":"https://api.github.com/users/realli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/realli/quokka","description":"Flask powered CMS on top of mongoengine/MongoDB (WIP)","fork":true,"url":"https://api.github.com/repos/realli/quokka","forks_url":"https://api.github.com/repos/realli/quokka/forks","keys_url":"https://api.github.com/repos/realli/quokka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realli/quokka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realli/quokka/teams","hooks_url":"https://api.github.com/repos/realli/quokka/hooks","issue_events_url":"https://api.github.com/repos/realli/quokka/issues/events{/number}","events_url":"https://api.github.com/repos/realli/quokka/events","assignees_url":"https://api.github.com/repos/realli/quokka/assignees{/user}","branches_url":"https://api.github.com/repos/realli/quokka/branches{/branch}","tags_url":"https://api.github.com/repos/realli/quokka/tags","blobs_url":"https://api.github.com/repos/realli/quokka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realli/quokka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realli/quokka/git/refs{/sha}","trees_url":"https://api.github.com/repos/realli/quokka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realli/quokka/statuses/{sha}","languages_url":"https://api.github.com/repos/realli/quokka/languages","stargazers_url":"https://api.github.com/repos/realli/quokka/stargazers","contributors_url":"https://api.github.com/repos/realli/quokka/contributors","subscribers_url":"https://api.github.com/repos/realli/quokka/subscribers","subscription_url":"https://api.github.com/repos/realli/quokka/subscription","commits_url":"https://api.github.com/repos/realli/quokka/commits{/sha}","git_commits_url":"https://api.github.com/repos/realli/quokka/git/commits{/sha}","comments_url":"https://api.github.com/repos/realli/quokka/comments{/number}","issue_comment_url":"https://api.github.com/repos/realli/quokka/issues/comments{/number}","contents_url":"https://api.github.com/repos/realli/quokka/contents/{+path}","compare_url":"https://api.github.com/repos/realli/quokka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realli/quokka/merges","archive_url":"https://api.github.com/repos/realli/quokka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realli/quokka/downloads","issues_url":"https://api.github.com/repos/realli/quokka/issues{/number}","pulls_url":"https://api.github.com/repos/realli/quokka/pulls{/number}","milestones_url":"https://api.github.com/repos/realli/quokka/milestones{/number}","notifications_url":"https://api.github.com/repos/realli/quokka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realli/quokka/labels{/name}","releases_url":"https://api.github.com/repos/realli/quokka/releases{/id}","created_at":"2015-07-17T08:51:17Z","updated_at":"2015-07-17T08:51:18Z","pushed_at":"2015-07-18T02:42:42Z","git_url":"git://github.com/realli/quokka.git","ssh_url":"git@github.com:realli/quokka.git","clone_url":"https://github.com/realli/quokka.git","svn_url":"https://github.com/realli/quokka","homepage":"http://www.quokkaproject.org","size":4643,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"quokkaproject:development","ref":"development","sha":"ab391e35a05fc74daa0212506b87396cd5b65972","user":{"login":"quokkaproject","id":10763349,"avatar_url":"https://avatars.githubusercontent.com/u/10763349?v=3","gravatar_id":"","url":"https://api.github.com/users/quokkaproject","html_url":"https://github.com/quokkaproject","followers_url":"https://api.github.com/users/quokkaproject/followers","following_url":"https://api.github.com/users/quokkaproject/following{/other_user}","gists_url":"https://api.github.com/users/quokkaproject/gists{/gist_id}","starred_url":"https://api.github.com/users/quokkaproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quokkaproject/subscriptions","organizations_url":"https://api.github.com/users/quokkaproject/orgs","repos_url":"https://api.github.com/users/quokkaproject/repos","events_url":"https://api.github.com/users/quokkaproject/events{/privacy}","received_events_url":"https://api.github.com/users/quokkaproject/received_events","type":"Organization","site_admin":false},"repo":{"id":11226488,"name":"quokka","full_name":"quokkaproject/quokka","owner":{"login":"quokkaproject","id":10763349,"avatar_url":"https://avatars.githubusercontent.com/u/10763349?v=3","gravatar_id":"","url":"https://api.github.com/users/quokkaproject","html_url":"https://github.com/quokkaproject","followers_url":"https://api.github.com/users/quokkaproject/followers","following_url":"https://api.github.com/users/quokkaproject/following{/other_user}","gists_url":"https://api.github.com/users/quokkaproject/gists{/gist_id}","starred_url":"https://api.github.com/users/quokkaproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quokkaproject/subscriptions","organizations_url":"https://api.github.com/users/quokkaproject/orgs","repos_url":"https://api.github.com/users/quokkaproject/repos","events_url":"https://api.github.com/users/quokkaproject/events{/privacy}","received_events_url":"https://api.github.com/users/quokkaproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quokkaproject/quokka","description":"Flask powered CMS on top of mongoengine/MongoDB (WIP)","fork":false,"url":"https://api.github.com/repos/quokkaproject/quokka","forks_url":"https://api.github.com/repos/quokkaproject/quokka/forks","keys_url":"https://api.github.com/repos/quokkaproject/quokka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quokkaproject/quokka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quokkaproject/quokka/teams","hooks_url":"https://api.github.com/repos/quokkaproject/quokka/hooks","issue_events_url":"https://api.github.com/repos/quokkaproject/quokka/issues/events{/number}","events_url":"https://api.github.com/repos/quokkaproject/quokka/events","assignees_url":"https://api.github.com/repos/quokkaproject/quokka/assignees{/user}","branches_url":"https://api.github.com/repos/quokkaproject/quokka/branches{/branch}","tags_url":"https://api.github.com/repos/quokkaproject/quokka/tags","blobs_url":"https://api.github.com/repos/quokkaproject/quokka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quokkaproject/quokka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quokkaproject/quokka/git/refs{/sha}","trees_url":"https://api.github.com/repos/quokkaproject/quokka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quokkaproject/quokka/statuses/{sha}","languages_url":"https://api.github.com/repos/quokkaproject/quokka/languages","stargazers_url":"https://api.github.com/repos/quokkaproject/quokka/stargazers","contributors_url":"https://api.github.com/repos/quokkaproject/quokka/contributors","subscribers_url":"https://api.github.com/repos/quokkaproject/quokka/subscribers","subscription_url":"https://api.github.com/repos/quokkaproject/quokka/subscription","commits_url":"https://api.github.com/repos/quokkaproject/quokka/commits{/sha}","git_commits_url":"https://api.github.com/repos/quokkaproject/quokka/git/commits{/sha}","comments_url":"https://api.github.com/repos/quokkaproject/quokka/comments{/number}","issue_comment_url":"https://api.github.com/repos/quokkaproject/quokka/issues/comments{/number}","contents_url":"https://api.github.com/repos/quokkaproject/quokka/contents/{+path}","compare_url":"https://api.github.com/repos/quokkaproject/quokka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quokkaproject/quokka/merges","archive_url":"https://api.github.com/repos/quokkaproject/quokka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quokkaproject/quokka/downloads","issues_url":"https://api.github.com/repos/quokkaproject/quokka/issues{/number}","pulls_url":"https://api.github.com/repos/quokkaproject/quokka/pulls{/number}","milestones_url":"https://api.github.com/repos/quokkaproject/quokka/milestones{/number}","notifications_url":"https://api.github.com/repos/quokkaproject/quokka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quokkaproject/quokka/labels{/name}","releases_url":"https://api.github.com/repos/quokkaproject/quokka/releases{/id}","created_at":"2013-07-07T00:42:27Z","updated_at":"2015-07-18T02:29:53Z","pushed_at":"2015-07-18T02:56:28Z","git_url":"git://github.com/quokkaproject/quokka.git","ssh_url":"git@github.com:quokkaproject/quokka.git","clone_url":"https://github.com/quokkaproject/quokka.git","svn_url":"https://github.com/quokkaproject/quokka","homepage":"http://www.quokkaproject.org","size":4643,"stargazers_count":1010,"watchers_count":1010,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":203,"mirror_url":null,"open_issues_count":71,"forks":203,"open_issues":71,"watchers":1010,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/quokkaproject/quokka/pulls/264"},"html":{"href":"https://github.com/quokkaproject/quokka/pull/264"},"issue":{"href":"https://api.github.com/repos/quokkaproject/quokka/issues/264"},"comments":{"href":"https://api.github.com/repos/quokkaproject/quokka/issues/264/comments"},"review_comments":{"href":"https://api.github.com/repos/quokkaproject/quokka/pulls/264/comments"},"review_comment":{"href":"https://api.github.com/repos/quokkaproject/quokka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quokkaproject/quokka/pulls/264/commits"},"statuses":{"href":"https://api.github.com/repos/quokkaproject/quokka/statuses/203e057bcd65ff3b2787e18d1d52eb573f9e9253"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"rochacbruno","id":458654,"avatar_url":"https://avatars.githubusercontent.com/u/458654?v=3","gravatar_id":"","url":"https://api.github.com/users/rochacbruno","html_url":"https://github.com/rochacbruno","followers_url":"https://api.github.com/users/rochacbruno/followers","following_url":"https://api.github.com/users/rochacbruno/following{/other_user}","gists_url":"https://api.github.com/users/rochacbruno/gists{/gist_id}","starred_url":"https://api.github.com/users/rochacbruno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rochacbruno/subscriptions","organizations_url":"https://api.github.com/users/rochacbruno/orgs","repos_url":"https://api.github.com/users/rochacbruno/repos","events_url":"https://api.github.com/users/rochacbruno/events{/privacy}","received_events_url":"https://api.github.com/users/rochacbruno/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":4,"additions":324,"deletions":31,"changed_files":8}}