Skip to content

Use plural forms in counted backend messages - #2582

Open
LukeSekai wants to merge 2 commits into
wger-project:masterfrom
LukeSekai:fix/plural-count-messages
Open

LukeSekai wants to merge 2 commits into
wger-project:masterfrom
LukeSekai:fix/plural-count-messages

Conversation

@LukeSekai

@LukeSekai LukeSekai commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

Counted messages currently produce wording such as 1 days, 1 hours, and 1 weeks, and do not expose separate plural forms to translators.

Use Django's existing plural support for refresh-token expiry, email-confirmation link expiry, inactive-member reminders, and the maximum workout-session duration error. Preserve the numeric placeholders, settings, and validation behavior. Add regression coverage and a changelog entry; leave translated catalogues to Weblate.

Related Issue(s)

Related to #2571 and the requested Django/Flutter string audit. This covers the Django strings only; the React/Weblate migration and target-language review remain separate.

This is the Django part of the same cross-repository issue. Companion PRs: Flutter #1408 for source/fallback counts and React #1343 for source placeholders and Weblate migration documentation. The three PRs can be reviewed and merged independently; the hosted migration and translation review remain pending.

Validation

All four new regression methods fail against the original production strings and pass with the fix, covering singular and plural counts through the real views, templates, and model validation.

python manage.py test wger.core.tests.test_plural_messages wger.core.tests.test_apikey wger.manager.tests.test_workout_session wger.gym.tests.test_inactive_members --settings=settings.ci --noinput
73 tests passed

Ruff check, format check, and git diff --check pass. The local environment uses Windows and Python 3.14.2. A static-files warning reports missing frontend node_modules in the isolated backend checkout.

makemigrations --check --dry-run --settings=settings.ci reports pre-existing drift in the exercises and gallery apps. The same drift was reproduced with the unchanged upstream model at dde740753e76dee89fcd5b20fbb02fd8513bfa04; this patch changes no model fields and adds no migrations.

CI follow-up: the initial Markdown run failed MD040 on an existing unlabelled fence at AGENTS.md:31. A one-line follow-up labels the directory tree as text. The original document fails markdownlint-cli 0.49.1 locally; the fixed AGENTS.md and CHANGELOG.md pass with Super-linter v9.0.0's Markdown configuration. No application code changed in this follow-up. The updated Markdown run, Ruff, CodeQL, and all three Python CI jobs now pass on commit f30c9d0f06b45a0216ce709771a26b6ecc292789.

Please check that the PR fulfills these requirements

  • Tests for the changes have been added.
  • Changed Python files pass Ruff formatting and lint checks.
  • A short changelog entry describes the visible fix.

AI assistance was used for investigation, implementation, and test preparation. The changes and regression results were reviewed locally.

Select locale-aware day, hour and week forms in expiry and reminder templates and the session duration error. Cover singular and plural values through real views, templates and model validation.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 00:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Mark the directory tree as text so the existing MD040 check passes. The original document fails the same linter locally and the labelled block passes.

This branch has not been deployed

No deployments
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.

2 participants