Refactor: html-userlangattributes -> html-user-language-attributes

This matches the name in core and is needed in preparation for
switching to SkinMustache

Additional change:
The JS variable htmluserlangattributes is renamed
"htmlUserLanguageAttributes"

Change-Id: I306ebb615f720852fb35c25ac240d6b802d05ecc
This commit is contained in:
jdlrobson 2020-07-14 14:40:28 -07:00
parent ba8ec2f842
commit 39a333452b
15 changed files with 35 additions and 35 deletions

View File

@ -119,7 +119,7 @@ class SkinVector extends SkinTemplate {
wfReportTime( $out->getCSP()->getNonce() )
] ) . '</body></html>',
'html-site-notice' => $this->getSiteNotice(),
'html-userlangattributes' => $this->prepareUserLanguageAttributes(),
'html-user-language-attributes' => $this->prepareUserLanguageAttributes(),
'html-subtitle' => $this->prepareSubtitle(),
// Always returns string, cast to null if empty.
'html-undelete-link' => $this->prepareUndeleteLink() ?: null,

View File

@ -10,13 +10,13 @@
@prop footerItem[] array-items
string html-hook-vector-before-footer output of VectorBeforeFooter hook
string|null html-userlangattributes a string of attribute HTML
string|null html-user-language-attributes a string of attribute HTML
footerRow[] array-footer-rows iterable list of footer rows
}}
{{{html-hook-vector-before-footer}}}
{{! `role` is unnecessary but kept to support selectors in any gadgets or user styles and
to mitigate a VoiceOver bug. }}
<footer id="footer" class="mw-footer" role="contentinfo" {{{html-userlangattributes}}}>
<footer id="footer" class="mw-footer" role="contentinfo" {{{html-user-language-attributes}}}>
{{#array-footer-rows}}
<ul id="{{id}}" {{#className}}class="{{.}}"{{/className}}>
{{#array-items}}

View File

@ -4,7 +4,7 @@
{{! `role` is unnecessary but kept to support selectors in any gadgets or user styles. }}
<!-- Please do not use role attribute as CSS selector, it is deprecated. -->
<nav id="{{id}}" {{#class}}class="{{.}}"{{/class}} aria-labelledby="{{label-id}}" role="navigation" {{{html-tooltip}}}
{{{html-userlangattributes}}}>
{{{html-user-language-attributes}}}>
{{#is-dropdown}}
<input type="checkbox" class="vector-menu-checkbox vectorMenuCheckbox" aria-labelledby="{{label-id}}" />
{{/is-dropdown}}

View File

@ -2,7 +2,7 @@
See @typedef SearchData
}}
<div id="p-search" role="search">
<h3 {{{html-userlangattributes}}}>
<h3 {{{html-user-language-attributes}}}>
<label for="searchInput">{{msg-search}}</label>
</h3>
<form action="{{form-action}}" id="searchform">

View File

@ -41,7 +41,7 @@
<h1 id="firstHeading" class="firstHeading" lang="{{page-langcode}}">{{{html-title}}}</h1>
<div id="bodyContent" class="mw-body-content">
{{#page-isarticle}}<div id="siteSub" class="noprint">{{msg-tagline}}</div>{{/page-isarticle}}
<div id="contentSub"{{{html-userlangattributes}}}>{{{html-subtitle}}}</div>
<div id="contentSub"{{{html-user-language-attributes}}}>{{{html-subtitle}}}</div>
<div id="contentSub2">{{{html-undelete-link}}}</div>
{{{html-newtalk}}}
{{!

View File

@ -59,7 +59,7 @@
<h1 id="firstHeading" class="firstHeading" lang="{{page-langcode}}">{{{html-title}}}</h1>
<div id="bodyContent" class="mw-body-content">
{{#page-isarticle}}<div id="siteSub" class="noprint">{{msg-tagline}}</div>{{/page-isarticle}}
<div id="contentSub"{{{html-userlangattributes}}}>{{{html-subtitle}}}</div>
<div id="contentSub"{{{html-user-language-attributes}}}>{{{html-subtitle}}}</div>
<div id="contentSub2">{{{html-undelete-link}}}</div>
{{{html-newtalk}}}
{{!

View File

@ -1,6 +1,6 @@
/* eslint-disable quotes */
import { htmluserlangattributes, placeholder } from './utils';
import { htmlUserLanguageAttributes, placeholder } from './utils';
import footerTemplate from '!!raw-loader!../includes/templates/Footer.mustache';
const FOOTER_ROWS = [
@ -74,7 +74,7 @@ additional terms may apply. See <a href="https://foundation.wikimedia.org/wiki/S
export { footerTemplate };
export const FOOTER_TEMPLATE_DATA = {
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-hook-vector-before-footer': placeholder( 'output of VectorBeforeFooter hook (deprecated 1.35)', 20 ),
'array-footer-rows': FOOTER_ROWS
};

View File

@ -5,7 +5,7 @@
/* eslint-disable quotes */
import menuTemplate from '!!raw-loader!../includes/templates/Menu.mustache';
import { htmluserlangattributes } from './utils';
import { htmlUserLanguageAttributes } from './utils';
/**
* @type {MenuDefinition}
@ -16,7 +16,7 @@ const loggedOut = {
'list-classes': 'vector-menu-content-list',
'label-id': 'p-personal-label',
label: 'Personal tools',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `<li id="pt-anonuserpage">Not logged in</li><li id="pt-anontalk"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [⌃⌥n]" accesskey="n">Talk</a></li><li id="pt-anoncontribs"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [⌃⌥y]" accesskey="y">Contributions</a></li><li id="pt-createaccount"><a href="/w/index.php?title=Special:CreateAccount&amp;returnto=Main+Page" title="You are encouraged to create an account and log in; however, it is not mandatory">Create account</a></li><li id="pt-login"><a href="/w/index.php?title=Special:UserLogin&amp;returnto=Main+Page" title="You're encouraged to log in; however, it's not mandatory. [⌃⌥o]" accesskey="o">Log in</a></li>`
};
@ -29,7 +29,7 @@ const loggedInWithEcho = {
'list-classes': 'vector-menu-content-list',
'label-id': 'p-personal-label',
label: 'Personal tools',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `<li id="pt-userpage"><a href="/wiki/User:Jdlrobson" dir="auto" title="Your user page [⌃⌥.]" accesskey=".">Jdlrobson</a></li><li id="pt-notifications-alert"><a href="/wiki/Special:Notifications" class="mw-echo-notifications-badge mw-echo-notification-badge-nojs oo-ui-icon-bell mw-echo-notifications-badge-all-read" data-counter-num="0" data-counter-text="0" title="Your alerts">Alerts (0)</a></li><li id="pt-notifications-notice"><a href="/wiki/Special:Notifications" class="mw-echo-notifications-badge mw-echo-notification-badge-nojs oo-ui-icon-tray" data-counter-num="3" data-counter-text="3" title="Your notices">Notices (3)</a></li><li id="pt-mytalk"><a href="/wiki/User_talk:Jdlrobson" title="Your talk page [⌃⌥n]" accesskey="n">Talk</a></li><li id="pt-sandbox"><a href="/wiki/User:Jdlrobson/sandbox" title="Your sandbox">Sandbox</a></li><li id="pt-preferences"><a href="/wiki/Special:Preferences" title="Your preferences">Preferences</a></li><li id="pt-betafeatures"><a href="/wiki/Special:Preferences#mw-prefsection-betafeatures" title="Beta features">Beta</a></li><li id="pt-watchlist"><a href="/wiki/Special:Watchlist" title="A list of pages you are monitoring for changes [⌃⌥l]" accesskey="l">Watchlist</a></li><li id="pt-mycontris"><a href="/wiki/Special:Contributions/Jdlrobson" title="A list of your contributions [⌃⌥y]" accesskey="y">Contributions</a></li><li id="pt-logout"><a href="/w/index.php?title=Special:UserLogout&amp;returnto=Main+Page&amp;returntoquery=useskin%3Dvector" title="Log out">Log out</a></li>`
};
@ -44,7 +44,7 @@ const defaultMenu = {
'list-classes': 'vector-menu-content-list',
'label-id': 'p-generic-label',
label: 'Menu label',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `<li><a href='#'>Item 1</a></li>
<li><a href='#'>Item 2</a></li>
<li><a href='#'>Item 3</a></li>`
@ -59,7 +59,7 @@ const loggedInWithULS = {
'list-classes': 'vector-menu-content-list',
'label-id': 'p-personal-label',
label: 'Personal tools',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `${ULS_LANGUAGE_SELECTOR}<li id="pt-userpage"><a href="/wiki/User:Jdlrobson" dir="auto" title="Your user page [⌃⌥.]" accesskey=".">Jdlrobson</a></li><li id="pt-notifications-alert"><a href="/wiki/Special:Notifications" class="mw-echo-notifications-badge mw-echo-notification-badge-nojs oo-ui-icon-bell mw-echo-notifications-badge-all-read" data-counter-num="0" data-counter-text="0" title="Your alerts">Alerts (0)</a></li><li id="pt-notifications-notice"><a href="/wiki/Special:Notifications" class="mw-echo-notifications-badge mw-echo-notification-badge-nojs oo-ui-icon-tray" data-counter-num="3" data-counter-text="3" title="Your notices">Notices (3)</a></li><li id="pt-mytalk"><a href="/wiki/User_talk:Jdlrobson" title="Your talk page [⌃⌥n]" accesskey="n">Talk</a></li><li id="pt-sandbox"><a href="/wiki/User:Jdlrobson/sandbox" title="Your sandbox">Sandbox</a></li><li id="pt-preferences"><a href="/wiki/Special:Preferences" title="Your preferences">Preferences</a></li><li id="pt-betafeatures"><a href="/wiki/Special:Preferences#mw-prefsection-betafeatures" title="Beta features">Beta</a></li><li id="pt-watchlist"><a href="/wiki/Special:Watchlist" title="A list of pages you are monitoring for changes [⌃⌥l]" accesskey="l">Watchlist</a></li><li id="pt-mycontris"><a href="/wiki/Special:Contributions/Jdlrobson" title="A list of your contributions [⌃⌥y]" accesskey="y">Contributions</a></li><li id="pt-logout"><a href="/w/index.php?title=Special:UserLogout&amp;returnto=Main+Page&amp;returntoquery=useskin%3Dvector" title="Log out">Log out</a></li>`
};

View File

@ -3,7 +3,7 @@
*/
import vectorMenuTemplate from '!!raw-loader!../includes/templates/Menu.mustache';
import { htmluserlangattributes } from './utils';
import { htmlUserLanguageAttributes } from './utils';
export { vectorMenuTemplate };
@ -17,7 +17,7 @@ export const moreData = {
label: 'More',
id: 'p-cactions',
'label-id': 'p-cactions-label',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `<li id="ca-delete">
<a href="/w/index.php?title=Main_Page&amp;action=delete"
title="Delete this page [⌃⌥d]" accesskey="d">Delete</a>
@ -42,7 +42,7 @@ export const variantsData = {
label: '新加坡简体',
id: 'p-variants',
'label-id': 'p-variants-label',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `<li id="ca-varlang-0">
<a href="/zh/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD"
hreflang="zh" lang="zh">不转换</a></li>

View File

@ -8,7 +8,7 @@ import mustache from 'mustache';
import { vectorMenuTemplate as portalTemplate } from './MenuDropdown.stories.data';
import '../resources/skins.vector.styles/MenuPortal.less';
import '../.storybook/common.less';
import { placeholder, htmluserlangattributes } from './utils';
import { placeholder, htmlUserLanguageAttributes } from './utils';
/**
* @param {MenuDefinition} data
@ -40,7 +40,7 @@ export const PORTALS = {
'html-tooltip': 'Message tooltip-p-example acts as tooltip',
label: 'Portal title',
'label-id': 'p-example-label',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `
<li><a href='#'>A list of links</a></li>
<li><a href='#'>with ids</a></li>
@ -57,7 +57,7 @@ export const PORTALS = {
'html-tooltip': 'A message tooltip-p-navigation must exist for this to appear',
label: 'Navigation',
'label-id': 'p-navigation-label',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `
<li id="n-mainpage-description"><a href="/wiki/Main_Page" title="Visit the main page [⌃⌥z]" accesskey="z">Main page</a></li><li id="n-contents"><a href="/wiki/Wikipedia:Contents" title="Guides to browsing Wikipedia">Contents</a></li><li id="n-featuredcontent"><a href="/wiki/Wikipedia:Featured_content" title="Featured content the best of Wikipedia">Featured content</a></li><li id="n-currentevents"><a href="/wiki/Portal:Current_events" title="Find background information on current events">Current events</a></li><li id="n-randompage"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x">Random page</a></li><li id="n-sitesupport"><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_en.wikipedia.org&amp;uselang=en" title="Support us">Donate</a></li><li id="n-shoplink"><a href="//shop.wikimedia.org" title="Visit the Wikipedia store">Wikipedia store</a></li>
`,
@ -70,7 +70,7 @@ export const PORTALS = {
'html-tooltip': 'A message tooltip-p-tb must exist for this to appear',
label: 'Tools',
'label-id': 'p-tb-label',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `
<li id="t-whatlinkshere"><a href="/wiki/Special:WhatLinksHere/Spain" title="A list of all wiki pages that link here [⌃⌥j]" accesskey="j">What links here</a></li><li id="t-recentchangeslinked"><a href="/wiki/Special:RecentChangesLinked/Spain" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li><li id="t-upload"><a href="/wiki/Wikipedia:File_Upload_Wizard" title="Upload files [u]" accesskey="u">Upload file</a></li><li id="t-specialpages"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q">Special pages</a></li><li id="t-permalink"><a href="/w/index.php?title=Spain&amp;oldid=935087243" title="Permanent link to this revision of the page">Permanent link</a></li><li id="t-info"><a href="/w/index.php?title=Spain&amp;action=info" title="More information about this page">Page information</a></li><li id="t-wikibase"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q29" title="Link to connected data repository item [g]" accesskey="g">Wikidata item</a></li><li id="t-cite"><a href="/w/index.php?title=Special:CiteThisPage&amp;page=Spain&amp;id=935087243" title="Information on how to cite this page">Cite this page</a></li>
`,
@ -83,7 +83,7 @@ export const PORTALS = {
'html-tooltip': 'A message tooltip-p-lang must exist for this to appear',
label: 'In other languages',
'label-id': 'p-lang-label',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `
<li class="interlanguage-link interwiki-ace">
<a href="https://ace.wikipedia.org/wiki/Seupanyo"
@ -102,7 +102,7 @@ ${placeholder( `<p>Further hook output possible (lang)</p>`, 60 )}`
'html-tooltip': 'A message tooltip-p-wikibase-otherprojects must exist for this to appear',
label: 'In other projects',
'label-id': 'p-wikibase-otherprojects-label',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `
<li class="wb-otherproject-link wb-otherproject-commons"><a href="https://commons.wikimedia.org/wiki/Category:Spain" hreflang="en">Wikimedia Commons</a></li><li class="wb-otherproject-link wb-otherproject-wikinews"><a href="https://en.wikinews.org/wiki/Category:Spain" hreflang="en">Wikinews</a></li><li class="wb-otherproject-link wb-otherproject-wikiquote"><a href="https://en.wikiquote.org/wiki/Spain" hreflang="en">Wikiquote</a></li><li class="wb-otherproject-link wb-otherproject-wikivoyage"><a href="https://en.wikivoyage.org/wiki/Spain" hreflang="en">Wikivoyage</a></li>`,

View File

@ -2,7 +2,7 @@
* @external MenuDefinition
*/
import { htmluserlangattributes } from './utils';
import { htmlUserLanguageAttributes } from './utils';
/**
* @type {MenuDefinition}
@ -13,7 +13,7 @@ export const pageActionsData = {
'list-classes': 'vector-menu-content-list',
'label-id': 'p-views-label',
label: 'Views',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `<li id="ca-view" class="collapsible selected">
<a href="/wiki/Main_Page">Read</a>
</li>
@ -36,7 +36,7 @@ export const namespaceTabsData = {
'list-classes': 'vector-menu-content-list',
'label-id': 'p-namespaces-label',
label: 'Namespaces',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'html-items': `<li id="ca-nstab-main" class="selected"><a href="/wiki/Main_Page" title="View the content page [⌃⌥c]" accesskey="c">Main page</a></li>
<li id="ca-talk"><a href="/wiki/Talk:Main_Page" rel="discussion" title="Discussion about the content page [⌃⌥t]" accesskey="t">Talk (3)</a></li>`
};

View File

@ -3,7 +3,7 @@
*/
import searchBoxTemplate from '!!raw-loader!../includes/templates/SearchBox.mustache';
import { htmluserlangattributes } from './utils';
import { htmlUserLanguageAttributes } from './utils';
export { searchBoxTemplate };
@ -12,7 +12,7 @@ export { searchBoxTemplate };
*/
export const searchBoxData = {
'form-action': '/w/index.php',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'msg-search': 'Search',
'html-input': '<input type="search" name="search" placeholder="Search Wikipedia" title="Search Wikipedia [⌃⌥f]" accesskey="f" id="searchInput" autocomplete="off">',
'page-title': 'Special:Search',

View File

@ -4,7 +4,7 @@
* @external Indicator
*/
import { htmluserlangattributes } from './utils';
import { htmlUserLanguageAttributes } from './utils';
import { placeholder } from './utils';
import { PERSONAL_MENU_TEMPLATE_DATA, menuTemplate } from './Menu.stories.data';
@ -86,7 +86,7 @@ export const LEGACY_TEMPLATE_DATA = {
'html-title': 'Vector 2019',
'page-isarticle': true,
'msg-tagline': 'From Wikipedia, the free encyclopedia',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'msg-vector-jumptonavigation': 'Jump to navigation',
'msg-vector-jumptosearch': 'Jump to search',
@ -112,7 +112,7 @@ export const MODERN_TEMPLATE_DATA = {
'html-title': 'Vector 2020',
'page-isarticle': true,
'msg-tagline': 'From Wikipedia, the free encyclopedia',
'html-userlangattributes': htmluserlangattributes,
'html-user-language-attributes': htmlUserLanguageAttributes,
'msg-vector-jumptonavigation': 'Jump to navigation',
'msg-vector-jumptosearch': 'Jump to search',

View File

@ -40,7 +40,7 @@
/**
* @typedef {Object} SearchData
* @property {string|null} msg-search
* @property {string} [html-userlangattributes]
* @property {string} [html-user-language-attributes]
* @property {string} form-action URL
* @property {string|null} html-input
* @property {string|null} page-title the title of the search page
@ -57,7 +57,7 @@
* @property {string} [html-tooltip]
* @property {string} [class] of menu
* @property {string} list-classes of the unordered list element inside the menu
* @property {string} [html-userlangattributes]
* @property {string} [html-user-language-attributes]
* @property {boolean} [is-dropdown]
* @property {string} [html-hook-vector-after-toolbox] Deprecated and used
* by the toolbox portal menu.

View File

@ -11,6 +11,6 @@ const placeholder = ( msg, height ) => {
display: flex; background: #eee; align-items: center;justify-content: center;">${msg}</div>`;
};
const htmluserlangattributes = `dir="ltr" lang="en-GB"`;
const htmlUserLanguageAttributes = `dir="ltr" lang="en-GB"`;
export { placeholder, htmluserlangattributes };
export { placeholder, htmlUserLanguageAttributes };