To translate my PHP application, I use the compiled gettext module. Here is the translation directory tree made in accordance with the documents:
locale/
cs_CZ/
LC_MESSAGES/
messages.po
messages.mo
de_DE/
LC_MESSAGES/
messages.po
messages.mo
fr_FR/
LC_MESSAGES/
messages.po
messages.mo
Question : is it possible to get rid of the LC_MESSAGES directory? Can PHP find translations if I use this structure?
locale/
cs_CZ/
messages.po
messages.mo
de_DE/
messages.po
messages.mo
fr_FR/
messages.po
messages.mo
My php that switches translations:
<?php
setlocale(LC_ALL, 'fr_FR.UTF-8');
bindtextdomain("messages", "locale");
bind_textdomain_codeset("messages", 'UTF-8');
textdomain("messages");
?>
Thanks in advance.
source
share