I18n: fix locles JS file path in compile_messages CLI command

This commit is contained in:
Benjamin Renard 2023-02-13 02:48:37 +01:00
parent 799554951b
commit 5bd930c838
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -531,7 +531,7 @@ class I18n {
Log :: debug(_("Lang alias symlink found: %s -> %s"), $lang, $real_lang_dir);
// Create JSON catalog symlink (if not exists)
$js_link = App :: root_directory_path()."/public_html/translations/$lang.js";
$js_link = self :: $root_path."/$lang.js";
$link_target = "$real_lang_dir.js";
if (!file_exists($js_link)) {
if (symlink($link_target, $js_link)) {
@ -593,7 +593,7 @@ class I18n {
// Compile messages from PO file to JSON catalog file
$json_catalog = self :: po2json($lang, $po_file);
$js_file = App :: root_directory_path()."/public_html/translations/$lang.js";
$js_file = self :: $root_path."/$lang.js";
if(!$fd = fopen($js_file, 'w')) {
Log :: error(_("Fail to open %s JSON catalog file in write mode (%s)."),
$lang, $js_file);