{"action":"created","comment":{"url":"https://api.github.com/repos/torchbox/wagtail/pulls/comments/37739724","id":37739724,"diff_hunk":"@@ -0,0 +1,211 @@\n+====================\n+Internationalisation\n+====================\n+\n+This document describes the internationalisation features of Wagtail and how to create multi-lingual sites.\n+\n+Wagtail uses Django's `Internationalisation framework <https://docs.djangoproject.com/en/1.8/topics/i18n/>`_ so most of the steps are the same as other Django projects.\n+\n+\n+.. contents::\n+\n+\n+Wagtail admin translations\n+==========================\n+\n+The Wagtail admin backend has been translated into many different languages. You can find a list of currently available translations on Wagtail's `Transifex page <https://www.transifex.com/torchbox/wagtail/>`_. (Note: if you're using an old version of Wagtail, this page may not accurately reflect what languages you have available).\n+\n+If your language isn't listed on that page, you can easily contribute new languages or correct mistakes. Sign up and submit changes to `Transifex <https://www.transifex.com/torchbox/wagtail/>`_. Translation updates are typically merged into an official release within one month of being submitted.\n+\n+\n+Changing the primary language of your Wagtail installation\n+==========================================================\n+\n+The default language of Wagtail is ``en-us`` (American English). You can change this by tweaking a couple of Django settings:\n+\n+ - Make sure `USE_I18N <https://docs.djangoproject.com/en/1.8/ref/settings/#use-i18n>`_ is set to ``True``\n+ - Set `LANGUAGE_CODE <https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-LANGUAGE_CODE>`_ to your websites' primary language\n+\n+If there is a translation available for your language, the Wagtail admin backend should now be in the language you've chosen.\n+\n+\n+Creating sites with multiple languages\n+======================================\n+\n+You can create sites with multiple language support by levaraging Django's `translation features <https://docs.djangoproject.com/en/1.8/topics/i18n/translation/>`_.\n+\n+This section of the documentation will show you how to use Django's translation features with Wagtail and also describe a couple of methods for storing/retrieving translated content using Wagtail pages.\n+\n+\n+Enabling multiple language support\n+----------------------------------\n+\n+Firstly, make sure the `USE_I18N <https://docs.djangoproject.com/en/1.8/ref/settings/#use-i18n>`_ Django setting is set to ``True``.\n+\n+To enable multi-language support, add ``django.middleware.locale.LocaleMiddleware`` to your ``MIDDLEWARE_CLASSES``:\n+\n+.. code-block:: python\n+\n+    MIDDLEWARE_CLASSES = (\n+        ...\n+\n+        'django.middleware.locale.LocaleMiddleware',\n+    )\n+\n+This middleware class looks at the user's browser language and sets the `language of the site accordingly <https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#how-django-discovers-language-preference>`_.\n+\n+\n+Serving different languages from different URLs\n+-----------------------------------------------\n+\n+Just enabling the multi-language support in Django sometimes may not be enough. By default, Django will serve different languages of the same page with the same URL. This has a couple of drawbacks:\n+\n+ - Users cannot change language without changing their browser settings\n+ - It may not work well with various caching setups (as content varies based on browser settings)\n+\n+Django's ``i18n_patterns`` feature, when enabled, prefixes the URLs with the language code (eg ``/en/about-us``). Users are forwarded to their preferred version, based on browser language, when they first visit the site.\n+\n+This feature is enabled through the projects root URL configuration. Just put the views you would like to have this enabled for in an ``i18n_patterns`` list and append that to the other url patterns:","path":"docs/advanced_topics/i18n/index.rst","position":68,"original_position":68,"commit_id":"d8c58f10f159d390f80bb7b3bb70a91c96ed4bc8","original_commit_id":"d8c58f10f159d390f80bb7b3bb70a91c96ed4bc8","user":{"login":"tomdyson","id":15543,"avatar_url":"https://avatars.githubusercontent.com/u/15543?v=3","gravatar_id":"","url":"https://api.github.com/users/tomdyson","html_url":"https://github.com/tomdyson","followers_url":"https://api.github.com/users/tomdyson/followers","following_url":"https://api.github.com/users/tomdyson/following{/other_user}","gists_url":"https://api.github.com/users/tomdyson/gists{/gist_id}","starred_url":"https://api.github.com/users/tomdyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomdyson/subscriptions","organizations_url":"https://api.github.com/users/tomdyson/orgs","repos_url":"https://api.github.com/users/tomdyson/repos","events_url":"https://api.github.com/users/tomdyson/events{/privacy}","received_events_url":"https://api.github.com/users/tomdyson/received_events","type":"User","site_admin":false},"body":"projects -> project's","created_at":"2015-08-24T10:57:01Z","updated_at":"2015-08-24T10:57:01Z","html_url":"https://github.com/torchbox/wagtail/pull/1630#discussion_r37739724","pull_request_url":"https://api.github.com/repos/torchbox/wagtail/pulls/1630","_links":{"self":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/comments/37739724"},"html":{"href":"https://github.com/torchbox/wagtail/pull/1630#discussion_r37739724"},"pull_request":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/1630"}}},"pull_request":{"url":"https://api.github.com/repos/torchbox/wagtail/pulls/1630","id":43022812,"html_url":"https://github.com/torchbox/wagtail/pull/1630","diff_url":"https://github.com/torchbox/wagtail/pull/1630.diff","patch_url":"https://github.com/torchbox/wagtail/pull/1630.patch","issue_url":"https://api.github.com/repos/torchbox/wagtail/issues/1630","number":1630,"state":"open","locked":false,"title":"Improvements to internationalisation docs","user":{"login":"kaedroho","id":1093808,"avatar_url":"https://avatars.githubusercontent.com/u/1093808?v=3","gravatar_id":"","url":"https://api.github.com/users/kaedroho","html_url":"https://github.com/kaedroho","followers_url":"https://api.github.com/users/kaedroho/followers","following_url":"https://api.github.com/users/kaedroho/following{/other_user}","gists_url":"https://api.github.com/users/kaedroho/gists{/gist_id}","starred_url":"https://api.github.com/users/kaedroho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaedroho/subscriptions","organizations_url":"https://api.github.com/users/kaedroho/orgs","repos_url":"https://api.github.com/users/kaedroho/repos","events_url":"https://api.github.com/users/kaedroho/events{/privacy}","received_events_url":"https://api.github.com/users/kaedroho/received_events","type":"User","site_admin":false},"body":"Fixes #612 \r\nRefs: #96\r\n\r\nThis pull request adds documentation for a better method of creating a multi lingual site with Wagtail","created_at":"2015-08-21T10:11:03Z","updated_at":"2015-08-24T10:57:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad45d7c58729f4f329ff1ea434e77832c60e117a","assignee":null,"milestone":{"url":"https://api.github.com/repos/torchbox/wagtail/milestones/9","html_url":"https://github.com/torchbox/wagtail/milestones/1.1","labels_url":"https://api.github.com/repos/torchbox/wagtail/milestones/9/labels","id":861608,"number":9,"title":"1.1","description":"","creator":{"login":"davecranwell","id":352835,"avatar_url":"https://avatars.githubusercontent.com/u/352835?v=3","gravatar_id":"","url":"https://api.github.com/users/davecranwell","html_url":"https://github.com/davecranwell","followers_url":"https://api.github.com/users/davecranwell/followers","following_url":"https://api.github.com/users/davecranwell/following{/other_user}","gists_url":"https://api.github.com/users/davecranwell/gists{/gist_id}","starred_url":"https://api.github.com/users/davecranwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davecranwell/subscriptions","organizations_url":"https://api.github.com/users/davecranwell/orgs","repos_url":"https://api.github.com/users/davecranwell/repos","events_url":"https://api.github.com/users/davecranwell/events{/privacy}","received_events_url":"https://api.github.com/users/davecranwell/received_events","type":"User","site_admin":false},"open_issues":112,"closed_issues":59,"state":"open","created_at":"2014-11-11T11:56:09Z","updated_at":"2015-08-24T09:03:33Z","due_on":"2015-08-30T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/torchbox/wagtail/pulls/1630/commits","review_comments_url":"https://api.github.com/repos/torchbox/wagtail/pulls/1630/comments","review_comment_url":"https://api.github.com/repos/torchbox/wagtail/pulls/comments{/number}","comments_url":"https://api.github.com/repos/torchbox/wagtail/issues/1630/comments","statuses_url":"https://api.github.com/repos/torchbox/wagtail/statuses/d8c58f10f159d390f80bb7b3bb70a91c96ed4bc8","head":{"label":"kaedroho:multilingual-docs","ref":"multilingual-docs","sha":"d8c58f10f159d390f80bb7b3bb70a91c96ed4bc8","user":{"login":"kaedroho","id":1093808,"avatar_url":"https://avatars.githubusercontent.com/u/1093808?v=3","gravatar_id":"","url":"https://api.github.com/users/kaedroho","html_url":"https://github.com/kaedroho","followers_url":"https://api.github.com/users/kaedroho/followers","following_url":"https://api.github.com/users/kaedroho/following{/other_user}","gists_url":"https://api.github.com/users/kaedroho/gists{/gist_id}","starred_url":"https://api.github.com/users/kaedroho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaedroho/subscriptions","organizations_url":"https://api.github.com/users/kaedroho/orgs","repos_url":"https://api.github.com/users/kaedroho/repos","events_url":"https://api.github.com/users/kaedroho/events{/privacy}","received_events_url":"https://api.github.com/users/kaedroho/received_events","type":"User","site_admin":false},"repo":{"id":16483819,"name":"wagtail","full_name":"kaedroho/wagtail","owner":{"login":"kaedroho","id":1093808,"avatar_url":"https://avatars.githubusercontent.com/u/1093808?v=3","gravatar_id":"","url":"https://api.github.com/users/kaedroho","html_url":"https://github.com/kaedroho","followers_url":"https://api.github.com/users/kaedroho/followers","following_url":"https://api.github.com/users/kaedroho/following{/other_user}","gists_url":"https://api.github.com/users/kaedroho/gists{/gist_id}","starred_url":"https://api.github.com/users/kaedroho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaedroho/subscriptions","organizations_url":"https://api.github.com/users/kaedroho/orgs","repos_url":"https://api.github.com/users/kaedroho/repos","events_url":"https://api.github.com/users/kaedroho/events{/privacy}","received_events_url":"https://api.github.com/users/kaedroho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kaedroho/wagtail","description":"Django-based content management system","fork":true,"url":"https://api.github.com/repos/kaedroho/wagtail","forks_url":"https://api.github.com/repos/kaedroho/wagtail/forks","keys_url":"https://api.github.com/repos/kaedroho/wagtail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaedroho/wagtail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaedroho/wagtail/teams","hooks_url":"https://api.github.com/repos/kaedroho/wagtail/hooks","issue_events_url":"https://api.github.com/repos/kaedroho/wagtail/issues/events{/number}","events_url":"https://api.github.com/repos/kaedroho/wagtail/events","assignees_url":"https://api.github.com/repos/kaedroho/wagtail/assignees{/user}","branches_url":"https://api.github.com/repos/kaedroho/wagtail/branches{/branch}","tags_url":"https://api.github.com/repos/kaedroho/wagtail/tags","blobs_url":"https://api.github.com/repos/kaedroho/wagtail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaedroho/wagtail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaedroho/wagtail/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaedroho/wagtail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaedroho/wagtail/statuses/{sha}","languages_url":"https://api.github.com/repos/kaedroho/wagtail/languages","stargazers_url":"https://api.github.com/repos/kaedroho/wagtail/stargazers","contributors_url":"https://api.github.com/repos/kaedroho/wagtail/contributors","subscribers_url":"https://api.github.com/repos/kaedroho/wagtail/subscribers","subscription_url":"https://api.github.com/repos/kaedroho/wagtail/subscription","commits_url":"https://api.github.com/repos/kaedroho/wagtail/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaedroho/wagtail/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaedroho/wagtail/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaedroho/wagtail/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaedroho/wagtail/contents/{+path}","compare_url":"https://api.github.com/repos/kaedroho/wagtail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaedroho/wagtail/merges","archive_url":"https://api.github.com/repos/kaedroho/wagtail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaedroho/wagtail/downloads","issues_url":"https://api.github.com/repos/kaedroho/wagtail/issues{/number}","pulls_url":"https://api.github.com/repos/kaedroho/wagtail/pulls{/number}","milestones_url":"https://api.github.com/repos/kaedroho/wagtail/milestones{/number}","notifications_url":"https://api.github.com/repos/kaedroho/wagtail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaedroho/wagtail/labels{/name}","releases_url":"https://api.github.com/repos/kaedroho/wagtail/releases{/id}","created_at":"2014-02-03T15:46:45Z","updated_at":"2015-05-07T09:34:19Z","pushed_at":"2015-08-24T09:14:00Z","git_url":"git://github.com/kaedroho/wagtail.git","ssh_url":"git@github.com:kaedroho/wagtail.git","clone_url":"https://github.com/kaedroho/wagtail.git","svn_url":"https://github.com/kaedroho/wagtail","homepage":null,"size":25534,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"torchbox:master","ref":"master","sha":"102f8db2380bad9d493e5df783055200b66be8ee","user":{"login":"torchbox","id":84015,"avatar_url":"https://avatars.githubusercontent.com/u/84015?v=3","gravatar_id":"","url":"https://api.github.com/users/torchbox","html_url":"https://github.com/torchbox","followers_url":"https://api.github.com/users/torchbox/followers","following_url":"https://api.github.com/users/torchbox/following{/other_user}","gists_url":"https://api.github.com/users/torchbox/gists{/gist_id}","starred_url":"https://api.github.com/users/torchbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torchbox/subscriptions","organizations_url":"https://api.github.com/users/torchbox/orgs","repos_url":"https://api.github.com/users/torchbox/repos","events_url":"https://api.github.com/users/torchbox/events{/privacy}","received_events_url":"https://api.github.com/users/torchbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16479108,"name":"wagtail","full_name":"torchbox/wagtail","owner":{"login":"torchbox","id":84015,"avatar_url":"https://avatars.githubusercontent.com/u/84015?v=3","gravatar_id":"","url":"https://api.github.com/users/torchbox","html_url":"https://github.com/torchbox","followers_url":"https://api.github.com/users/torchbox/followers","following_url":"https://api.github.com/users/torchbox/following{/other_user}","gists_url":"https://api.github.com/users/torchbox/gists{/gist_id}","starred_url":"https://api.github.com/users/torchbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torchbox/subscriptions","organizations_url":"https://api.github.com/users/torchbox/orgs","repos_url":"https://api.github.com/users/torchbox/repos","events_url":"https://api.github.com/users/torchbox/events{/privacy}","received_events_url":"https://api.github.com/users/torchbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/torchbox/wagtail","description":"A Django content management system focused on flexibility and user experience","fork":false,"url":"https://api.github.com/repos/torchbox/wagtail","forks_url":"https://api.github.com/repos/torchbox/wagtail/forks","keys_url":"https://api.github.com/repos/torchbox/wagtail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torchbox/wagtail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torchbox/wagtail/teams","hooks_url":"https://api.github.com/repos/torchbox/wagtail/hooks","issue_events_url":"https://api.github.com/repos/torchbox/wagtail/issues/events{/number}","events_url":"https://api.github.com/repos/torchbox/wagtail/events","assignees_url":"https://api.github.com/repos/torchbox/wagtail/assignees{/user}","branches_url":"https://api.github.com/repos/torchbox/wagtail/branches{/branch}","tags_url":"https://api.github.com/repos/torchbox/wagtail/tags","blobs_url":"https://api.github.com/repos/torchbox/wagtail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torchbox/wagtail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torchbox/wagtail/git/refs{/sha}","trees_url":"https://api.github.com/repos/torchbox/wagtail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torchbox/wagtail/statuses/{sha}","languages_url":"https://api.github.com/repos/torchbox/wagtail/languages","stargazers_url":"https://api.github.com/repos/torchbox/wagtail/stargazers","contributors_url":"https://api.github.com/repos/torchbox/wagtail/contributors","subscribers_url":"https://api.github.com/repos/torchbox/wagtail/subscribers","subscription_url":"https://api.github.com/repos/torchbox/wagtail/subscription","commits_url":"https://api.github.com/repos/torchbox/wagtail/commits{/sha}","git_commits_url":"https://api.github.com/repos/torchbox/wagtail/git/commits{/sha}","comments_url":"https://api.github.com/repos/torchbox/wagtail/comments{/number}","issue_comment_url":"https://api.github.com/repos/torchbox/wagtail/issues/comments{/number}","contents_url":"https://api.github.com/repos/torchbox/wagtail/contents/{+path}","compare_url":"https://api.github.com/repos/torchbox/wagtail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torchbox/wagtail/merges","archive_url":"https://api.github.com/repos/torchbox/wagtail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torchbox/wagtail/downloads","issues_url":"https://api.github.com/repos/torchbox/wagtail/issues{/number}","pulls_url":"https://api.github.com/repos/torchbox/wagtail/pulls{/number}","milestones_url":"https://api.github.com/repos/torchbox/wagtail/milestones{/number}","notifications_url":"https://api.github.com/repos/torchbox/wagtail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torchbox/wagtail/labels{/name}","releases_url":"https://api.github.com/repos/torchbox/wagtail/releases{/id}","created_at":"2014-02-03T12:41:59Z","updated_at":"2015-08-23T21:04:05Z","pushed_at":"2015-08-24T09:14:15Z","git_url":"git://github.com/torchbox/wagtail.git","ssh_url":"git@github.com:torchbox/wagtail.git","clone_url":"https://github.com/torchbox/wagtail.git","svn_url":"https://github.com/torchbox/wagtail","homepage":"wagtail.io","size":36765,"stargazers_count":2834,"watchers_count":2834,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":421,"mirror_url":null,"open_issues_count":342,"forks":421,"open_issues":342,"watchers":2834,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/1630"},"html":{"href":"https://github.com/torchbox/wagtail/pull/1630"},"issue":{"href":"https://api.github.com/repos/torchbox/wagtail/issues/1630"},"comments":{"href":"https://api.github.com/repos/torchbox/wagtail/issues/1630/comments"},"review_comments":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/1630/comments"},"review_comment":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/1630/commits"},"statuses":{"href":"https://api.github.com/repos/torchbox/wagtail/statuses/d8c58f10f159d390f80bb7b3bb70a91c96ed4bc8"}}}}