diff --git a/packages/@vuepress/theme-default/__tests__/components/DropdownLink.spec.js b/packages/@vuepress/theme-default/__tests__/components/DropdownLink.spec.js
index e955194fc5..0fe661b830 100644
--- a/packages/@vuepress/theme-default/__tests__/components/DropdownLink.spec.js
+++ b/packages/@vuepress/theme-default/__tests__/components/DropdownLink.spec.js
@@ -5,7 +5,8 @@ import { createLocalVue } from '@vuepress/test-utils/client'
describe('DropdownLink', () => {
test('renders dropdown link.', () => {
const item = {
- text: 'VuePress',
+ text: 'Learn More',
+ ariaLabel: 'Learn More Select',
items: [
{
text: 'Guide',
diff --git a/packages/@vuepress/theme-default/__tests__/components/__snapshots__/DropdownLink.spec.js.snap b/packages/@vuepress/theme-default/__tests__/components/__snapshots__/DropdownLink.spec.js.snap
index 0b060a942e..967442ec11 100644
--- a/packages/@vuepress/theme-default/__tests__/components/__snapshots__/DropdownLink.spec.js.snap
+++ b/packages/@vuepress/theme-default/__tests__/components/__snapshots__/DropdownLink.spec.js.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DropdownLink renders dropdown link. 1`] = `
-
VuePress
+
-
Guide
diff --git a/packages/@vuepress/theme-default/components/DropdownLink.vue b/packages/@vuepress/theme-default/components/DropdownLink.vue
index 0d360830ee..dceb173d8b 100644
--- a/packages/@vuepress/theme-default/components/DropdownLink.vue
+++ b/packages/@vuepress/theme-default/components/DropdownLink.vue
@@ -3,8 +3,10 @@
class="dropdown-wrapper"
:class="{ open }"
>
-
{{ item.text }}
@@ -12,7 +14,7 @@
class="arrow"
:class="open ? 'down' : 'right'"
>
-
+
@@ -52,6 +61,7 @@
diff --git a/packages/@vuepress/theme-default/components/NavLinks.vue b/packages/@vuepress/theme-default/components/NavLinks.vue
index 3174b82c1c..9c2ef18902 100644
--- a/packages/@vuepress/theme-default/components/NavLinks.vue
+++ b/packages/@vuepress/theme-default/components/NavLinks.vue
@@ -54,6 +54,7 @@ export default {
const themeLocales = this.$site.themeConfig.locales || {}
const languageDropdown = {
text: this.$themeLocaleConfig.selectText || 'Languages',
+ ariaLabel: this.$themeLocaleConfig.ariaLabel || 'Select language',
items: Object.keys(locales).map(path => {
const locale = locales[path]
const text = themeLocales[path] && themeLocales[path].label || locale.lang
diff --git a/packages/docs/docs/.vuepress/config.js b/packages/docs/docs/.vuepress/config.js
index 63158b8e30..e908fb17da 100755
--- a/packages/docs/docs/.vuepress/config.js
+++ b/packages/docs/docs/.vuepress/config.js
@@ -39,6 +39,7 @@ module.exports = ctx => ({
'/': {
label: 'English',
selectText: 'Languages',
+ ariaLabel: 'Select language',
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated',
nav: require('./nav/en'),
@@ -52,6 +53,7 @@ module.exports = ctx => ({
'/zh/': {
label: '简体中文',
selectText: '选择语言',
+ ariaLabel: "选择语言",
editLinkText: '在 GitHub 上编辑此页',
lastUpdated: '上次更新',
nav: require('./nav/zh'),
diff --git a/packages/docs/docs/.vuepress/nav/en.js b/packages/docs/docs/.vuepress/nav/en.js
index 9952fb4cd7..0564ff9db0 100644
--- a/packages/docs/docs/.vuepress/nav/en.js
+++ b/packages/docs/docs/.vuepress/nav/en.js
@@ -17,6 +17,7 @@ module.exports = [
},
{
text: "Learn More",
+ ariaLabel: "Learn More",
items: [
{
text: "API",
diff --git a/packages/docs/docs/.vuepress/nav/zh.js b/packages/docs/docs/.vuepress/nav/zh.js
index 6ec03ad7c6..1dbf9f0587 100644
--- a/packages/docs/docs/.vuepress/nav/zh.js
+++ b/packages/docs/docs/.vuepress/nav/zh.js
@@ -17,6 +17,7 @@ module.exports = [
},
{
text: "了解更多",
+ ariaLabel: "了解更多",
items: [
{
text: "API",
diff --git a/packages/docs/docs/guide/i18n.md b/packages/docs/docs/guide/i18n.md
index 12dc65465b..b3eccb7774 100644
--- a/packages/docs/docs/guide/i18n.md
+++ b/packages/docs/docs/guide/i18n.md
@@ -54,6 +54,8 @@ module.exports = {
selectText: 'Languages',
// label for this locale in the language dropdown
label: 'English',
+ // Aria Label for locale in the dropdown
+ ariaLabel: 'Languages'
// text for the edit-on-github link
editLinkText: 'Edit this page on GitHub',
// config for Service Worker
@@ -66,7 +68,7 @@ module.exports = {
// algolia docsearch options for current locale
algolia: {},
nav: [
- { text: 'Nested', link: '/nested/' }
+ { text: 'Nested', link: '/nested/' , ariaLabel: 'Nested' }
],
sidebar: {
'/': [/* ... */],
diff --git a/packages/docs/docs/theme/default-theme-config.md b/packages/docs/docs/theme/default-theme-config.md
index 7da053b361..6fbfb3cd50 100644
--- a/packages/docs/docs/theme/default-theme-config.md
+++ b/packages/docs/docs/theme/default-theme-config.md
@@ -48,7 +48,7 @@ module.exports = {
nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide/' },
- { text: 'External', link: 'https://google.com' },
+ { text: 'External', link: 'https://google.com' }
]
}
}
@@ -62,6 +62,7 @@ module.exports = {
nav: [
{
text: 'Languages',
+ ariaLabel: 'Language Menu',
items: [
{ text: 'Chinese', link: '/language/chinese/' },
{ text: 'Japanese', link: '/language/japanese/' }
diff --git a/packages/docs/docs/zh/guide/i18n.md b/packages/docs/docs/zh/guide/i18n.md
index 9c1e44407d..5be0f9817d 100644
--- a/packages/docs/docs/zh/guide/i18n.md
+++ b/packages/docs/docs/zh/guide/i18n.md
@@ -52,6 +52,7 @@ module.exports = {
'/': {
selectText: 'Languages',
label: 'English',
+ ariaLabel: 'Languages'
editLinkText: 'Edit this page on GitHub',
serviceWorker: {
updatePopup: {
@@ -61,7 +62,7 @@ module.exports = {
},
algolia: {},
nav: [
- { text: 'Nested', link: '/nested/' }
+ { text: 'Nested', link: '/nested/', ariaLabel: 'Nested' }
],
sidebar: {
'/': [/* ... */],
diff --git a/packages/docs/docs/zh/theme/default-theme-config.md b/packages/docs/docs/zh/theme/default-theme-config.md
index 843079e01d..e32433bceb 100644
--- a/packages/docs/docs/zh/theme/default-theme-config.md
+++ b/packages/docs/docs/zh/theme/default-theme-config.md
@@ -58,6 +58,7 @@ module.exports = {
nav: [
{
text: 'Languages',
+ ariaLabel: 'Language Menu',
items: [
{ text: 'Chinese', link: '/language/chinese/' },
{ text: 'Japanese', link: '/language/japanese/' }