Hi,
Is it possible to use PHP's gettext system in PHP8? It works fine in PHP5.5 and PHP7.4 but in PHP 8.2 or PHP8.3 no text returned.
Obivously something different is required when running PHP8. Does anyone have an example on how it's supposed to be set up?
Solved! Go to Solution.
It has been resolved. For those wonder, this is the order of calls to setup gettext in PHP8.
// e.g.
// $sLocale = 'sv_SE';
// $sTextDomain = 'sv'';
putenv("LANGUAGE=$sLocale");
putenv("LC_ALL=$sLocale");
setlocale(LC_ALL, $sLocale);
bindtextdomain($sTextDomain, "./Locale");
textdomain($sTextDomain);
bind_textdomain_codeset($sTextDomain, 'UTF-8');