Merge pull request #3638 from sephrat/windows-locale

UTF8 locale support for Windows
This commit is contained in:
James Cole
2020-08-02 15:19:02 +00:00
committed by GitHub
3 changed files with 5 additions and 3 deletions

View File

@@ -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.
];
}

View File

@@ -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',

View File

@@ -72,7 +72,6 @@
<ul class="text-warning">
{% if IS_DEMO_SITE %}<li class="text-danger">{{ 'pref_locale_no_demo'|_ }}</li>{% endif %}
<li>{{ 'pref_locale_no_windows'|_ }}</li>
</ul>
</div>
{% else %}