|
@@ -241,7 +241,7 @@ To allow all of the page trees to be served at the same domain, we need
|
|
|
to add a URL prefix for each language.
|
|
|
|
|
|
To implement this, we can use Django's built-in
|
|
|
-[i18n_patterns](https://docs.djangoproject.com/en/stable/topics/i18n/translation/#language-prefix-in-url-patterns)
|
|
|
+{func}`~django.conf.urls.i18n.i18n_patterns`
|
|
|
function, which adds a language prefix to all of the URL patterns passed into it.
|
|
|
This activates the language code specified in the URL and Wagtail takes this into
|
|
|
account when it decides how to route the request.
|
|
@@ -412,7 +412,7 @@ the name of the locale in its own language. We also add `rel` and `hreflang` att
|
|
|
`translation.locale` is an instance of the [Locale model](locale_model_ref).
|
|
|
|
|
|
Alternatively, a built-in tag from Django that gets info about the language of the translation.
|
|
|
-For more information, see [get_language_info in the Django docs](https://docs.djangoproject.com/en/stable/topics/i18n/translation/#get-language-info).
|
|
|
+For more information, see [`{% get_language_info %}` in the Django docs](inv:django:std:templatetag#get_language_info).
|
|
|
|
|
|
```html+django
|
|
|
{% load i18n %}
|
|
@@ -427,7 +427,7 @@ languages and finds the page for each one. This works better than the [Basic exa
|
|
|
above on sites that have extra Django `LANGUAGES` that share the same Wagtail content.
|
|
|
|
|
|
For this example to work, you firstly need to add Django's
|
|
|
-[django.template.context_processors.i18n](https://docs.djangoproject.com/en/stable/ref/templates/api/#django-template-context-processors-i18n)
|
|
|
+[`django.template.context_processors.i18n`](django.template.context_processors.i18n)
|
|
|
context processor to your `TEMPLATES` setting:
|
|
|
|
|
|
```python
|
|
@@ -699,7 +699,7 @@ If there is no language selected by the user, the `LANGUAGE_CODE` will be used.
|
|
|
|
|
|
The default language of Wagtail is `en-us` (American English). You can change this by tweaking a couple of Django settings:
|
|
|
|
|
|
-- Make sure [USE_I18N](https://docs.djangoproject.com/en/stable/ref/settings/#use-i18n) is set to `True`
|
|
|
-- Set [LANGUAGE_CODE](https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-LANGUAGE_CODE) to your websites' primary language
|
|
|
+- Make sure [`USE_I18N`](inv:django#USE_I18N) is set to `True`
|
|
|
+- Set [`LANGUAGE_CODE`](inv:django#LANGUAGE_CODE) to your websites' primary language
|
|
|
|
|
|
If there is a translation available for your language, the Wagtail admin backend should now be in the language you've chosen.
|