From 90a799f54edbae15b94ba7f286679ffa874a07eb Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Sun, 23 Aug 2026 13:59:47 +0900 Subject: [PATCH] Preview: Set locale back when completed --- src/Widgets/Preview.vala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Widgets/Preview.vala b/src/Widgets/Preview.vala index 5ac946a7..b09ca402 100644 --- a/src/Widgets/Preview.vala +++ b/src/Widgets/Preview.vala @@ -65,6 +65,9 @@ namespace SwitchboardPlugLocale.Widgets { } public void reload_languages (string format) { + // Retrieve a copy of current locale string + string current_format = Intl.setlocale (LocaleCategory.ALL, null); + Intl.setlocale (LocaleCategory.ALL, format); var date = new DateTime.now_local (); @@ -77,6 +80,9 @@ namespace SwitchboardPlugLocale.Widgets { time_label.label = date.format ("%X"); currency_label.label = (string) currency; number_label.label = "%'.2f".printf (1234.56); + + // Set locale back + Intl.setlocale (LocaleCategory.ALL, current_format); } } }