Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theme-classic): use lang attribute in navbar locale dropdown items #7942

Merged
merged 2 commits into from Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -34,6 +34,7 @@ export default function LocaleDropdownNavbarItem({
})}`;
return {
label: localeConfigs[locale]!.label,
lang: localeConfigs[locale]!.htmlLang,
to,
target: '_self',
autoAddBaseUrl: false,
Expand Down
6 changes: 4 additions & 2 deletions packages/docusaurus-types/src/i18n.d.ts
Expand Up @@ -11,8 +11,10 @@ export type I18nLocaleConfig = {
/** The label displayed for this locale in the locales dropdown. */
label: string;
/**
* BCP 47 language tag to use in `<html lang="...">` and in
* `<link ... hreflang="...">`
* BCP 47 language tag to use in:
* - `<html lang="...">`
* - `<li lang="...">`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<li> or <a>, or doesn't really matter? Also need to put this into the actual docs since they are in sync.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced by

`<html lang="...">` (or any other DOM tag name)

Somehow HTML, li, a are all the case case 🤪

* - `<link ... hreflang="...">`
*/
htmlLang: string;
/** Used to select the locale's CSS and html meta attribute. */
Expand Down