From c741d56b32fb7482ceca8e0c5bd8ce8ef9104b1f Mon Sep 17 00:00:00 2001 From: Florian Dupret Date: Sun, 2 Aug 2020 14:37:15 +0200 Subject: [PATCH 1/3] UTF8 locale support for Windows --- app/Support/Steam.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Support/Steam.php b/app/Support/Steam.php index b25e8851a1..7d42d8dc32 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -614,6 +614,11 @@ class Steam if ('equal' === $locale) { return $this->getLanguage(); } + + // Check for Windows to replace the locale correctly. + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $locale = str_replace('_', '-', $locale); + } return $locale; } @@ -627,7 +632,6 @@ class Steam return [ sprintf('%s.utf8', $locale), sprintf('%s.UTF-8', $locale), - str_replace('_', '-', $locale), // for Windows. ]; } From bff6c81ed27b1a6f5ae08a04bd0021199492b156 Mon Sep 17 00:00:00 2001 From: Florian Dupret Date: Sun, 2 Aug 2020 14:48:12 +0200 Subject: [PATCH 2/3] Remove warning about Windows locale --- resources/views/v1/preferences/index.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/views/v1/preferences/index.twig b/resources/views/v1/preferences/index.twig index 64979b87dd..04924c5e49 100644 --- a/resources/views/v1/preferences/index.twig +++ b/resources/views/v1/preferences/index.twig @@ -72,7 +72,6 @@ From 6db2b3d4342689fc7a47bc131ce1620dd5831ee2 Mon Sep 17 00:00:00 2001 From: Florian Dupret Date: Sun, 2 Aug 2020 15:33:56 +0200 Subject: [PATCH 3/3] Remove string for warning about Windows locale --- resources/lang/en_US/firefly.php | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index e36ebe2f75..af29b9abc6 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -573,7 +573,6 @@ return [ 'pref_locale' => 'Locale settings', 'pref_languages_help' => 'Firefly III supports several languages. Which one do you prefer?', 'pref_locale_help' => 'Firefly III allows you to set other local settings, like how currencies, numbers and dates are formatted. Entries in this list may not be supported by your system. Firefly III doesn\'t have the correct date settings for every locale; contact me for improvements.', - 'pref_locale_no_windows' => 'This feature may not work on Windows.', 'pref_locale_no_demo' => 'This feature won\'t work for the demo user.', 'pref_custom_fiscal_year' => 'Fiscal year settings', 'pref_custom_fiscal_year_label' => 'Enabled',