Skip to content

Conversation

Aotumuri
Copy link
Member

@Aotumuri Aotumuri commented Sep 7, 2025

Description:

mls for v26
Version identifier within MLS: v4.5

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:

Aotumuri

@Aotumuri Aotumuri requested review from a team as code owners September 7, 2025 08:40
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

coderabbitai bot commented Sep 7, 2025

Walkthrough

Adds and updates many translation keys across multiple locale JSON files, introduces two new locales (Hungarian hu and Portuguese pt-PT), removes/renames some keys (e.g., news.full_changelognews.see_all_releases), and registers the new locales in src/client/LangSelector.ts. No runtime behavior changes.

Changes

Cohort / File(s) Summary
Bulgarian locale updates
resources/lang/bg.json
New keys (radial_menu, maps, settings, events, contributor, host_badge), renamed news.full_changelognews.see_all_releases, removed control_panel.pop/control_panel.workers, and other value tweaks.
Danish locale updates
resources/lang/da.json
Added help entries, radial_menu, maps (marsrevised, yenisei, pluto), settings toggles, host_modal.host_badge, events_display.unit_voluntarily_deleted; removed help/control_panel keys; news rename.
Esperanto locale updates
resources/lang/eo.json
Added radial_menu, maps, settings toggles, host_badge, events_display entries, contributor keys; removed some legacy help/control keys; news rename.
Finnish locale updates
resources/lang/fi.json
Added radial_menu, maps, settings toggles, host_badge, player icon contributor, unit_voluntarily_deleted; removed control_panel keys; news rename and minor punctuation fixes.
French locale updates
resources/lang/fr.json
Added radial_menu, maps, settings toggles, host_badge, events, contributor keys; removed control_panel.pop/workers; news rename.
Galician locale updates
resources/lang/gl.json
Added radial_menu, maps, settings toggles, host_badge, events, contributor; wording fixes; removed control_panel keys; news rename.
Hungarian locale added
resources/lang/hu.json
New complete Hungarian translation file covering UI, modals, maps, events, settings, radial_menu, etc.
Japanese locale updates
resources/lang/ja.json
Added radial_menu, maps, settings toggles, host_badge, events, contributor; removed control_panel keys; news rename.
Portuguese (Portugal) locale added
resources/lang/pt-PT.json
New complete pt-PT translation file covering all UI modules including radial_menu.
Russian locale updates
resources/lang/ru.json
Added radial_menu, maps, settings toggles, host_badge, events, contributor; removed control_panel keys; news rename; minor text fixes.
Slovak locale updates
resources/lang/sk.json
Added radial_menu, maps, settings toggles, host_badge, events, contributor; removed control_panel keys; news rename; small value changes.
Slovenian locale updates
resources/lang/sl.json
Added radial_menu, maps, settings toggles, host_badge, events, contributor; removed control_panel keys; news rename; help rewording.
Ukrainian locale updates
resources/lang/uk.json
Added radial_menu, maps, settings toggles, host_badge, events, contributor; removed control_panel keys; news rename; multiple wording updates.
Chinese (Simplified) locale updates
resources/lang/zh-CN.json
Added radial_menu, maps, settings toggles, host_badge, events, contributor; removed control_panel keys; news rename; minor map label fixes.
Language registration
src/client/LangSelector.ts
Imported and registered hu and pt-PT locales in the language map so they are selectable and resolvable at runtime.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant App
  participant LangSelector
  participant LanguageMap

  User->>App: Open app / change language
  App->>LangSelector: getPreferredLocale()
  LangSelector->>LanguageMap: lookup(locale | fallback)
  Note over LanguageMap: LanguageMap now includes `hu` and `pt-PT`
  LanguageMap-->>LangSelector: translations bundle
  LangSelector-->>App: i18n bundle applied
  App-->>User: UI rendered with selected locale
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Translation - New

Suggested reviewers

  • scottanderson
  • evanpelle
  • Duwibi

Poem

New tongues arrive — hu and pt-PT land,
Radial menus whisper, maps expand,
Hosts wear badges, contributors shown,
Old keys retire, new keys are sown.
The UI hums in many a hand.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5769b5 and 6f2740d.

📒 Files selected for processing (1)
  • resources/lang/hu.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • resources/lang/hu.json

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.

@Aotumuri Aotumuri modified the milestones: v27, v26 Sep 7, 2025
@Aotumuri Aotumuri added the Translation Addition or modification of a language to the translations. label Sep 7, 2025
@Aotumuri Aotumuri self-assigned this Sep 7, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (8)
resources/lang/zh-CN.json (1)

319-319: Fix ground attack description (currently says “船只攻击”).

-    "ground_attack_desc": "向鼠标所指地块发送船只攻击。",
+    "ground_attack_desc": "向鼠标所指地块发送地面攻击。",
resources/lang/ja.json (4)

1-606: JP locale adds many keys; a few strings are clearly wrong or duplicated.


180-180: Wrong title for private lobby (shows “ランダム”).

-    "title": "ランダム",
+    "title": "プライベートロビーに参加",

101-101: Fix broken/merged sentences in build_port_desc.

-    "build_port_desc": "自国と他国の港の間で、自動的に貿易水辺にのみ建設でき、このアイコンから戦艦を建築することが可能です。自国と他国の港の間に、貿易制限がされていない場合に限り、自動的に交易船を送り出し、交易が完了すると両国に資金がもたらされます。貿易は手動で「貿易停止」または「貿易開始」に切り替えることができます。また、あなたが相手を攻撃したり、攻撃された場合には交易は自動的に停止し、5分経過するか同盟を結ぶと再開されます。",
+    "build_port_desc": "水辺にのみ建設できます。戦艦の建造が可能になります。自国と他国の港の間で(貿易停止でない場合に限り)自動的に交易船を送り出し、両者に資金が入ります。相手を攻撃したり攻撃された場合は貿易が自動停止します。5分後、または再び同盟になると再開します。貿易は「貿易停止」「貿易開始」で手動切替も可能です。",

318-319: Ground attack label/desc duplicated as “ボート攻撃”.

-    "ground_attack": "ボート攻撃",
-    "ground_attack_desc": "カーソルの位置に合わせた土地にボート攻撃を送ります。",
+    "ground_attack": "地上攻撃",
+    "ground_attack_desc": "カーソル位置のタイルに地上攻撃を送ります。",
resources/lang/uk.json (1)

78-79: Correct several Ukrainian grammar typos.

These are user-facing and should be clean.

-    "info_enemy_desc": "Містить таку інформацію ... стан торгувілі з вами, ...
+    "info_enemy_desc": "Містить таку інформацію ... стан торгівлі з вами, ...
-    "emojis_desc": "Увімкнення/вимкнення видимости емоджі під час гри",
+    "emojis_desc": "Увімкнення/вимкнення видимості емоджі під час гри",
-    "special_effects_desc": "Увімкнути/вимкнути спецефекти. Вимкніть для поліпшення продуктивности",
+    "special_effects_desc": "Увімкнути/вимкнути спецефекти. Вимкніть для поліпшення продуктивності",
-    "structure_sprites_enabled": "Спрайти споруд увімкнені",
-    "structure_sprites_disabled": "Спрайти споруд вимкнені",
+    "structure_sprites_enabled": "Спрайти споруд увімкнено",
+    "structure_sprites_disabled": "Спрайти споруд вимкнено",
-    "performance_overlay_label": "Оверлей продуктивности",
-    "performance_overlay_desc": "Увімкнення/вимкнення оверлея продуктивности. Якщо ввімкнено, буде показано оверлей продуктивности. Натисніть Shift+D під час гри, щоб увімкнути/вимкнути його.",
+    "performance_overlay_label": "Оверлей продуктивності",
+    "performance_overlay_desc": "Увімкнення/вимкнення оверлея продуктивності. Якщо ввімкнено, буде показано оверлей продуктивності. Натисніть Shift+D під час гри, щоб увімкнути/вимкнути його.",

Also applies to: 274-275, 279-284, 301-303

resources/lang/eo.json (2)

36-36: "Influo" → "Ago".

Better match for “action”.

-    "table_action": "Influo",
+    "table_action": "Ago",

395-396: Severe mistranslation: “Vi povas fini min” means “you can finish me”.

Use “fidi” (to trust).

-      "trust_me": "Vi povas fini min. Promeso!",
+      "trust_me": "Vi povas fidi min. Mi promesas!",
🧹 Nitpick comments (38)
resources/lang/hu.json (5)

282-284: Use correct “3D-s” form.

-    "structure_sprites_desc": "Kapcsoló az építmények 3Ds megjelenítéséhez",
+    "structure_sprites_desc": "Kapcsoló az építmények 3D-s megjelenítéséhez",

256-256: Unify missile silo terminology (spacing).

-    "missile_silo": "Rakéta siló",
+    "missile_silo": "Rakétasiló",

593-593: Correct typo in spawn ad loading text.

-    "loading": "Hírdetés betöltése..."
+    "loading": "Hirdetés betöltése..."

596-596: Grammar fix (“eléréséhez”).

-    "login_required": "Bejelentkezés szükséges a weboldal eléréshez.",
+    "login_required": "Bejelentkezés szükséges a weboldal eléréséhez.",

153-153: Optional: map label “Britannia” instead of “Anglia”.

“britannia” is typically rendered as “Britannia” in HU; “Anglia” is narrower (England only).

-    "britannia": "Anglia",
+    "britannia": "Britannia",
resources/lang/da.json (1)

19-19: Fix capitalization of the preposition “i”.

Use lowercase “i” in Danish.

-    "join_lobby": "Deltag I Lobby",
+    "join_lobby": "Deltag i lobby",
-    "title": "Deltag I Privat Lobby",
+    "title": "Deltag i privat lobby",
-    "join_lobby": "Deltag I Lobby",
+    "join_lobby": "Deltag i lobby",

Also applies to: 180-180, 184-184

resources/lang/sk.json (4)

1-606: Good coverage of new keys; suggest a few Slovak grammar fixes.


78-78: Typo: “Zdradca” → “Zradca”.

-    "info_enemy_desc": "Obsahuje informácie ... Zdradca sa ukazuje 30 sekúnd keď hráč zradil ...
+    "info_enemy_desc": "Obsahuje informácie ... Zradca sa ukazuje 30 sekúnd keď hráč zradil ...

311-314: Spelling: “Zvýšiť”.

-    "attack_ratio_up": "Zýšiť pomer útoku",
-    "attack_ratio_up_desc": "Zýšiť pomer útoku o 10%",
+    "attack_ratio_up": "Zvýšiť pomer útoku",
+    "attack_ratio_up_desc": "Zvýšiť pomer útoku o 10%",

484-484: Gender agreement for neuter “spojenectvo”.

-    "alliance_expired": "Tvoje spojenectvo s {name} vypršala",
+    "alliance_expired": "Tvoje spojenectvo s {name} vypršalo",
-    "alliance_renewed": "Tvoje spojenectvo s {name} bola obnovená",
+    "alliance_renewed": "Tvoje spojenectvo s {name} bolo obnovené",

Also applies to: 492-492

resources/lang/fr.json (6)

1-606: FR keys added correctly; suggest a few wording/typo fixes.


51-51: Localize “Show All”.

-    "ui_leaderboard_desc": "Montre les meilleurs joueurs du jeu ... Utiliser « Show All » montre tous les joueurs du jeu. Si vous ne voulez pas voir le classement, cliquez sur Masquer.",
+    "ui_leaderboard_desc": "Montre les meilleurs joueurs du jeu ... « Afficher tout » montre tous les joueurs du jeu. Si vous ne voulez pas voir le classement, cliquez sur « Masquer ».",

73-74: Keep imperative style consistent (“Ouvrir”).

-    "radial_attack": "Ouvrez le menu d'attaque.",
+    "radial_attack": "Ouvrir le menu d'attaque.",

302-302: Fix quote/apostrophe in performance overlay description.

-    "performance_overlay_desc": "Activer/désactiver la surcouche de performances. Lorsqu'elle est activée, la surcouche de performances sera affichée. Appuyez sur Maj+D pendant le jeu pour l\"activer.",
+    "performance_overlay_desc": "Activer/désactiver la surcouche de performances. Lorsqu'elle est activée, la surcouche sera affichée. Appuyez sur Maj+D pendant le jeu pour l'activer.",

101-101: Accent in “contrôler”.

-    "build_port_desc": "Peut seulement être construit ... Vous pouvez controller manuellement le commerce avec \"Arrêter le commerce\" ou \"Commencer le commerce\".",
+    "build_port_desc": "Peut seulement être construit ... Vous pouvez contrôler manuellement le commerce avec « Arrêter le commerce » ou « Commencer le commerce ».",

143-143: Use proper expansion for MENA.

-    "mena": "MOAN",
+    "mena": "Moyen-Orient et Afrique du Nord",
resources/lang/ru.json (6)

1-606: RU updates mostly good; propose clearer wording for “unit” and a few labels.


151-151: More natural “Марс (обновлённый)”.

-    "marsrevised": "Марс (Переделанный)",
+    "marsrevised": "Марс (обновлённый)",

587-588: “Contributor” is better as “Участник”.

-      "contributor": "Соучастник",
+      "contributor": "Участник",

494-494: Align “unit” wording in events.

-    "unit_voluntarily_deleted": "Объект добровольно удалён"
+    "unit_voluntarily_deleted": "Юнит добровольно удалён"

602-603: Use “юнит” instead of “объект” in radial menu.

-    "delete_unit_title": "Удалить объект",
-    "delete_unit_description": "Нажмите, чтобы удалить ближайший объект"
+    "delete_unit_title": "Удалить юнит",
+    "delete_unit_description": "Нажмите, чтобы удалить ближайший юнит"

153-153: Optional: differentiate “Gateway to the Atlantic”.

Currently duplicates “Гибралтарский пролив”; suggest a distinct label.

-    "gatewaytotheatlantic": "Гибралтарский пролив",
+    "gatewaytotheatlantic": "Ворота в Атлантику",
resources/lang/ja.json (2)

287-287: Grammar fix for anonymous_names_enabled.

-    "anonymous_names_enabled": "ユーザー名を匿名で表示されてます",
+    "anonymous_names_enabled": "匿名表示を有効化",

192-192: Clearer wording for “waiting”.

-    "waiting": "人が参加しています...",
+    "waiting": "待機中のプレイヤー",
resources/lang/fi.json (6)

1-606: FI locale largely OK; several small typos to fix.


75-75: Typo: “sihaintiin” → “sijaintiin”.

-    "radial_boat": "Lähetä vene (kuljetusalus) hyökkäämään valittuun sihaintiin. Saatavilla vain, jos sinulla on pääsy vesistöön.",
+    "radial_boat": "Lähetä vene (kuljetusalus) hyökkäämään valittuun sijaintiin. Saatavilla vain, jos sinulla on pääsy vesistöön.",

78-78: Typos in info_enemy_desc (“kaupankänti”).

-    "info_enemy_desc": "... Manually (Jos pelaaja on painanut \"Lopeta kaupankänti, kauppaa ei käydä kunnes molemmat painavat \"Aloita kaupankäynti\".) ...",
+    "info_enemy_desc": "... Manuaalisesti (jos pelaaja on painanut \"Lopeta kaupankäynti\", kauppaa ei käydä, kunnes molemmat painavat \"Aloita kaupankäynti\"). ...",

120-120: Typo: “kapuankäynnin” → “kaupankäynnin”.

-    "icon_embargo": "Yliviivattu dollari - kauppasaarto. Tämä pelaaja on lopettanut kapuankäynnin kanssasi automaattisesti tai manuaalisesti.",
+    "icon_embargo": "Yliviivattu dollari - kauppasaarto. Tämä pelaaja on lopettanut kaupankäynnin kanssasi automaattisesti tai manuaalisesti.",

411-411: Typo: “iittolaisia” → “liittolaisia”.

-      "no_allies": "Pelaajalla [P1] ei ole iittolaisia.",
+      "no_allies": "Pelaajalla [P1] ei ole liittolaisia.",

185-185: Wrong context (“sisäänkirjautumista”); should be checking the lobby.

-    "checking": "Tarkistetaan sisäänkirjautumista...",
+    "checking": "Tarkistetaan aula...",
resources/lang/bg.json (2)

291-295: Typo in left-click label (Bulgarian).

“Щтракване” → “Щракване”; also simplify wording.

-    "left_click_label": "Щтракване на ляв бутон, за да се отвори менюто",
+    "left_click_label": "Щракване с левия бутон за отваряне на менюто",

602-604: "Елемент" should be "Единица" (unit).

Use consistent game terminology.

-    "delete_unit_title": "Изтриване на елемент",
-    "delete_unit_description": "Кликни, за да изтриеш най-близкия елемент"
+    "delete_unit_title": "Изтриване на единица",
+    "delete_unit_description": "Кликни, за да изтриеш най-близката единица"
src/client/LangSelector.ts (2)

101-115: Normalize locale codes; prefer robust matching.

Handle hyphen/underscore and case; keep behavior stable.

-  private getClosestSupportedLang(lang: string): string {
-    if (!lang) return "en";
-    if (lang in this.languageMap) return lang;
-
-    const base = lang.slice(0, 2);
+  private getClosestSupportedLang(lang: string): string {
+    if (!lang) return "en";
+    // normalize: lower-case, underscores -> hyphens
+    const norm = lang.replace("_", "-").toLowerCase();
+    if (norm in this.languageMap) return norm;
+
+    const base = norm.slice(0, 2);
     const candidates = Object.keys(this.languageMap).filter((key) =>
-      key.startsWith(base),
+      key.toLowerCase().startsWith(base),
     );
     if (candidates.length > 0) {
       candidates.sort((a, b) => b.length - a.length); // More specific first
       return candidates[0];
     }
 
     return "en";
   }

136-175: Type the language list and improve browser-language suggestion.

Use a typed shape and match regionless browser language to first regional variant.

-  @state() private languageList: any[] = [];
+  type LanguageEntry = { code: string; native: string; en: string; svg: string };
+  @state() private languageList: LanguageEntry[] = [];
@@
-      let list: any[] = [];
+      let list: LanguageEntry[] = [];
@@
-      const browserLang = new Intl.Locale(navigator.language).language;
+      const browserLang = new Intl.Locale(navigator.language).language; // e.g., "pt"
@@
-      const browserLangEntry =
-        browserLang !== this.currentLang && browserLang !== "en"
-          ? list.find((l) => l.code === browserLang)
-          : undefined;
+      const browserLangEntry =
+        browserLang !== this.currentLang && browserLang !== "en"
+          ? (list.find((l) => l.code === browserLang) ||
+             list.find((l) => l.code.toLowerCase().startsWith(`${browserLang}-`)))
+          : undefined;
resources/lang/pt-PT.json (3)

203-204: Fix invalid chars description (square brackets).

-    "invalid_chars": "O nome de utilizador pode conter apenas letras, números, espaços, sublinhados e [pressentis retos]."
+    "invalid_chars": "O nome de utilizador pode conter apenas letras, números, espaços, sublinhados e [colchetes]."

255-256: Use “Navios de guerra”.

-    "warship": "Naves de Guerra",
+    "warship": "Navios de guerra",

497-504: Simplify structure info label.

-    "structure_info": "Informações do Modelo de Estrutura",
+    "structure_info": "Informações da estrutura",
resources/lang/gl.json (1)

416-416: Remove stray quotes in message.

It currently renders with literal double quotes.

-      "mirv_ready": "\"[P1] xa ten ouro dabondo para lanzar un MIRV!\""
+      "mirv_ready": "[P1] xa ten ouro dabondo para lanzar un MIRV!"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c9149e and b5769b5.

📒 Files selected for processing (15)
  • resources/lang/bg.json (13 hunks)
  • resources/lang/da.json (11 hunks)
  • resources/lang/eo.json (11 hunks)
  • resources/lang/fi.json (11 hunks)
  • resources/lang/fr.json (11 hunks)
  • resources/lang/gl.json (11 hunks)
  • resources/lang/hu.json (1 hunks)
  • resources/lang/ja.json (11 hunks)
  • resources/lang/pt-PT.json (1 hunks)
  • resources/lang/ru.json (11 hunks)
  • resources/lang/sk.json (11 hunks)
  • resources/lang/sl.json (11 hunks)
  • resources/lang/uk.json (16 hunks)
  • resources/lang/zh-CN.json (11 hunks)
  • src/client/LangSelector.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: TheGiraffe3
PR: openfrontio/OpenFrontIO#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: andrewNiziolek
PR: openfrontio/OpenFrontIO#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: scottanderson
PR: openfrontio/OpenFrontIO#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: mokizzz
PR: openfrontio/OpenFrontIO#1940
File: resources/lang/en.json:763-766
Timestamp: 2025-08-27T08:12:19.610Z
Learning: In OpenFrontIO, some country entries in src/client/data/countries.json may have similar names but different codes (e.g., "Empire of Japan" vs "Empire of Japan1"). Each unique code requires its own translation key in resources/lang/en.json after normalization. Always verify against countries.json before suggesting removal of translation keys.
📚 Learning: 2025-08-16T10:52:08.292Z
Learnt from: TheGiraffe3
PR: openfrontio/OpenFrontIO#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.

Applied to files:

  • resources/lang/hu.json
📚 Learning: 2025-05-30T03:53:52.231Z
Learnt from: scottanderson
PR: openfrontio/OpenFrontIO#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.

Applied to files:

  • resources/lang/hu.json
📚 Learning: 2025-06-02T14:27:37.609Z
Learnt from: andrewNiziolek
PR: openfrontio/OpenFrontIO#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:

  • resources/lang/hu.json
  • resources/lang/fr.json
  • resources/lang/bg.json
  • resources/lang/eo.json
📚 Learning: 2025-07-23T12:36:35.354Z
Learnt from: Aotumuri
PR: openfrontio/OpenFrontIO#1534
File: src/client/LangSelector.ts:97-106
Timestamp: 2025-07-23T12:36:35.354Z
Learning: In OpenFrontIO's LangSelector.ts, the getClosestSupportedLang method always joins language code parts with underscores ("_") because all keys in the languageMap use underscore format (e.g., pt_BR, sv_SE, zh_CN). This normalization ensures consistency regardless of whether the input language code uses hyphens or underscores as delimiters.

Applied to files:

  • src/client/LangSelector.ts
📚 Learning: 2025-08-27T08:12:19.610Z
Learnt from: mokizzz
PR: openfrontio/OpenFrontIO#1940
File: resources/lang/en.json:763-766
Timestamp: 2025-08-27T08:12:19.610Z
Learning: In OpenFrontIO, some country entries in src/client/data/countries.json may have similar names but different codes (e.g., "Empire of Japan" vs "Empire of Japan1"). Each unique code requires its own translation key in resources/lang/en.json after normalization. Always verify against countries.json before suggesting removal of translation keys.

Applied to files:

  • resources/lang/bg.json
  • resources/lang/eo.json
🔇 Additional comments (12)
resources/lang/hu.json (1)

1-605: Overall: new Hungarian locale looks good and follows the mls PR policy.

Keys align with other locales and placeholders look consistent.

resources/lang/da.json (1)

1-605: Danish updates look consistent with the new keys and maps.

resources/lang/zh-CN.json (1)

1-606: CN locale looks solid; one label mismatch for ground attack.

resources/lang/sl.json (2)

29-31: Key additions align with v26 (LGTM).

Replaced news.full_changelog, added action_auto_upgrade and radial_attack. No issues spotted.

Also applies to: 46-47, 73-76


600-604: Fix invalid JSON: missing comma before new top-level radial_menu.

Add a comma after the closing brace of "auth" to separate sibling properties.

Apply this diff:

-  }
+  },

Likely an incorrect or invalid review comment.

resources/lang/bg.json (1)

29-32: News key rename looks good.

resources/lang/uk.json (1)

600-604: Fix invalid JSON: missing comma before new top-level radial_menu.

Add a comma after "auth".

-  }
+  },

Likely an incorrect or invalid review comment.

src/client/LangSelector.ts (1)

19-20: Registering hu and pt-PT looks good.

Please verify the files exist and JSON is valid.

#!/bin/bash
set -euo pipefail

# Validate new/changed locale JSON
for f in resources/lang/sl.json resources/lang/bg.json resources/lang/uk.json resources/lang/eo.json resources/lang/gl.json resources/lang/pt-PT.json; do
  echo "Validating $f"
  jq -e . "$f" >/dev/null
done

# Ensure new locales referenced here exist
test -f resources/lang/hu.json
test -f resources/lang/pt-PT.json

# Check LangSelector has pt-PT and hu registered
rg -nP '"pt-PT"\s*:' src/client/LangSelector.ts
rg -nP '\bhu\b\s*,?' src/client/LangSelector.ts

echo "All checks passed."

Also applies to: 26-27, 59-60, 63-64

resources/lang/pt-PT.json (1)

600-604: Fix invalid JSON: missing comma before new top-level radial_menu.

Add a comma after "auth".

-  }
+  },

Likely an incorrect or invalid review comment.

resources/lang/eo.json (1)

600-604: Fix invalid JSON: missing comma before new top-level radial_menu.

Add a comma after "auth".

-  }
+  },

Likely an incorrect or invalid review comment.

resources/lang/gl.json (2)

29-31: Key additions align with v26 (LGTM).

Also applies to: 150-151, 167-170, 220-222


600-604: Fix invalid JSON: missing comma before new top-level radial_menu.

Add a comma after "auth".

-  }
+  },

Likely an incorrect or invalid review comment.

Duwibi
Duwibi previously approved these changes Sep 7, 2025
@evanpelle evanpelle merged commit 00d4aa4 into openfrontio:main Sep 8, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Translation Addition or modification of a language to the translations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants