Skip to content

Name the wordings that appear three times - #190

Merged
JE-Chen merged 1 commit into
mainfrom
fix/sonar-duplicate-literals
Jul 26, 2026
Merged

Name the wordings that appear three times#190
JE-Chen merged 1 commit into
mainfrom
fix/sonar-duplicate-literals

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

The eight findings left on main after #189, split by whether they were real.

Five were real

Four in settings_menu.py (Start with the system, Load plugins (advanced), Export settings..., Import settings...) and one in base_scene_page.py (Not Ready). Each appears three times — at construction, at registration, and again in a warning box or when a file is re-chosen. Three copies of a sentence is three chances for them to drift apart, so each is now a module constant.

Three were not

Velocità, Скорость and Удалить in the language dictionaries. A translation table is exactly where the same word recurs under different keys: Italian Velocità is both video speed and pet speed; Russian Удалить is "remove" across several dialogs. Hoisting them into constants would make the tables harder to read and harder to hand to a translator — the one thing those files exist for.

So S1192 is switched off for frontengine/utils/multi_language/ in a new .sonarcloud.properties, with the reasoning written next to it rather than left as a silent exclusion. Per-issue WONTFIX would need redoing every time a translator repeats a word.

Checks

Language switching still verified across all seven languages in both directions: 0 strings left in the previous language, whiteboard still open, page state byte-identical. 858 passed, pyflakes silent.

… repeat

Four strings in the settings menu and one on the scene pages each appear three
times - at construction, at registration, and in a warning box or a re-chooser.
Three copies of the same sentence is three chances for them to drift, so each
is now a constant.

The other three were in the language dictionaries, where a repeated word is the
normal state of affairs: Italian "Velocita" is both video speed and pet speed,
Russian "Udalit" is "remove" in several dialogs. Hoisting those into constants
would make the tables harder to read and harder to hand to a translator, which
is the one thing they exist for, so S1192 is switched off for that directory
with the reason written down next to it.
@sonarqubecloud

Copy link
Copy Markdown

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 37 complexity · 0 duplication

Metric Results
Complexity 37
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen
JE-Chen merged commit d2e6e8f into main Jul 26, 2026
5 checks passed
@JE-Chen
JE-Chen deleted the fix/sonar-duplicate-literals branch July 26, 2026 13:52
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.

1 participant