Background
As part of our explorations in increasing the visibility of the new language switching button, we would like to explore ways to link to the button from the previous location of language switching functionality.
Design
Acceptance criteria / QA
- The sidebar alert should not show on the main page
- The sidebar alert should show on pages which has a language button
- If there is no language button, do not show the sidebar alert.
- This should be feature flagged and default to false
Developer notes
Something like this should suffice:
diff --git a/includes/templates/Sidebar.mustache b/includes/templates/Sidebar.mustache index 3a916ba3e..63a3bf970 100644 --- a/includes/templates/Sidebar.mustache +++ b/includes/templates/Sidebar.mustache @@ -21,4 +21,8 @@ {{^is-language-in-header}} {{#data-portlets.data-languages}}{{>Menu}}{{/data-portlets.data-languages}} {{/is-language-in-header}} + {{#is-language-in-header}} + <h2>{{msg-languages}}</h2> + <div class="warningbox">{{msg-language-redirect-to-top}}</div> + {{/is-language-in-header}} </div>
Signoff criteria
- Create a task to remove the notice ~2 months after full rollout of the new button location - T297237
QA steps
- Navigate to an article page with the config for language button in header and note that the language switching alert notice is in the sidebar by testing with the following local config:
$wgVectorLanguageInHeader = [ "logged_in" => true, "logged_out" => true ]; $wgVectorLanguageAlertInSidebar = [ "logged_in" => true, "logged_out" => false ];
- Test different permutations of the above config:
- When VectorLanguageInHeader['logged_in"] is true:
- Alert should appear when VectorLanguageAlertInSidebar['logged_in"] is true
- When VectorLanguageInHeader['logged_in"] is true:
- No alert should appear when VectorLanguageAlertInSidebar['logged_in"] is false
- When VectorLanguageInHeader['logged_in"] is false:
- No alert should appear when VectorLanguageAlertInSidebar['logged_in"] is true or false
- When VectorLanguageInHeader['logged_out"] is true:
- Alert should appear when VectorLanguageAlertInSidebar['logged_out"] is true
- No alert should appear when VectorLanguageAlertInSidebar['logged_out"] is false
- When VectorLanguageInHeader['logged_out"] is false:
- No alert should appear when VectorLanguageAlertInSidebar['logged_out"] is true or false
- Test the query parameter ?languagealertinsidebar=1 as override to see the language alert in sidebar in the cases where VectorLanguageInHeader is true and VectorLanguageAlertInSidebar is false
- Navigate to the Main Page and note that the language switching alert notice is not shown when the config is set to show the alert.