bobbingwide / oik-i18n

Internationalization for the oik suite of plugins
GNU General Public License v2.0
0 stars 0 forks source link

Support PHP 8.0, PHP 8.1 and PHP 8.2 #12

Open bobbingwide opened 3 years ago

bobbingwide commented 3 years ago

When running l10n oik-bwtrace under PHP 8 I got a load of messages then a Fatal error.

Warning: PO::export_entry(): Argument #1 ($entry) must be passed by reference, value given in C:\apache\htdocs\wordpress\wp-content\plugins\oik-i18n\pomo\po.php on line 55

Fatal error: Declaration of Translator_bb_BB::translate_string($string) must be compatible with Translator::translate_string($string, $msgctxt, $translators_note, $cloud_translate = false) in C:\apache\htdocs\wordpress\wp-content\plugins\oik-i18n\class-translator-bb_BB.php on line 20

WIth PHP 7.4 this used to be a Warning level message. I hadn't seen it before trying PHP 8!

These problems need to be fixed.

After fixing the first problem I noticed

Deprecated: Required parameter $component_path follows optional parameter $locale in C:\apache\htdocs\wordpress\wp-content\plugins\oik-i18n\l10n.php on line 383

And later I got another problem for the en_GB version. Fatal error: Declaration of Translator_en_GB::translate_string($string, $msgctxt, $translators_note) must be compatible with Translator::translate_string($string, $msgctxt, $translators_note, $cloud_translate = false) in C:\apache\htdocs\wordpress\wp-content\plugins\oik-i18n\class-translator-en_GB.php on line 22

Workaround: Switch back to PHP 7.4

bobbingwide commented 10 months ago

As with many other plugins

Update code to run without problems in PHP 8.1 and 8.2

See https://github.com/bobbingwide/bobbingwide/issues/103

bobbingwide commented 1 week ago

Running l10n recently with PHP 8.3 I once again noticed a few Deprecated messages that could be fixed for PHP 8.3 There's no real need to specifically test with PHP 8.0, 8.1 or 8.2 any more.

Do we still need to run makeoik or can we switch to running the wp cli Internationalisation code as used by wp-scripts? I think this should be a separate issue.