feat(l10n): add planetary, fleet, recruitment, trading interface translation(zh-cn) - #1439
feat(l10n): add planetary, fleet, recruitment, trading interface translation(zh-cn)#1439CaesinEachonson wants to merge 37 commits into
Conversation
…json, added Chinese translation for said strings.
…nt, hit-test). IDE version will be updated during next commit.
- Wrap remaining bare strings in scr_PlanetData, scr_garrison, obj_star_select, obj_popup, scr_unit_quick_find_pane - Add localize_values flag to scr_Table for row-value translation - en.json/zh.json in sync at 690 keys
- Localize scr_fleet_advisor, scr_company_struct, scr_ui_manage and obj_controller battle UI (menu bar, ship repair popup) - Convert template-literal strings to localize(..., [args]) form - en.json/zh.json in sync at 849 keys
Devastator/歼灭者, Battle Barge/战斗驳船, Necrons/死灵族, Recruiting World/征兵世界, Planetary Features/行星特征, Renegade/变节, Reclusium/隐修室. Keep UI type labels 陆基型/赎罪远征.
- Localize recruit advisor, aspirant trials, training rates, promotion popup - Convert trial long_description templates to localize(..., [args]) - scr_role_setup verified already covered (chapter-creation strings) - en.json/zh.json in sync at 920 keys
…lair - Localize trade screen (items, xeno refusal dialog, deal chances) - Keep raw trade item data via data_label field so logic stays intact - Localize diplomacy screen, Reclusium/festival advisors, secret lair rooms - en.json/zh.json in sync at 1210 keys
Devastator/毁灭者, Necrons/太空死灵, Skitarii/护教军. Keep deliberate UI exceptions 陆基型/赎罪远征/Load=读取.
Resolve lang conflicts: our zh.json is a superset of the upstream localization (no unique upstream keys; only 3 zh values differed and ours wins per localization-conflict rule). Keep merged auto-resolution of 17 shared gml files (other PRs' changes preserved).
Trade, Reclusium/festival, diplomacy, secret lair, unit manage screens used Latin-only fonts; wrap every draw_set_font with cjk_font() so localized Chinese text renders (fallback runtime CJK fonts).
There was a problem hiding this comment.
5 issues found across 21 files
Confidence score: 4/5
- In
scripts/scr_promote/scr_promote.gml, dynamic requirement keys like equipment names fall back to raw English in Chinese, so promotion requirements can appear mixed-language and harder to interpret—add the missingzh.jsonentries for all referenced requirement keys. - In
scripts/scr_fleet_advisor/scr_fleet_advisor.gml, both weapon labels (cn.temp[110..116]) and theGlorianaclass can render in English in the Chinese fleet detail view, which creates inconsistent UI text and weakens clarity—add the supported weapon and class keys to the Chinese locale. - In
scripts/scr_ui_manage/scr_ui_manage.gml, the Apothecarion company name is routed through localization but the key is missing from catalogs, so this branch stays English for Chinese users—add the key and Chinese translation in the language files. - In
scripts/scr_company_struct/scr_company_struct.gml, nested lookup of dynamic squad location phrases leaves English fragments inside otherwise translated labels, causing partial localization in core squad info—return stable keys/values fromsquad_loci()(or localize the dynamic phrase before composing the label).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/scr_ui_manage/scr_ui_manage.gml">
<violation number="1" location="scripts/scr_ui_manage/scr_ui_manage.gml:485">
P2: The Apothecarion company name is passed through localization, but its key is absent from both language catalogs, so this branch remains English in Chinese. Add the key and its Chinese translation to the catalogs.</violation>
</file>
<file name="scripts/scr_promote/scr_promote.gml">
<violation number="1" location="scripts/scr_promote/scr_promote.gml:251">
P2: In Chinese, requirements such as `Bolter`, `Jump Pack`, and `Company Standard` remain English because these dynamic keys have no `zh.json` entries and `translate` falls back to the key. Add translations for all equipment and special requirement values before localizing them.</violation>
</file>
<file name="scripts/scr_fleet_advisor/scr_fleet_advisor.gml">
<violation number="1" location="scripts/scr_fleet_advisor/scr_fleet_advisor.gml:185">
P2: When a Gloriana ship appears in the fleet, this call falls back to the English class name because the Chinese locale has no `Gloriana` entry. Add the missing class translation.</violation>
<violation number="2" location="scripts/scr_fleet_advisor/scr_fleet_advisor.gml:295">
P2: In the Chinese fleet detail view, weapon names still render in English because none of the weapon keys used by `cn.temp[110..116]` exists in the Chinese locale. Add translations for the supported weapon names.</violation>
</file>
<file name="scripts/scr_company_struct/scr_company_struct.gml">
<violation number="1" location="scripts/scr_company_struct/scr_company_struct.gml:559">
P2: When the squad location contains a dynamic phrase, this nested lookup leaves that phrase in English even though the surrounding label is translated. Return stable location keys and values from `squad_loci()` or localize each location template before composing the display text.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| break; | ||
| case 12: | ||
| _company_name = "Apothecarion"; | ||
| _company_name = localize("Apothecarion"); |
There was a problem hiding this comment.
P2: The Apothecarion company name is passed through localization, but its key is absent from both language catalogs, so this branch remains English in Chinese. Add the key and its Chinese translation to the catalogs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/scr_ui_manage/scr_ui_manage.gml, line 485:
<comment>The Apothecarion company name is passed through localization, but its key is absent from both language catalogs, so this branch remains English in Chinese. Add the key and its Chinese translation to the catalogs.</comment>
<file context>
@@ -466,37 +466,37 @@ function reset_manage_unit_constants(unit) {
break;
case 12:
- _company_name = "Apothecarion";
+ _company_name = localize("Apothecarion");
break;
case 13:
</file context>
| draw_set_color(CM_GREEN_COLOR); | ||
| } | ||
| draw_text(1280, 390, $"{req_wep1_num} {req_wep1} (Have {have_wep1_num})"); | ||
| draw_text(1280, 390, localize("{0} {1} (Have {2})", [req_wep1_num, localize(req_wep1), have_wep1_num])); |
There was a problem hiding this comment.
P2: In Chinese, requirements such as Bolter, Jump Pack, and Company Standard remain English because these dynamic keys have no zh.json entries and translate falls back to the key. Add translations for all equipment and special requirement values before localizing them.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/scr_promote/scr_promote.gml, line 251:
<comment>In Chinese, requirements such as `Bolter`, `Jump Pack`, and `Company Standard` remain English because these dynamic keys have no `zh.json` entries and `translate` falls back to the key. Add translations for all equipment and special requirement values before localizing them.</comment>
<file context>
@@ -248,7 +248,7 @@ function draw_popup_promotion() {
draw_set_color(CM_GREEN_COLOR);
}
- draw_text(1280, 390, $"{req_wep1_num} {req_wep1} (Have {have_wep1_num})");
+ draw_text(1280, 390, localize("{0} {1} (Have {2})", [req_wep1_num, localize(req_wep1), have_wep1_num]));
}
if (req_wep2 != "") {
</file context>
There was a problem hiding this comment.
The keys for equipment are intended to be translated in the next stage. And it is intended to let the untranslated strings to rollback to their English values, so should there are more strings added in the future, and said strings are not yet translated by me or others, they won't crash the game because of missing value in zh.json
scr_fleet_advisor.gml:185 Is intended to left untranslated for now. It is to be translated at the next stage. |
There was a problem hiding this comment.
All reported issues were addressed across 19 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 10 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 5 unresolved issues from previous reviews.
Re-trigger cubic
Completed translation of:
A1. Planetary
A2. Fleet
A3. Recruitment
A4. Trading
Summary by cubic
Adds zh-CN localization across planetary, fleet, recruitment, trading, diplomacy, advisors, and secret lair screens, replacing hardcoded English and Latin-only fonts. Text now resolves via
localize(..., [args])and draws withcjk_font(), so Chinese renders correctly and language switching is stable.en.json/zh.jsonexpanded and kept in sync (~1,210 keys); remaining literals replaced (ship repair popup, “SELECT DESTINATION”, debug options, garrison/disposition labels, promotion/recruit alerts, “DECLARE WAR”, secret lair titles, unit location statuses).LocalizationManager.translate_array; localized arrays rebuild on language change to avoid per-frame translation and switch-time crashes.cjk_font(); DataSlate/ShutterButton localize cover text and cache per language.label, logic reads stabledata_label.Tableaddslocalize_headings/localize_values; enabled in unit quick-find for headings, with location values localized in code.localized_name_role()for advisor/unit headers; additional l10n fixes and a crash fix from a wrong function call.LocalizationManager: adds a resolved-fonts cache and consolidates the CJK font-load guard; removes a duplicated safeguard.Required actions
localize(..., [args])and draw withcjk_font(font).data_label(stable key) andlabel(localized); readdata_labelin logic.*_enarrays and rely on the locale refresh to rebuild localized arrays.Table.localize_headings/localize_valueswhen headings or cell values are localization keys.Written for commit 9d3c1c1. Summary will update on new commits.