Show message when locale is invalid.

This commit is contained in:
James Cole
2017-09-14 16:12:07 +02:00
parent a20d9fa8f1
commit 768c7e53b4
2 changed files with 18 additions and 1 deletions

View File

@@ -98,7 +98,13 @@ class Range
$locale = array_map('trim', $locale);
setlocale(LC_TIME, $locale);
setlocale(LC_MONETARY, $locale);
$moneyResult = setlocale(LC_MONETARY, $locale);
// send error to view if could not set money format
if($moneyResult === false) {
View::share('invalidMonetaryLocale', true);
}
// save some formats: