php gettext not working on wamp and windows 10

I know that this problem has been asked a dozens of times on here but I really looked at them all and tried everything but still no luck.

I’m trying to translate my app from french to english with PHP gettext. I’m parsing the gettext strings and store them in traduction.po to do the translation later with POEdit.
The problem is every single time it’s just outputing the original input.
 

My setup:

  • Windows 10 64-Bit french system locale
  • Wamp v3.3.1 64 bits
  • Apache 2.4.54.2
  • PHP 8.2.5

gettext setup code:

define('LOCALE_DIR', realpath($_SERVER['DOCUMENT_ROOT']). '/locale');

 

$locale = "en-US";
$domain = 'traduction';
putenv("LC_ALL={$locale}");
setlocale(LC_ALL, $locale);
bindtextdomain($domain, LOCALE_DIR);
textdomain($domain);
bind_textdomain_codeset($domain, 'UTF-8');
 
echo _("Bonjour");

Path to traduction:
C:wampwwwmyapplocaleen-USLC_MESSAGEStraduction.po

 
traduction.po

msgid ""
msgstr ""
"Project-Id-Version: Trad Project Anglaisn"
"POT-Creation-Date: 2023-04-14 14:54+0200n"
"PO-Revision-Date: 2023-04-14 14:54+0200n"
"Last-Translator: n"
"Language-Team: n"
"Language: en_USn"
"MIME-Version: 1.0n"
"Content-Type: text/plain; charset=UTF-8n"
"Content-Transfer-Encoding: 8bitn"
"Plural-Forms: nplurals=2; plural=(n != 1);n"
"X-Generator: Poedit 3.2.2n"
"X-Poedit-Basepath: ../../..n"
"X-Poedit-KeywordsList: _n"
"X-Poedit-SearchPath-0: .n"

 

#: index.php:17
msgid "Bonjour"
msgstr "Hello"

I’ve verified that gettext is enabled with phpinfo()

I also verified that the I got the right locals (since setlocale() returned false if the locale is en_US instead of en-US)

Here is the list of the installed locals in my Windows:

PS C:Usersme> Get-WinUserLanguageList

 


LanguageTag     : en-US
Autonym         : English (United States)
EnglishName     : English
LocalizedName   : Anglais (États-Unis)
ScriptName      : Latin
InputMethodTips : {0409:00020409}
Spellchecking   : True
Handwriting     : False

 

LanguageTag     : fr-FR
Autonym         : Français (France)
EnglishName     : French
LocalizedName   : Français (France)
ScriptName      : Latin
InputMethodTips : {040C:0000040C}
Spellchecking   : True
Handwriting     : False

Also I’m not sure if there’s one, but since I get no error message it would be nice if there’s a way that I can get a display of gettext’s log