Skip to content

Translations: Replace line numbers with occurrence count in source TS - #34618

Open
shoogle wants to merge 2 commits into
musescore:mainfrom
shoogle:ts-line-counts
Open

Translations: Replace line numbers with occurrence count in source TS#34618
shoogle wants to merge 2 commits into
musescore:mainfrom
shoogle:ts-line-counts

Conversation

@shoogle

@shoogle shoogle commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Makes PRs like this one easier to review:

That PR added 9 strings but they are buried in the diff, which mostly shows unimportant changes to line numbers.

By removing line numbers from TS files (or replacing them with an occurrence count, which rarely changes), future translation PRs will have a smaller diff that only includes relevant information.


Here's what the current PR actually does to the *_en.ts files.

Extract from share/locale/instruments_en.ts

image

Filenames are now relative to the repository root. Each string occurs once so the line number is now always 1.


Extract from share/locale/musescore_en.ts

image

Filenames are now relative to the repository root. "Undo" & "Redo" each appear 4 times in notationuiactions.cpp so their line number is now 4 for that file, and 1 for other files where the strings only appear once.


It's only necessary to update the *_en.ts files. After these are uploaded to Transifex, the changes will propagate to TS files in other languages.

None of these changes impact Qt tools. While lupdate does read our modified TS file, it only does so to:

  1. Determine the order in which strings should appear in the updated TS file.
  2. Preserve any obsolete strings that were in the old TS file but are no longer in the C++ source code.

Crucially, lupdate replaces all location data in the old TS file with fresh location data extracted from the C++ source code (or no location in the case of obsolete strings), so our modified locations are never used.


Alternative solution:

@shoogle
shoogle marked this pull request as ready for review August 18, 2026 04:57
@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@shoogle
shoogle marked this pull request as draft August 18, 2026 14:51
@shoogle
shoogle marked this pull request as ready for review August 19, 2026 02:25
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Comment thread tools/translations/process_source_ts_files.py Outdated
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

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