Page MenuHomePhabricator

Replace use of wfBCP47 (deprecated since MediaWiki 1.31)
Closed, ResolvedPublic

Description

./includes/BabelLanguageCodes.php: return wfBCP47( $code );

It should use LanguageCode::bcp47() directly.
https://doc.wikimedia.org/mediawiki-core/master/php/GlobalFunctions_8php.html#a1bfb0c5998e37f1ac92ad525c57b9686
https://doc.wikimedia.org/mediawiki-core/master/php/classLanguageCode.html#a99e49e867ecba977e2a74df8b01ee19b

Check list

  • Check Support of MediaWiki 1.30 in extension.json
  • Remove Entire function bcp47 from BabelLanguageCodes.php, and use LanguageCode::bcp47( $code ) instead of self::bcp47( $code )

Related Objects

Event Timeline

@Aklapper Do you reserve this bug for any GCI student or can somebody else (me?) work on it?

@MarcoAurelio: No GCI tag on this, feel free to go ahead. Will we get a new good first task task filed from you in return? :P

@MarcoAurelio: No GCI tag on this, feel free to go ahead. Will we get a new good first task task filed from you in return? :P

Thank you. I'll give this one a try. Similarly, I'll try to add a new good first task task if I spot one in the future.

So I'm wondering whether we should remove:

	/**
	 * Get the normalised IETF language tag.
	 * @param string $code The language code.
	 * @deprecated This provides backward compatibility; replace with
	 *   \LanguageCode::bcp47() once MW 1.30 is no longer supported.
	 */
	public static function bcp47( $code ) {
		if ( !is_callable( [ 'LanguageCode', 'bcp47' ] ) ) {
			return wfBCP47( $code );
		}
		return LanguageCode::bcp47( $code );
	}

altogether or just the if ( ... from that function.

@MarcoAurelio Sir, I think we can't remove it right now. As per the function definition, It should support MW 1.30 and Currently Its master branch support MW 1.30. and also LanguageCode::bcp47() has added in MediaWiki 1.31

@Jayprakash12345 If this can't be done right now, then maybe we shall set this task as 'stalled' until we can do it. What do you think?

Jayprakash12345 changed the task status from Open to Stalled.Dec 4 2018, 2:51 AM
MarcoAurelio removed a project: User-MarcoAurelio.

Removing myself as assignee just in case I forget about this, when the removal can take place.

Nikerabbit claimed this task.