Page MenuHomePhabricator

It should be possible to enable the new language button for logged in users
Closed, ResolvedPublic2 Estimated Story Points

Description

The VectorLanguageInHeader config flag allows the language to be in the header for all users or not at all. We want to expand this to support logged-in users.

Currently:

"VectorLanguageInHeader": {
                       "value": false,
                       "description": "@var boolean Moves the language links from the sidebar into a menu beside the page title. Also moves the indicators to the line below, next to the tagline (siteSub)."
               },

Proposed - we will follow the example inside MobileFrontend and allow feature flags to be configurable for logged in users as well as all users:

"VectorLanguageInHeader": {
                       "value": { "stable": false, "loggedin": true },
                       "description": "@var boolean Moves the language links from the sidebar into a menu beside the page title. Also moves the indicators to the line below, next to the tagline (siteSub)."
               },

Acceptance criteria

  • It should be possible to enable VectorLanguageInHeader for all users
  • Given VectorLanguageInHeader is currently configured to true in certain wikis, please make sure the case where the value is a boolean is handled.
  • In future all new features will be built this way. Please take time to think about what architecture changes would be needed and write up the work needed into a new task.

QA Steps

  • In a local dev environment, the new language button can be tested by adding different values to $wgVectorLanguageInHeader in LocalSettings.php i.e.
$wgVectorLanguageInHeader = true;
//$wgVectorLanguageInHeader = false;
//$wgVectorLanguageInHeader = [
//	"logged_in" => true,
//	"logged_out" => false
//];
//$wgVectorLanguageInHeader = [
//	"logged_in" => false,
//	"logged_out" => true
//];
  • Navigate to a page (with content provider enabled) in the browser to verify that the language list is either in the sidebar or in the header, for both logged in and logged out states, based on the values for $wgVectorLanguageInHeader in your LocalSettings.php. Note that when $wgVectorLanguageInHeader is a boolean value, this value will apply to both logged in and logged out states in order to accommodate legacy config.

Event Timeline

Jdlrobson set the point value for this task to 2.

we're not worried about risk here as the check is relatively simple and this should be easy to QA.

Change 677598 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/skins/Vector@master] Vector::add config for language in header for logged in users

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

Jdlrobson assigned this task to nray.
Jdlrobson added a subscriber: cjming.

Change 679613 had a related patch set uploaded (by Nray; author: Nray):

[operations/mediawiki-config@master] Add mediawiki.pref_diff stream to wgEventLoggingStreamNames/wgEventStreams

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

Change 679614 had a related patch set uploaded (by Nray; author: Nray):

[operations/mediawiki-config@master] Add $wgWMEVectorPrefDiffSalt to private/readme

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

^^ sorry for the noise, please ignore the above patches which I attached to this ticket by mistake

ovasileva added a subscriber: nray.
cjming claimed this task.

Change 677598 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Add config for language in header for logged in/out users

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

cjming updated the task description. (Show Details)

@cjming Since the beta config currently sets the wgVectorLanguageInHeader to a boolean in InitialiseSettings-labs.php (the config for Beta), I see an opportunity for a small backport to set it to use the new array format introduced in this ticket:

'wgVectorLanguageInHeader' => [
  'default' => [
    'logged_in' => true,
    'logged_out' => true
  ],
],

Perhaps you could clone the mediawiki-config repo (if needed), make this change, and we can go over backporting it together on Wednesday. I'll cc and invite @bwang to the Wednesday backport as well

Change 681456 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[operations/mediawiki-config@master] Update wgVectorLanguageInHeader variable

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

Thanks @nray - per your latest comment, https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/681456/ is ready for review in service of backporting 4/21.

Change 681456 merged by jenkins-bot:

[operations/mediawiki-config@master] Update wgVectorLanguageInHeader variable

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

@cjming / @ovasileva , I sat on this for way too long in Beta. I'm assuming since I've seen and tested the new Language button in Prod that I can consider this verified already. If so we can move it to ready for sign-off. let me know.

Edtadros added a subscriber: Edtadros.

@ovasileva given the testing for T282543, I think we can say that it can be enabled for logged in users. For logged out users I see this:

Screen Shot 2021-05-19 at 6.33.25 PM.png (1×1 px, 568 KB)

I think this is enough to move this to Ready for Sign-off. If you agree I'll all a pretty table and move it.