Use locales for numbers and currency.

This commit is contained in:
2025-01-04 12:09:37 +01:00
parent 644adad9c3
commit 5b00aa8bb2
3 changed files with 6 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ APP_TIMEZONE=UTC
APP_URL=http://localhost APP_URL=http://localhost
APP_LOCALE=en APP_LOCALE=en
APP_CURRENCY=EUR
APP_FALLBACK_LOCALE=en APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US APP_FAKER_LOCALE=en_US

View File

@@ -3,6 +3,7 @@
namespace App\Providers; namespace App\Providers;
use App\View\Composers\TaxDropdown; use App\View\Composers\TaxDropdown;
use Illuminate\Support\Number;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Illuminate\Translation\Translator; use Illuminate\Translation\Translator;
@@ -31,5 +32,7 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void public function boot(): void
{ {
\Illuminate\Support\Facades\View::composer('components.tax-dropdown', TaxDropdown::class); \Illuminate\Support\Facades\View::composer('components.tax-dropdown', TaxDropdown::class);
Number::useLocale(config('app.locale'));
Number::useCurrency(config('app.currency'));
} }
} }

View File

@@ -80,6 +80,8 @@ return [
'locale' => env('APP_LOCALE', 'de'), 'locale' => env('APP_LOCALE', 'de'),
'currency' => env('APP_CURRENCY', 'EUR'),
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),