From a2ef175a819da79599f2dba422a9a7d311b50e9d Mon Sep 17 00:00:00 2001 From: PopSlime Date: Mon, 24 Mar 2025 00:06:29 +0800 Subject: [PATCH] fix: Fix potentially bad formats in culture info --- Assets/Cryville.EEW.Unity/UI/EventOngoingView.cs | 2 +- Assets/Cryville.EEW.Unity/UI/TimeView.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Assets/Cryville.EEW.Unity/UI/EventOngoingView.cs b/Assets/Cryville.EEW.Unity/UI/EventOngoingView.cs index 8a5dcc5..822212e 100644 --- a/Assets/Cryville.EEW.Unity/UI/EventOngoingView.cs +++ b/Assets/Cryville.EEW.Unity/UI/EventOngoingView.cs @@ -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)) { diff --git a/Assets/Cryville.EEW.Unity/UI/TimeView.cs b/Assets/Cryville.EEW.Unity/UI/TimeView.cs index 104473b..0911d4f 100644 --- a/Assets/Cryville.EEW.Unity/UI/TimeView.cs +++ b/Assets/Cryville.EEW.Unity/UI/TimeView.cs @@ -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); } } }