refactor: use localization constants at remaining call sites

This commit is contained in:
2026-06-23 21:41:24 +08:00
parent 51fc080ff2
commit 8d70ce8862
11 changed files with 30 additions and 30 deletions
+3 -3
View File
@@ -204,7 +204,7 @@ public static class TechFunctions
UnlockWithPropertiesImmediately();
return;
}
var msg = "Do you want to use metadata to buyout the following tech?".Translate();
var msg = I18NKeys.DoYouWantToUseMetadataToBuyoutTheFollowingTech.Translate();
if (techList.Count <= 10)
{
@@ -227,13 +227,13 @@ public static class TechFunctions
}
msg += "\n\n";
msg += "The following is the required metadata for buyout:".Translate();
msg += I18NKeys.TheFollowingIsTheRequiredMetadataForBuyout.Translate();
foreach (var consumption in properties)
{
if (consumption.Value <= 0) continue;
msg += $"\n {LDB.items.Select(consumption.Key).propertyName}x{consumption.Value}";
}
UIMessageBox.Show("Batch buyout tech".Translate(), msg, I18NKeys.Cancel.Translate(), I18NKeys.OK.Translate(), UIMessageBox.QUESTION, null, UnlockWithPropertiesImmediately);
UIMessageBox.Show(I18NKeys.BatchBuyoutTech.Translate(), msg, I18NKeys.Cancel.Translate(), I18NKeys.OK.Translate(), UIMessageBox.QUESTION, null, UnlockWithPropertiesImmediately);
return;
void AddToMsg(ref string str, Tuple<TechProto, int, int> tuple)
+1 -1
View File
@@ -99,6 +99,6 @@ internal static class AutoConstructUI
public static void UpdateConstructCountText(int count)
{
if (ConstructCountText == null) return;
ConstructCountText.text = String.Format("Buildings to construct: {0}".Translate(), count);
ConstructCountText.text = String.Format(I18NKeys.BuildingsToConstruct0.Translate(), count);
}
}
+5 -5
View File
@@ -50,11 +50,11 @@ public static class WindowFunctions
{
return priority switch
{
WinApi.HIGH_PRIORITY_CLASS => "High".Translate(),
WinApi.ABOVE_NORMAL_PRIORITY_CLASS => "Above Normal".Translate(),
WinApi.NORMAL_PRIORITY_CLASS => "Normal".Translate(),
WinApi.BELOW_NORMAL_PRIORITY_CLASS => "Below Normal".Translate(),
WinApi.IDLE_PRIORITY_CLASS => "Idle".Translate(),
WinApi.HIGH_PRIORITY_CLASS => I18NKeys.High.Translate(),
WinApi.ABOVE_NORMAL_PRIORITY_CLASS => I18NKeys.AboveNormal.Translate(),
WinApi.NORMAL_PRIORITY_CLASS => I18NKeys.Normal.Translate(),
WinApi.BELOW_NORMAL_PRIORITY_CLASS => I18NKeys.BelowNormal.Translate(),
WinApi.IDLE_PRIORITY_CLASS => I18NKeys.Idle.Translate(),
_ => I18NKeys.Unknown.Translate()
};
}
+2 -2
View File
@@ -133,13 +133,13 @@ public class GamePatch : PatchImpl<GamePatch>
if (_speedDownKey.keyValue)
{
GameUpsFactor.Value = Maths.Clamp(Math.Round((GameUpsFactor.Value - 0.5) * 2.0) / 2.0, 0.1, 10.0);
UIRoot.instance.uiGame.generalTips.InvokeRealtimeTipAhead(string.Format("Logical frame rate: {0}x".Translate(), GameUpsFactor.Value));
UIRoot.instance.uiGame.generalTips.InvokeRealtimeTipAhead(string.Format(I18NKeys.LogicalFrameRate0X.Translate(), GameUpsFactor.Value));
}
if (_speedUpKey.keyValue)
{
GameUpsFactor.Value = Maths.Clamp(Math.Round((GameUpsFactor.Value + 0.5) * 2.0) / 2.0, 0.1, 10.0);
UIRoot.instance.uiGame.generalTips.InvokeRealtimeTipAhead(string.Format("Logical frame rate: {0}x".Translate(), GameUpsFactor.Value));
UIRoot.instance.uiGame.generalTips.InvokeRealtimeTipAhead(string.Format(I18NKeys.LogicalFrameRate0X.Translate(), GameUpsFactor.Value));
}
}
+2 -2
View File
@@ -536,8 +536,8 @@ public static class UIConfigWindow
void AddApplyButton(float rowY, string objName, UnityAction onClick) => AddApplyButtonAt(applyBtnX, rowY, objName, onClick);
void AddCategoryApplyButton(float catY, string objName, UnityAction onClick) =>
wnd.AddFlatButton(applyAllBtnX, catY + 7f, tab3, "Apply all config to planet", applyBtnFontSize, objName, onClick).WithSize(applyAllBtnWidth, applyBtnHeight)
.WithFontSize(applyBtnFontSize).WithTip("Apply all config to planet tips".Translate());
wnd.AddFlatButton(applyAllBtnX, catY + 7f, tab3, I18NKeys.ApplyAllConfigToPlanet, applyBtnFontSize, objName, onClick).WithSize(applyAllBtnWidth, applyBtnHeight)
.WithFontSize(applyBtnFontSize).WithTip(I18NKeys.ApplyAllConfigToPlanetTips.Translate());
AddCategoryApplyButton(dispenserCatY, "btn-apply-all-dispenser", LogisticsPatch.ApplyAllDispenser);
AddCategoryApplyButton(battleBaseCatY, "btn-apply-all-battle-base", LogisticsPatch.ApplyAllBattleBase);