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

feat: adjust localization #32

merged 2 commits into from
Oct 11, 2024

Conversation

niccofyren
Copy link
Member

@niccofyren niccofyren commented Oct 11, 2024

Backend part of: gathering/tgno-frontend#57

Default site locale during setup was english so we both need to change default to Norwegian and change locale on existing content. We use wagtail.locales both to avoid having to write migrations for each locale config change, and since it seems to handle default locale change gracefully.

Once release we need to (before frontend can be released)

  1. Login as admin and go to new locales section
  2. There should be a warning on "English" locale since we disable it (both to avoid current use, but also since it helps migration)
  3. On "English" locale resolve warning by selecting "migrate to Norwegian" equivalent option
  4. Validate that existing articles now have no locale via https://www.tg.no/api/v2/news/?fields=locale

@niccofyren niccofyren requested a review from a team as a code owner October 11, 2024 16:11
@niccofyren niccofyren requested a review from mfyll October 11, 2024 16:11
@@ -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

Comment on lines +159 to +160
("no", "Norwegian"),
# ('en', "English"),
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

@niccofyren niccofyren merged commit 8d083ae into main Oct 11, 2024
8 checks passed
@niccofyren niccofyren deleted the feat/no-locale branch October 11, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants