Skip to content

Commit

Permalink
Api: use user language as locale #1872
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico Hoffmann committed Sep 15, 2019
1 parent 74a984e commit 3223ed8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Api/Api.php
Expand Up @@ -169,7 +169,8 @@ public function call(string $path = null, string $method = 'GET', array $request
$auth = $this->route->attributes()['auth'] ?? true;

if ($auth !== false) {
$this->authenticate();
$user = $this->authenticate();
setlocale(LC_ALL, $user->language());
}

$output = $this->route->action()->call($this, ...$this->route->arguments());
Expand Down

0 comments on commit 3223ed8

Please sign in to comment.