diff --git a/_docs/2-Configuration.md b/_docs/2-Configuration.md index 36bab28..4b7bf57 100644 --- a/_docs/2-Configuration.md +++ b/_docs/2-Configuration.md @@ -15,6 +15,7 @@ ['en', 'es', 'fr'], 'accept-language-header' => true, @@ -23,6 +24,8 @@ return [ 'facade' => 'Localization', + 'utf-8-suffix' => '.UTF-8', + //... ``` @@ -32,7 +35,7 @@ return [ | accept-language-header | Using the locale negotiator to get locale from `Accept-Language` header. | | hide-default-in-url | If `true`, the non localized root is treated as the application's default locale (`app.locale`). | | facade | The alias name for the facade. | - +|| Locale suffix for LC_TIME and LC_MONETARY: Defaults to most common ".UTF-8". Set to blank on Windows systems, change to ".utf8" on CentOS and similar. | ## Route ```php diff --git a/config/localization.php b/config/localization.php index 1c6885e..be8e398 100644 --- a/config/localization.php +++ b/config/localization.php @@ -17,6 +17,8 @@ 'facade' => 'Localization', + 'utf-8-suffix' => '.UTF-8', + /* ----------------------------------------------------------------- | Route | ----------------------------------------------------------------- @@ -2148,4 +2150,5 @@ 'regional' => 'zu_ZA', ], ], + ]; diff --git a/src/Utilities/LocalesManager.php b/src/Utilities/LocalesManager.php index d165a01..2914dc0 100644 --- a/src/Utilities/LocalesManager.php +++ b/src/Utilities/LocalesManager.php @@ -375,8 +375,10 @@ private function updateRegional() $currentLocale = $this->getCurrentLocaleEntity(); if ( ! empty($regional = $currentLocale->regional())) { - setlocale(LC_TIME, "$regional.UTF-8"); - setlocale(LC_MONETARY, "$regional.UTF-8"); + $suffix = $this->getConfig('utf-8-suffix', '.UTF-8'); + + setlocale(LC_TIME, $regional.$suffix); + setlocale(LC_MONETARY, $regional.$suffix); } } }