Repository navigation
Add localization support & Chinese Translation - #47
Conversation
| public string GetModuleTitle() | ||
| { | ||
| return "AJE Inlet"; | ||
| return LocalizationStrings.str_AJEInlet; // "AJE Inlet" |
There was a problem hiding this comment.
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".
| namespace SolverEngines | ||
| { | ||
| // static Strings for Localization | ||
| public static class LocalizationStrings |
There was a problem hiding this comment.
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.
| public float Need_Area; | ||
|
|
||
| [KSPField(guiActive = true, guiName = "Current Throttle", guiFormat = "N2", guiUnits = "%")] | ||
| [KSPField(guiActive = true, guiName = "#SolverEngines_CurrentThrottle", guiFormat = "N2", guiUnits = "%")] // "Current Throttle" |
There was a problem hiding this comment.
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 = 整体推力燃耗率 |
There was a problem hiding this comment.
整体推力燃耗率 means overall thrust specific fuel consumption (TSFC). This should be total pressure recovery: 整体总压恢复, matching TPR = 总压恢复.
| #SolverEngines_AmbientTemperature = 环境温度 | ||
| #SolverEngines_AmbientPressure = 环境压力 | ||
| #SolverEngines_RecoveryTemperature = 恢复温度 | ||
| #SolverEngines_RecoveryPressure = 压力恢复 |
There was a problem hiding this comment.
压力恢复 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.
There was a problem hiding this comment.
I'd prefer 恢复压力, not sure why you would want to say 滞止 here
| #SolverEngines_ShowThrusttoWeightRatio = 显示推重比 | ||
| #SolverEngines_ShowThrustDrag = 显示推力/阻力 | ||
| #SolverEngines_ShowIsp = 显示比冲 | ||
| #SolverEngines_ShowTSFC = 显示推力燃料消耗率 |
There was a problem hiding this comment.
TSFC is 推力燃耗率 on line 17 and 推力燃料消耗率 here. Please pick one.
There was a problem hiding this comment.
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 = 当前阀门 |
There was a problem hiding this comment.
阀门 means "valve". Stock KSP zh-cn uses 节流阀 for throttle, so 当前节流阀.
| #SolverEngines_CurrentThrottle = 当前阀门 | ||
| #SolverEngines_MassFlow = 质量流 | ||
| #SolverEngines_EngineInternalTemp = 引擎内部温度 | ||
| #SolverEngines_PartMelted = <<1>> 因内部温度过高已熔毁. |
There was a problem hiding this comment.
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
Overall, two main features have been added to the mod:
😄