PHP translate by gettext

Posted September 25, 2017 3.6k views
Ubuntu Apache PHP

Hello , How can i fix gettext issue with this website that has wordked correctly on old server

 if (Request::isHttpGet('lang')) {
            if (Request::getHttpGet('lang') == 'ar-jo')
                $language = 'ar_JO';
        }else {
            $language = 'en_US';

        setlocale(LC_ALL, $language);
        $path = BASE_PATH . 'locale';
        $domain = 'words'; //this is the default text-domain
        bindtextdomain($domain, $path);
        //  bind_textdomain_codeset($domain, 'UTF-8');
        bind_textdomain_codeset($domain, 'UTF-8');

the language files are located in core/locale/arJO/LCMESSAGES

How can i debug the issue because i think the problem from server not from a code ??

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

2 answers

You debug the issue by talking to your web developer. The server (besides PHP version) is irrelevant.

Submit an Answer