Page MenuHomePhabricator

Use global LanguageConverterFactory as MediawikiService:: instead for injecting it via DI in Language class
Open, HighPublic1 Estimated Story Points

Description

Story

When I use deprecated functions related to LanguageConverter in the Language class,
I want to use global access to LanguageConverterFactory via MediawikiServices::getInstance(),
to avoid unwanted cycle dependency between Language and LanguageConverterFactory.

Context

At the moment Language::getConverter provides access to the converter using LanguageConverterFactory injected by DI.

public function getConverter() : ILanguageConverter {
	return $this->converterFactory->getLanguageConverter( $this );
}
Expected Result
  • access to factory should be implemented via MediawikiServices::getInstance()->getLanguageConverterFactory
  • converterFactory should be removed
  • cyclic dependency should be avoided
  • LanguageConverterFactory should access $defaultLanguage as value, not closure

Event Timeline

Peter.ovchyn claimed this task.
Peter.ovchyn set the point value for this task to 1.
Peter.ovchyn updated the task description. (Show Details)
Peter.ovchyn updated the task description. (Show Details)
Peter.ovchyn updated the task description. (Show Details)

Change 604026 had a related patch set uploaded (by Art.tsymbar; owner: arttsymbar):
[mediawiki/core@master] component: Language

https://gerrit.wikimedia.org/r/604026

Umherirrender renamed this task from Use global LanguageConverterFacory as MediawikiService:: instead for injecting it via DI in Language class to Use global LanguageConverterFactory as MediawikiService:: instead for injecting it via DI in Language class.Dec 27 2022, 1:10 PM
Umherirrender updated the task description. (Show Details)
Aklapper added a subscriber: roman-stolar.

@roman-stolar: Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on October 11th.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!