mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-01-22 10:18:40 +00:00
add/improve locale
This commit is contained in:
parent
04982f300f
commit
3756e0613d
|
|
@ -700,17 +700,19 @@ final class ApiController extends Controller
|
|||
$account->setEmail((string) ($request->getData('email') ?? ''));
|
||||
$account->generatePassword((string) ($request->getData('password') ?? ''));
|
||||
|
||||
if ($request->getData('lang') === null) {
|
||||
if ($request->getData('locale') === null) {
|
||||
$account->setL11n(
|
||||
Localization::fromJson(
|
||||
$this->app->l11nServer === null ? $request->getHeader()->getL11n()->jsonSerialize() : $this->app->l11nServer->jsonSerialize()
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$locale = \explode('_', $request->getData('locale') ?? '');
|
||||
|
||||
$l11n = $account->getL11n();
|
||||
$l11n->loadFromLanguage(
|
||||
(string) ($request->getData('lang')),
|
||||
(string) ($request->getData('country') ?? $this->app->l11nServer->getCountry())
|
||||
$locale[0] ?? $this->app->l11nServer->getLanguage(),
|
||||
$locale[1] ?? $this->app->l11nServer->getCountry()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user