Note that there are some explanatory texts on larger screens.

plurals
  1. POcan't make locale work on Linux
    primarykey
    data
    text
    <p>I am writing an PHP application and using the gettext module to translate to different languages.</p> <p>The code is working as I expect on my local computer (Windows running WAMP), but i can't make it work on the server (Unix + apache2)</p> <pre><code>{ $locale_folder = dirname(dirname(dirname(__FILE__))).'/locale/'; $locale = 'he_IL'; $domain = 'myapp'; $autoreload = true; // activate the locale setting setlocale(LC_ALL, $locale); setlocale(LC_TIME, $locale); putenv("LANG=$locale"); putenv("LANGUAGE=$locale"); putenv("LC_ALL=$locale"); putenv("LC_MESSAGES=$locale"); if ($autoreload) { // path to the .MO file that we should monitor $filename = "$locale_folder/$locale/LC_MESSAGES/$domain.mo"; $mtime = filemtime($filename); // check its modification time // our new unique .MO file $filename_new = "$locale_folder/$locale/LC_MESSAGES/{$domain}_{$mtime}.mo"; if (!file_exists($filename_new)) { // check if we have created it before // if not, create it now, by copying the original copy($filename,$filename_new); } // compute the new domain name $domain_new = "{$domain}_{$mtime}"; } else { $domain_new = $domain; } // bind it bindtextdomain($domain_new,$locale_folder); // then activate it textdomain($domain_new); bind_textdomain_codeset($domain_new, "UTF-8"); } </code></pre> <p>I had run "sudo locale-get he_IL" and "sudo locale-get he_IL.UTF-8" previously to install the language component.</p> <p>The translation is working on the local (Windows) computer but displays the original strings (not translated) on the server...</p> <p>Do I have to configure anything else?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload