Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the app locale to the sites lang #4715

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Http/Middleware/Localize.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ public function handle($request, Closure $next)
// installed on your actual server. You can check by running `locale -a`).
setlocale(LC_TIME, $site->locale());

// The short locale is used for your translations. (eg. if you set your site's locale
// to "fr_FR", the translator will look for "fr" files rather than "fr_FR" files.)
app()->setLocale($site->shortLocale());
// The sites lang is used for your translations. (eg. if you set your site's lang
// to "fr_FR", the translator will look for "fr_FR" files rather than "fr" files
// but if not set the translator will look for "fr" files rather than "fr_FR" files.)
app()->setLocale($site->lang());

Carbon::setToStringFormat(Statamic::dateFormat());

Expand Down