plugin_weathermap icon indicating copy to clipboard operation
plugin_weathermap copied to clipboard

Weathermap 1.3 - php fatal error with internationalization

Open nbz6 opened this issue 1 year ago • 7 comments

I updated cacti 1.2.26 to 1.2.27 without issue. But when I updated weathermap 1.2 to 1.3, cacti no longer loads, a blank page.

php error log : [Wed May 15 12:54:49.309540 2024] [php7:error] [pid 533313] [client x.x.x.x:56625] PHP Fatal error: Uncaught InvalidArgumentException: '/appli/cacti/plugins/weathermap/locales/LC_MESSAGES/fr-FR.mo' is not a readable file in /appli/cacti/include/vendor/gettext/src/Extractors/Extractor.php:41\nStack trace:\n#0 /appli/cacti/include/vendor/gettext/src/Extractors/Extractor.php(16): Gettext\\Extractors\\Extractor::getFiles()\n#1 [internal function]: Gettext\\Extractors\\Extractor::fromFile()\n#2 /appli/cacti/include/vendor/gettext/src/Translations.php(174): call_user_func()\n#3 [internal function]: Gettext\\Translations->__call()\n#4 /appli/cacti/include/vendor/gettext/src/Translations.php(153): call_user_func_array()\n#5 /appli/cacti/include/global_languages.php(411): Gettext\\Translations::__callStatic()\n#6 /appli/cacti/include/global_languages.php(198): load_gettext_oscarotero()\n#7 /appli/cacti/include/global.php(545): include_once('/appli/cacti-pr...')\n#8 /appli/cacti/include/auth.php(27): require_once('/appli/cacti-pr...')\n#9 /appli/cacti/index.php(25): include('/appli/ca in /appli/cacti/include/vendor/gettext/src/Extractors/Extractor.php on line 41

So I renamed the plugins/weathermap/locales/LC_MESSAGES/fr-FR.mo file to be able load Cacti. I haven't tried with others languages. PHP 7.4

nbz6 avatar May 15 '24 17:05 nbz6

I meant update weathermap.

TheWitness avatar May 15 '24 21:05 TheWitness

Can you go into the locales directory and run the build_gettext.sh script?

TheWitness avatar May 15 '24 21:05 TheWitness

No feedback.

TheWitness avatar Jul 20 '24 14:07 TheWitness

Sorry, I'll try to do this next week at work. I didn't want to run this on our production environment but I didn't have time to create another environment to test yet.

Also I noticed a problem with the French translation on Cacti 1.2.27, some action links do nothing with the "French" language but work with the "English" language. I will open another ticket on the Cacti side next week too.

nbz6 avatar Jul 20 '24 14:07 nbz6

Yea, the French issues is known. The solution is to run the build_gettext.sh script in the locales folder.

TheWitness avatar Jul 20 '24 16:07 TheWitness

You may have to pull a fresh locales directory from the 1.2.x branch and then run it. My memory is failing me.

TheWitness avatar Jul 20 '24 16:07 TheWitness

I've also done the i18n, most of it anyway in the latest develop. Check it out and provide feedback.

TheWitness avatar Jul 21 '24 20:07 TheWitness

No feedback.

TheWitness avatar Jun 23 '25 12:06 TheWitness