Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adjust localization #32

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion tgno/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"wagtail.api.v2",
"rest_framework", # Provides a browser friendly UI for exploring the API
"wagtail",
"wagtail.locales",
"modelcluster",
"taggit",
"health_check",
Expand Down Expand Up @@ -140,7 +141,24 @@
# Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/

LANGUAGE_CODE = "en-us"
# Default language code used on content
LANGUAGE_CODE = "no"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes any new articles being created


# Frontend languages (not relevant for us, but needs to be filled in since it limits most of the other options)
LANGUAGES = [
("en", "English"),
("no", "Norwegian"),
]

# Languages permitted for admin GUI (Norwegian translation is flaky, so disabled)
WAGTAILADMIN_PERMITTED_LANGUAGES = [("en", "English")]

# Languages permitted for produced content
# TODO: Uncomment english when frontend experience is nice and ready
WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [
("no", "Norwegian"),
# ('en', "English"),
Comment on lines +159 to +160
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This triggers "locale migration option" on existing content and makes sure only Norwegian locale is available for now

]

TIME_ZONE = "UTC"

Expand Down