PHP Deprecated: Use of wfBCP47 was deprecated in MediaWiki 1.31. [Called from PageTranslationHooks::formatLanguageLink in /www/dev.translatewiki.net/docroot/w/extensions/Translate/tag/PageTranslationHooks.php at line 557] in /www/dev.translatewiki.net/docroot/w/includes/debug/MWDebug.php on line 309
@Nikerabbit - The patch above has been abandoned. I believe that since the translate extension needs to support MediaWiki - 1.29 and above, we will need to add conditionals in addition to what's done in the previous patch.
I'd like to add a method to TranslateUtils called bcp47 which will check the version of MediaWiki and then use the appropriate method. This will be important in-case the global function wfBCP47 is removed in the future version.
Version checking will be done using,
global $wgVersion; version_compare( $wgVersion, '1.31', '<' );
Minimum version of MediaWiki core that needs to be supported by MLEB extensions is now 1.31. Hence I think no versions checks are needed anymore (and if they are needed, I prefer is_callable( new method ).
I've removed the wrapper added in TranslateUtils with direct calls to LanguageCode::bcp47 since we no longer need to maintain backward compatibility with MediaWiki versions < 1.31.
To test this I performed the following actions,
- Marking a new page for translation.
- Translating the translation units.
- Running the test cases under Translate extension tests folder.
All of the above worked as expected.
I've also updated the minimum version mentioned here.