fix: Fix potentially bad formats in culture info

This commit is contained in:
2025-03-24 00:06:29 +08:00
parent 915ba55c2e
commit a2ef175a81
2 changed files with 2 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ namespace Cryville.EEW.Unity.UI {
}
void SetView(float mainSeverity, string title, string location, CultureInfo culture) {
SetSeverity(mainSeverity);
SetText(m_textView, string.Format("{0} {1}", title, location), culture);
SetText(m_textView, string.Format(culture, "{0} {1}", title, location), culture);
}
static void SetText(TMPLocalizedText view, string text, CultureInfo culture) {
if (string.IsNullOrWhiteSpace(text)) {

View File

@@ -1,5 +1,4 @@
using System;
using System.Globalization;
using TMPro;
using UnityEngine;
@@ -19,7 +18,7 @@ namespace Cryville.EEW.Unity.UI {
time = TimeZoneInfo.ConvertTime(time, timeZone, tTimeZone);
else
tTimeZone = timeZone;
_textView.text = SharedSettings.Instance.DoDisplayTimeZone ? string.Format(CultureInfo.CurrentCulture, "{0:G} ({1})", time, tTimeZone.ToTimeZoneString()) : time.ToString(CultureInfo.CurrentCulture);
_textView.text = SharedSettings.Instance.DoDisplayTimeZone ? string.Format(SharedCultures.CurrentCulture, "{0:G} ({1})", time, tTimeZone.ToTimeZoneString()) : time.ToString(SharedCultures.CurrentCulture);
}
}
}