Skip to content

Conversation

@YoussfeCantCode
Copy link
Contributor

Description:

Moves pause-related translation keys from their own object into heads_up_message to keep all heads-up message text in one place.

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

Please put your Discord username so you can be contacted if a bug or regression is found:

furo18

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 27, 2025

Walkthrough

This PR reorganizes localization keys by moving pause-related messages from a standalone "pause" object into the "heads_up_message" namespace in the language file. The HeadsUpMessage TypeScript component is updated to reference the new key paths accordingly.

Changes

Cohort / File(s) Summary
Localization structure
resources/lang/en.json
Removed top-level "pause" object; moved singleplayer_game_paused and multiplayer_game_paused keys into heads_up_message namespace. Key values unchanged.
Component key references
src/client/graphics/layers/HeadsUpMessage.ts
Updated localization key references from pause.* to heads_up_message.* paths for singleplayer and multiplayer pause messages.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

Translation

Suggested reviewers

  • evanpelle
  • scottanderson

Poem

🎮 Messages find their home at last,
Beneath the heads-up banner cast,
No pause, no split—now unified,
The namespace keeps its structure wide. ✨

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: moving pause-related keys under the heads_up_message namespace to organize translation keys, which is the core change across the modified files.
Description check ✅ Passed The description directly relates to the changeset, explaining that pause-related translation keys are moved into heads_up_message to keep all heads-up message text in one place, matching the actual changes made.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9d9a32 and 1dd21e1.

📒 Files selected for processing (2)
  • resources/lang/en.json
  • src/client/graphics/layers/HeadsUpMessage.ts
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: andrewNiziolek
Repo: openfrontio/OpenFrontIO PR: 1007
File: resources/lang/de.json:115-115
Timestamp: 2025-06-02T14:27:37.609Z
Learning: For OpenFrontIO project: When localization keys are renamed in language JSON files, the maintainers separate technical changes from translation content updates. They wait for community translators to update the actual translation values rather than attempting to translate in the same PR. This allows technical changes to proceed while ensuring accurate translations from native speakers.
Learnt from: TheGiraffe3
Repo: openfrontio/OpenFrontIO PR: 884
File: resources/lang/en.json:456-461
Timestamp: 2025-08-16T10:52:08.292Z
Learning: In OpenFrontIO, translation files in resources/lang/*.json (except en.json) should not be updated in regular PRs. Only dedicated translation PRs titled "mls" and made by Aotumori should update non-English locale files. Regular PRs should only update en.json when adding or modifying translation keys.
Learnt from: scottanderson
Repo: openfrontio/OpenFrontIO PR: 949
File: resources/lang/en.json:8-10
Timestamp: 2025-05-30T03:53:52.231Z
Learning: For the OpenFrontIO project, do not suggest updating translation files in resources/lang/*.json except for en.json. The project has a dedicated translation team that handles all other locale files.
Learnt from: its-sii
Repo: openfrontio/OpenFrontIO PR: 1089
File: src/client/graphics/layers/ControlPanel.ts:160-183
Timestamp: 2025-06-07T20:01:52.720Z
Learning: The user its-sii prefers simpler, more readable code over complex type-safe approaches when the benefits don't justify the added complexity. They value maintainability and clarity in code implementation.
📚 Learning: 2025-06-02T14:27:37.609Z
Learnt from: andrewNiziolek
Repo: openfrontio/OpenFrontIO PR: 1007
File: resources/lang/de.json:115-115
Timestamp: 2025-06-02T14:27:37.609Z
Learning: For OpenFrontIO project: When localization keys are renamed in language JSON files, the maintainers separate technical changes from translation content updates. They wait for community translators to update the actual translation values rather than attempting to translate in the same PR. This allows technical changes to proceed while ensuring accurate translations from native speakers.

Applied to files:

  • src/client/graphics/layers/HeadsUpMessage.ts
  • resources/lang/en.json
🔇 Additional comments (2)
resources/lang/en.json (1)

744-749: Excellent refactoring for better key organization.

The restructuring successfully colocates all heads-up message text under a single namespace. This improves maintainability by grouping related translation keys together. The change follows the project's pattern where only en.json is updated in regular PRs.

Based on learnings, other translation files will be updated separately by the dedicated translation team.

src/client/graphics/layers/HeadsUpMessage.ts (1)

42-44: Translation keys correctly use consistent heads_up_message namespace.

Lines 42 and 44 match lines 48-49, organizing all heads-up messages together in en.json. All four keys (singleplayer_game_paused, multiplayer_game_paused, random_spawn, choose_spawn) exist in the translation file with appropriate values.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator

@evanpelle evanpelle left a comment

Choose a reason for hiding this comment

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

thanks!

@evanpelle evanpelle added this to the v29 milestone Dec 27, 2025
@evanpelle evanpelle merged commit 7339c96 into openfrontio:main Dec 27, 2025
9 of 10 checks passed
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