Skip to content

fix(translate): corrected string ordering#19620

Merged
nijel merged 1 commit into
WeblateOrg:mainfrom
nijel:component-order
May 16, 2026
Merged

fix(translate): corrected string ordering#19620
nijel merged 1 commit into
WeblateOrg:mainfrom
nijel:component-order

Conversation

@nijel
Copy link
Copy Markdown
Member

@nijel nijel commented May 16, 2026

The project and category language views defaulted to wrong ordering and didn't show a component switch reliably.

Fixes #19613

@nijel nijel added this to the 2026.6 milestone May 16, 2026
@nijel nijel self-assigned this May 16, 2026
@nijel nijel enabled auto-merge (rebase) May 16, 2026 04:46
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: daa51d4a81

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/trans/views/edit.py Outdated
@nijel nijel force-pushed the component-order branch from daa51d4 to 5975ee7 Compare May 16, 2026 04:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5975ee77aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/trans/models/unit.py Outdated
@nijel nijel force-pushed the component-order branch from 5975ee7 to 020c933 Compare May 16, 2026 05:13
@nijel nijel disabled auto-merge May 16, 2026 05:16
@nijel nijel force-pushed the component-order branch from 020c933 to 79c2c5e Compare May 16, 2026 05:19
@nijel nijel requested a review from Copilot May 16, 2026 05:19
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79c2c5ec20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/utils/views.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes incorrect default string ordering for project/category language translation views and makes the “component switched” warning reliable across sequential navigation by persisting the last viewed unit in the session.

Changes:

  • Default sort for ProjectLanguage/CategoryLanguage scopes is now component-based (component priority grouping) rather than interleaving by unit position.
  • Component-switch warning logic is refactored and hardened against stale unit IDs, while also persisting last_viewed_unit_id back into the session.
  • Adds regression tests for ordering and component-switch warnings; documents the change in the changelog.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
weblate/utils/views.py Extends default sort selection to language-scope objects (ProjectLanguage/CategoryLanguage).
weblate/trans/views/edit.py Persists and validates last_viewed_unit_id to make component-switch warnings reliable.
weblate/trans/models/unit.py Applies component-grouped default ordering to language-scope unit queries and adds position as a stable tiebreaker.
weblate/trans/tests/test_models.py Adds coverage ensuring language-scope default ordering groups by component priority.
weblate/trans/tests/test_edit.py Adds coverage for component-switch warnings and default sort selection for language scopes.
docs/changes.rst Notes the behavior change in the 2026.6 changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread weblate/trans/tests/test_edit.py
Comment thread docs/changes.rst Outdated
@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 16, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 10 changed May 16, 2026, 9:38 AM

The project and category language views defaulted to wrong ordering and
didn't show a component switch reliably.

Fixes WeblateOrg#19613
@nijel nijel force-pushed the component-order branch from 518e00f to 20e80c0 Compare May 16, 2026 08:46
@nijel nijel enabled auto-merge (rebase) May 16, 2026 08:46
@nijel nijel merged commit 84b4d0c into WeblateOrg:main May 16, 2026
28 of 30 checks passed
@nijel nijel deleted the component-order branch May 16, 2026 09:54
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.

Strings from different components are ordered interleaved

2 participants