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 Jan 9, 2024
1 parent 9803bdd commit e3b3210
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 e3b3210

Please sign in to comment.