Closed paulgevers closed 1 year ago
With the $i18n_log
set, I get the following log:
get_language_file(".mo", "/locales/LC_MESSAGES/", "/usr/share/cacti/site"): Yes - "/usr/share/cacti/site/locales/LC_MESSAGES/nl-NL.mo"
get_language_file(".js", "jquery-ui-datepicker-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-datepicker-nl-NL.js"
get_language_file(".js", "jquery-ui-datepicker-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-datepicker-nl.js"
get_language_file(".js", "jquery-ui-timepicker-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-timepicker-nl-NL.js"
get_language_file(".js", "jquery-ui-timepicker-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-timepicker-nl.js"
get_language_file(".js", "jquery-ui-colorpicker-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-colorpicker-nl-NL.js"
get_language_file(".js", "jquery-ui-colorpicker-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-colorpicker-nl.js"
get_language_file(".js", "jquery-ui-multiselect-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-multiselect-nl-NL.js"
get_language_file(".js", "jquery-ui-multiselect-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-multiselect-nl.js"
get_language_file(".js", "jquery-ui-multiselect-filter-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-multiselect-filter-nl-NL.js"
get_language_file(".js", "jquery-ui-multiselect-filter-", "/usr/share/cacti/site/include"): No - "/usr/share/cacti/site/includejquery-ui-multiselect-filter-nl.js"
Attempt to find the handler
require(1): Defined handler 0
get_src_language_provider(null) : 1 - No - /usr/share/cacti/site/include/vendor/phpgettext/streams.php
get_src_language_provider(null) : 3 - No - /usr/share/cacti/site/include/vendor/MoTranslator/Translator.php
get_src_language_provider(null) : 3 - No - /usr/share/cacti/site/include/vendor/motranslator/Translator.php
get_src_language_provider(null) : 3 - Yes - /usr/share/cacti/site/include/vendor/motranslator/src/Translator.php
get_src_language_provider(null) : 3 - Selecting with 1 paths
require(1): Selected handler 3
require(1): Requiring /usr/share/cacti/site/include/vendor/motranslator/src/Translator.php
require(1): Requiring /usr/share/cacti/site/include/vendor/motranslator/src/StringReader.php
require(2): Final handler 3
load_language(cacti): /usr/share/cacti/site/locales/LC_MESSAGES/nl-NL.mo
load_gettext_mostranslator(cacti): /usr/share/cacti/site/locales/LC_MESSAGES/nl-NL.mo
Those logs look good. I'm going to commit the patch we have, and then if we need to adjust that, there'll be a follow-up commit.
There does seem to be a problem with the javascript includes though... need to check that.
Hi @paulgevers,
Unfortunately, I don't have those packages. My system works with the current MoTranslator.
Can you possibly zip up the /usr/share/php
folder to send over those packages installed for me? I can then replace my local version and see what's going on (after backing mine up first of course!). Otherwise, I'd need a bullseye system to properly test on.
One thing you could try and do is replace the use of Translator.php and StreamReader.php with autoload.php alone. That may make things work properly.
https://packages.debian.org/sid/all/php-phpmyadmin-motranslator/download has links to the Debian packages that you can use to get the files (obviously in a tiny bit weird container, but alas). Let me know if that works for you.
And replacing
'files' => ['Translator.php', 'StringReader.php' ],
with
'files' => ['autoload.php' ],
seems to work.
OK, so I think we will update with that and I will test if with works with the current environment, since I have that installed.
By the way (maybe worth a different report) after switching the language in the settings, you need to clear your session cookie to make it active.
Yes, please create a separate issue for that. I thought that had been handled previously though.
Describe the bug
This is a follow up of issue #5147. With the patch train provided by @netniV on top of the #5147 commits, the error message is still the same. I verified that /usr/share/php is in the include_path according to the cacti viewtech phpinfo page (although I couldn't find where it set).
In Debian, the version in stable (
bullseye
) seems to work as expected. Thephp-phpmyadmin-motranslator
package has changed sincebullseye
, the caching is new.Although I believe this is a problem that mostly lies with Debian, I'm glad with the help offered by @netniV. I hope we can improve the code to help debugging, even if I need to fix the issue in the end in Debian.