Page MenuHomePhabricator

Avoid LanguageConverter from usage of Language by introducing specialised interface
Open, LowPublic


To remove the need for this, perhaps we should introduce a NamespaceNameLocalizer interface, with methods like getNamespaceName( $lang, $ns ), getFormattedNamespaceName( $lang, $ns ), and getGenderedNamespaceName( $lang, $ns ).

if ( $nsVariantText === false ) {
			// No message exists, retrieve it from the target variant's namespace names.
			$langObj = $this->mLangObj->factory( $variant );//todo: create from services
			$nsVariantText = $langObj->getFormattedNsText( $index );

		$cache->set( $key, $nsVariantText, 60 );

		return $nsVariantText;

Event Timeline

Would be nice, but I'd push taht back. LanguageConverter knowing about Language isn't a huge problem. Language knowing about LanguageConverter is a lot worse.

daniel triaged this task as Low priority.Jan 22 2020, 5:33 PM
Peter.ovchyn removed Peter.ovchyn as the assignee of this task.Feb 12 2020, 10:03 AM