summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-12-18 02:14:45 +0100
committermsquare <msquare@notrademark.de>2018-12-19 22:36:42 +0100
commit2570418e9ff95ebffdaabb4945ec611104891849 (patch)
tree5838f1627d267334c688f5289da6ad64e04d1313
parent9a15fbc71e296d7810984455aa7dc19503f89de3 (diff)
Translation: Enforce LC_NUMERIC for numeric conversions
-rw-r--r--src/Helpers/TranslationServiceProvider.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Helpers/TranslationServiceProvider.php b/src/Helpers/TranslationServiceProvider.php
index 9d86df7d..4565dfcd 100644
--- a/src/Helpers/TranslationServiceProvider.php
+++ b/src/Helpers/TranslationServiceProvider.php
@@ -52,7 +52,12 @@ class TranslationServiceProvider extends ServiceProvider
*/
public function setLocale($locale)
{
+ // Set the users locale
putenv('LC_ALL=' . $locale);
setlocale(LC_ALL, $locale);
+
+ // Reset numeric formatting to allow output of floats
+ putenv('LC_NUMERIC=C');
+ setlocale(LC_NUMERIC, 'C');
}
}