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()
};
}