Skip to content

Add localization support & Chinese Translation - #47

Merged
siimav merged 6 commits into
KSP-RO:masterfrom
tinygrox:Localization
Oct 29, 2026
Merged

siimav merged 6 commits into
KSP-RO:masterfrom
tinygrox:Localization

Conversation

@tinygrox

Copy link
Copy Markdown
Contributor

Overall, two main features have been added to the mod:

  • Localization Support
  • Add Chinese Translation
    😄

Comment thread SolverEngines/AJEInlet.cs Outdated
public string GetModuleTitle()
{
return "AJE Inlet";
return LocalizationStrings.str_AJEInlet; // "AJE Inlet"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please keep this as plain "AJE Inlet". KSP's part loader puts GetModuleTitle() into moduleName, which acts as an identifier. The name shown to the player comes from GetModuleDisplayName(), and AJEInlet inherits that from ModuleResourceIntake (stock localized "Intake"). So this change is not visible anywhere and only changes the identifier. Stock does it the same way: ModuleEngines.GetModuleTitle() returns "Engine" and GetModuleDisplayName() returns the localized string.

If you want a localized name, override GetModuleDisplayName() instead. Note that this changes the visible name from "Intake" to "AJE Inlet".

Comment thread SolverEngines/LocalizationStrings.cs Outdated
namespace SolverEngines
{
// static Strings for Localization
public static class LocalizationStrings

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SolverEngines is a library and other mods build against it. A public class with public mutable static fields becomes API that someone can start depending on. Please make the class internal and the fields static readonly.

Comment thread SolverEngines/EngineModule.cs Outdated
public float Need_Area;

[KSPField(guiActive = true, guiName = "Current Throttle", guiFormat = "N2", guiUnits = "%")]
[KSPField(guiActive = true, guiName = "#SolverEngines_CurrentThrottle", guiFormat = "N2", guiUnits = "%")] // "Current Throttle"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The trailing // "English text" comments on every changed line, and the <summary> on every field in LocalizationStrings, repeat what is already in en-us.cfg. The quoting is mixed too (// Intake Area vs // "Intake Area"). Please drop them.


#SolverEngines_Units = 单位

#SolverEngines_OverallTPR = 整体推力燃耗率

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

整体推力燃耗率 means overall thrust specific fuel consumption (TSFC). This should be total pressure recovery: 整体总压恢复, matching TPR = 总压恢复.

#SolverEngines_AmbientTemperature = 环境温度
#SolverEngines_AmbientPressure = 环境压力
#SolverEngines_RecoveryTemperature = 恢复温度
#SolverEngines_RecoveryPressure = 压力恢复

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

压力恢复 reads as "pressure recovery", which is easy to confuse with TPR. This is the recovery (stagnation) pressure, so 恢复压力 or 滞止压力 fits better. Same for ShowRecoveryPressure on line 25.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd prefer 恢复压力, not sure why you would want to say 滞止 here

#SolverEngines_ShowThrusttoWeightRatio = 显示推重比
#SolverEngines_ShowThrustDrag = 显示推力/阻力
#SolverEngines_ShowIsp = 显示比冲
#SolverEngines_ShowTSFC = 显示推力燃料消耗率

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TSFC is 推力燃耗率 on line 17 and 推力燃料消耗率 here. Please pick one.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

as far as I can tell 燃耗率 is not a common word so I think the second, longer one is better

#SolverEngines_IntakeArea = 进气面积
#SolverEngines_IntakeResource = 进气资源

#SolverEngines_CurrentThrottle = 当前阀门

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

阀门 means "valve". Stock KSP zh-cn uses 节流阀 for throttle, so 当前节流阀.

#SolverEngines_CurrentThrottle = 当前阀门
#SolverEngines_MassFlow = 质量流
#SolverEngines_EngineInternalTemp = 引擎内部温度
#SolverEngines_PartMelted = <<1>> 因内部温度过高已熔毁.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: use the Chinese full stop 。 instead of ..

- Keep AJEInlet.GetModuleTitle non-localized since KSP uses it as the module identifier
- Make LocalizationStrings internal with readonly fields
- Remove comments that duplicate en-us.cfg
- Fix zh-cn translations for OverallTPR, RecoveryPressure, TSFC, CurrentThrottle and PartMelted
@siimav siimav changed the title Localization support & Chinese Translation Add localization support & Chinese Translation Oct 29, 2026
@siimav
siimav merged commit 5f62cfe into KSP-RO:master Oct 29, 2026
2 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.

3 participants