Skip to content

Commit

Permalink
GettextTranslator: Also set the default locale for the intl extension
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Apr 5, 2024
1 parent 9803bdd commit 41090b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/GettextTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace ipl\I18n;

use Locale;
use FilesystemIterator;
use ipl\Stdlib\Contract\Translator;
use SplFileInfo;
Expand Down Expand Up @@ -195,6 +196,7 @@ public function setLocale($locale)
{
putenv("LANGUAGE=$locale.UTF-8");
setlocale(LC_ALL, $locale . '.UTF-8');
Locale::setDefault($locale . '.UTF-8');

$this->loadTranslations();

Expand Down

0 comments on commit 41090b9

Please sign in to comment.