Page MenuHomePhabricator

Move page view language detection logic / functions out of LanguageConverter class and stop using global state
Open, Needs TriagePublic

Description

Move page view language detection logic out of LanguageConverter class

Currently, the page view language detection logic were inside the LanguageConverter class.

This was caused by the ZhConverter was initially written as an extension.

We should make them parser options and move the detection logic out of language converter.

  • LanguageConverter::getPreferredVariant should be deprecated and be replaced
  • LanguageConverter::getURLVariant should be deprecated and be replaced
  • LanguageConverter::getUserVariant should be deprecated and be replaced
  • LanguageConverter::getHeaderVariant should be deprecated and be replaced
  • LanguageConverter::autoConvert should be deprecated and replaced with LanguageConverter::autoConvertTo
  • LanguageConverter::convert should be deprecated and replaced with LanguageConverter::convertTo
  • LanguageConverter::getExtraHashOptions should be deprecated and replaced

Event Timeline

MSantos subscribed.

We will track the parent task in the main boards and move this to the feature request column, please let me know if I'm missing anything else.

I'm not sure exactly what you mean here. Could you explain further? The parent task seems to be much more concrete.

I vaguely recall we had a conversation (probably in gerrit, on a different patch?) about the concept of "page view language" and I think there were some issues there, but I don't recall precisely what/where that discussion was.

Can this bug be resolved as a duplicate of its parent?

Winston_Sung renamed this task from Move page view language detection logic / functions out of LanguageConverter class to Move page view language detection logic / functions out of LanguageConverter class and stop using global state.Sep 29 2023, 3:28 AM
Winston_Sung updated the task description. (Show Details)

(MediaWiki-Platform-Team has been doing related work recently in the subtasks, so we should consider whether we want to do this too, even if we may not end up working on it)