django-distill
django-distill copied to clipboard
Generate pages for all languages
Currently django-distill only generates the pages for the language that is set in settings.LANGUAGE_CODE. It would be great if django-distill could generate pages for URLs that are in i18n_patterns for each language in settings.LANGUAGES.
That is, having this settings file:
LANGUAGES = [
('en-us', 'English (United States)'),
('en-gb', 'English (United Kingdom)'),
]
LANGUAGE_CODE = 'en-us'
and this urls.py file:
from django.conf.urls.i18n import i18n_patterns
from django.utils.translation import gettext_lazy as _
from django_distill import distill_path
urlpatterns = [
*i18n_patterns(distill_path(route=_('localization/'), view=..., name='localization')),
]
We should get the following files:
output/en-us/localization/index.html
output/en-gb/localisation/index.html
Note that the appropriate links already work with runserver, we would only need to identify internationalized pages and generate them somehow.