From e84809c44b6f919275878cc2286dff7fe33cb23a Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Mon, 1 Jun 2020 12:28:51 -0700 Subject: [PATCH] Cleanup: Standardise msg keys Keys prefixed with msg- should relate to i18n keys. Fix the existing template variables where that's not the case. Change-Id: I33587a09a9803a3667eaeea95ce3e1753439f413 --- includes/VectorTemplate.php | 6 +++--- includes/templates/Sidebar.mustache | 4 ++-- includes/templates/skin-legacy.mustache | 8 ++++---- includes/templates/skin.mustache | 8 ++++---- stories/skin.stories.data.js | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/includes/VectorTemplate.php b/includes/VectorTemplate.php index 7ae366bc9..902bdef06 100644 --- a/includes/VectorTemplate.php +++ b/includes/VectorTemplate.php @@ -167,8 +167,8 @@ class VectorTemplate extends BaseTemplate { // From Skin::getNewtalks(). Always returns string, cast to null if empty. 'html-newtalk' => $skin->getNewtalks() ?: null, - 'msg-jumptonavigation' => $this->msg( 'vector-jumptonavigation' )->text(), - 'msg-jumptosearch' => $this->msg( 'vector-jumptosearch' )->text(), + 'msg-vector-jumptonavigation' => $this->msg( 'vector-jumptonavigation' )->text(), + 'msg-vector-jumptosearch' => $this->msg( 'vector-jumptosearch' )->text(), // Result of OutputPage::addHTML calls 'html-bodycontent' => $this->get( 'bodycontent' ), @@ -371,7 +371,7 @@ class VectorTemplate extends BaseTemplate { ), 'array-portals-rest' => array_slice( $props, 1 ), 'data-portals-first' => $firstPortal, - 'msg-toggle-sidebar-button-label' => $this->msg( 'vector-action-toggle-sidebar' )->text(), + 'msg-vector-action-toggle-sidebar' => $this->msg( 'vector-action-toggle-sidebar' )->text(), // [todo] fetch user preference when logged in (T246427). 'sidebar-visible' => false ]; diff --git a/includes/templates/Sidebar.mustache b/includes/templates/Sidebar.mustache index 5dc965d8e..18d038474 100644 --- a/includes/templates/Sidebar.mustache +++ b/includes/templates/Sidebar.mustache @@ -7,7 +7,7 @@ MenuDefinition data-portals-first MenuDefinition[] array-portals-rest emphasized-sidebar-action data-emphasized-sidebar-action For displaying an emphasized action in the sidebar. - string msg-toggle-sidebar-button-label The label used by the sidebar button. + string msg-vector-action-toggle-sidebar The label used by the sidebar button. boolean sidebar-visible For users that want to see the sidebar on initial render, this should be true. }} @@ -31,7 +31,7 @@ " for="mw-sidebar-checkbox" data-event-name="ui.sidebar"> - {{msg-toggle-sidebar-button-label}} + {{msg-vector-action-toggle-sidebar}}
{{#data-portals-first}}{{>Menu}}{{/data-portals-first}} diff --git a/includes/templates/skin-legacy.mustache b/includes/templates/skin-legacy.mustache index 3bd5ce530..40ab681e1 100644 --- a/includes/templates/skin-legacy.mustache +++ b/includes/templates/skin-legacy.mustache @@ -13,8 +13,8 @@ string html-subtitle string html-undelete string html-newtalk - string msg-jumptonavigation - string msg-jumptosearch + string msg-vector-jumptonavigation + string msg-vector-jumptosearch string html-bodycontent string html-printfooter string html-catlinks @@ -55,8 +55,8 @@ using this place to insert extra elements before. }}
- {{msg-jumptonavigation}} - {{msg-jumptosearch}} + {{msg-vector-jumptonavigation}} + {{msg-vector-jumptosearch}} {{{html-bodycontent}}} {{#html-printfooter}}
{{{html-printfooter}}}
diff --git a/includes/templates/skin.mustache b/includes/templates/skin.mustache index 1368458b5..427cbdf66 100644 --- a/includes/templates/skin.mustache +++ b/includes/templates/skin.mustache @@ -13,8 +13,8 @@ string html-subtitle string html-undelete string html-newtalk - string msg-jumptonavigation - string msg-jumptosearch + string msg-vector-jumptonavigation + string msg-vector-jumptosearch string html-bodycontent string html-printfooter string html-catlinks @@ -57,8 +57,8 @@ using this place to insert extra elements before. }}
- {{msg-jumptonavigation}} - {{msg-jumptosearch}} + {{msg-vector-jumptonavigation}} + {{msg-vector-jumptosearch}} {{{html-bodycontent}}} {{#html-printfooter}}
{{{html-printfooter}}}
diff --git a/stories/skin.stories.data.js b/stories/skin.stories.data.js index 45b2c5c94..883913f9a 100644 --- a/stories/skin.stories.data.js +++ b/stories/skin.stories.data.js @@ -75,8 +75,8 @@ export const LEGACY_TEMPLATE_DATA = { 'page-isarticle': true, 'msg-tagline': 'From Wikipedia, the free encyclopedia', 'html-userlangattributes': htmluserlangattributes, - 'msg-jumptonavigation': 'Jump to navigation', - 'msg-jumptosearch': 'Jump to search', + 'msg-vector-jumptonavigation': 'Jump to navigation', + 'msg-vector-jumptosearch': 'Jump to search', // site specific 'data-footer': FOOTER_TEMPLATE_DATA, @@ -99,8 +99,8 @@ export const MODERN_TEMPLATE_DATA = { 'page-isarticle': true, 'msg-tagline': 'From Wikipedia, the free encyclopedia', 'html-userlangattributes': htmluserlangattributes, - 'msg-jumptonavigation': 'Jump to navigation', - 'msg-jumptosearch': 'Jump to search', + 'msg-vector-jumptonavigation': 'Jump to navigation', + 'msg-vector-jumptosearch': 'Jump to search', // site specific 'data-footer': FOOTER_TEMPLATE_DATA,