Core: Movie and State: Add 'L' option to fmt format string to actually use the current locale.

This commit is contained in:
Jordan Woyak committed 2026-10-09 13:06:42 -05:00
1 parent e6f3ae1762
commit cbac65d326
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -7,7 +7,6 @@
#include <array>
#include <cstring>
#include <iterator>
#include <locale>
#include <mbedtls/md.h>
#include <mutex>
#include <thread>
@@ -159,7 +158,8 @@ std::string MovieManager::GetRTCDisplay() const
const tm gm_time = fmt::gmtime(current_time);
// Use current locale for formatting time, as fmt is locale-agnostic by default.
return fmt::format(Common::GetEnvironmentLocale(), "Date/Time: {:%c}", gm_time);
// Using L for locale-dependent formatting.
return fmt::format(Common::GetEnvironmentLocale(), "Date/Time: {:L%c}", gm_time);
}
// NOTE: GPU Thread
+2 -2
View File
@@ -5,7 +5,6 @@
#include <algorithm>
#include <filesystem>
#include <locale>
#include <map>
#include <mutex>
#include <shared_mutex>
@@ -301,7 +300,8 @@ static std::string SystemTimeAsDoubleToString(double time)
return "";
// fmt is locale agnostic by default, so explicitly use current locale.
return fmt::format(Common::GetEnvironmentLocale(), "{:%x %X}", *local_time);
// Using L for locale-dependent formatting.
return fmt::format(Common::GetEnvironmentLocale(), "{:L%x %X}", *local_time);
}
static std::string MakeStateFilename(u32 number)