Skip to content

Turn off Django localization#3412

Merged
lunkwill42 merged 1 commit intomasterfrom
bugfix/timestamp-l10n
Aug 4, 2025
Merged

Turn off Django localization#3412
lunkwill42 merged 1 commit intomasterfrom
bugfix/timestamp-l10n

Conversation

@lunkwill42
Copy link
Copy Markdown
Member

@lunkwill42 lunkwill42 commented Jul 30, 2025

Scope and purpose

Fixes #3369

Django 4.2 changed the default of the internationalization setting USE_L10N from False to True. NAV prefers ISO timestamps in most of its UI, and since Django 4.2 was introduced in NAV 5.13, the way timestamps are printed, interpreted and sorted changed all over the UI.

This explicitly sets USE_L10N to False to restore NAV's original behavior.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.

  • Added a changelog fragment for towncrier
  • [ ] Added/amended tests for new/changed code
  • [ ] Added/changed documentation
  • Linted/formatted the code with black and ruff, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • This pull request is based on the correct upstream branch: For a patch/bugfix affecting the latest stable version, it should be based on that version's branch (<major>.<minor>.x). For a new feature or other additions, it should be based on master.
  • [ ] If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • [ ] If this results in changes in the UI: Added screenshots of the before and after
  • [ ] If this adds a new Python source code file: Added the boilerplate header to that file

Django 4.2 changed the default of the internationalization setting
USE_L10N from False to True.  NAV prefers ISO timestamps in most of its
UI, and since Django 4.2 was introduced in NAV 5.13, the way timestamps
are printed, interpreted and sorted changed all over the UI.

This explicitly sets USE_L10N to False to restore NAV's original
behavior.
@lunkwill42 lunkwill42 self-assigned this Jul 30, 2025
@sonarqubecloud
Copy link
Copy Markdown

@lunkwill42 lunkwill42 requested a review from a team July 30, 2025 06:25
@lunkwill42 lunkwill42 marked this pull request as ready for review July 30, 2025 06:25
@github-actions
Copy link
Copy Markdown

Test results

   12 files     12 suites   11m 48s ⏱️
2 206 tests 2 206 ✅ 0 💤 0 ❌
6 093 runs  6 093 ✅ 0 💤 0 ❌

Results for commit 7bbbcaa.

@lunkwill42 lunkwill42 merged commit 9af15f2 into master Aug 4, 2025
15 checks passed
@lunkwill42 lunkwill42 deleted the bugfix/timestamp-l10n branch August 4, 2025 07:47
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (37521e7) to head (7bbbcaa).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@      Coverage Diff       @@
##   master   #3412   +/-   ##
==============================
==============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Timestamps changed format in NAV 5.13

2 participants