Skip to content

Commit

Permalink
Use the configured locale from Magento (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
royduin authored Jan 24, 2024
1 parent f6dc75b commit fa071f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Rapidez.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Routing\RouteAction;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Event;
use Rapidez\Core\Models\Store;

Expand Down Expand Up @@ -109,6 +110,8 @@ public function setStore(Store|array|callable|int|string $store): void
config()->set('rapidez.root_category_id', $store['root_category_id']);
config()->set('frontend.base_url', url('/'));

App::setLocale(strtok(Rapidez::config('general/locale/code', 'en_US'), '_'));

Event::dispatch('rapidez:store-set', [$store]);
}

Expand Down

0 comments on commit fa071f9

Please sign in to comment.