There is a php code in the / var / www / html / folder:
// Задаем текущий язык проекта putenv("LANG=ru_RU"); // Задаем текущую локаль (кодировку) setlocale (LC_ALL, "Russian"); // Указываем имя домена $domain = 'flowchart'; // Задаем каталог домена, где содержатся переводы bindtextdomain('flowchart', "/var/www/html/admin/modules/flowchart/i18n"); // Выбираем домен для работы textdomain('flowchart'); echo gettext('test'); and valid localization files in / var / www / html / admin / modules / flowchart / i18n This example displays "test" though:
msgid "test" msgstr "тест" But I copied the / var / www / html / admin / modules / flowchart / i18n folder into the / var / www / html / folder and changed the bindtextdomain ('flowchart', "/ var / www / html / admin / modules / flowchart / i18n ") on bindtextdomain ('flowchart'," ./i18n ") then it all started and issued a" test ".
echo file_get_contents('/var/www/html/admin/modules/flowchart/i18n/ru_RU/LC_MESSAGES/flowchart.mo'); correctly displays the contents of the file
What could be the problem? I tried everything again: I put chmod 7777 everywhere, rewritten the directory and recompiled the .mo file, tried different variations of the localization call, etc.
There is only one result: from the root it works, but from the position it does not.
/var/www/html/admin/modules/flowchart/i18n/ru_RU/LC_MESSAGES/and you point to/var/www/html/admin/modules/flowchart/i18nin the function. - Naumov