Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

[Refactor] Language switcher button has hardcoded and disallowed attributes #683

Closed
danny-englander opened this issue Mar 2, 2023 · 4 comments
Assignees
Labels

Comments

@danny-englander
Copy link
Contributor

danny-englander commented Mar 2, 2023

User Story

As a developer, I need to fix the new header language switcher.

Description

In the multi-life event of the application, the Language switcher button in the new header uses attributes that are not allowed and in addition they are hard coded as well. main...579-nav-changes#diff-83e8a3432a09a97279997b583856e373eb1dda6f55f6e7a532b7541cc6a79b31R33-R42

Here we see that hreflang is used both on the <li> and <button> tags. hreflang is only allowed on an anchor tag, e.g.

<a href="/es" hreflang="es">

Proposed solution

Since beta.usa.gov uses an anchor tag for the language switcher, we should refactor this and do the same. We should also make the hreflang attribute dynamic and not hardcoded as it is now.

@danny-englander danny-englander self-assigned this Mar 2, 2023
@danny-englander danny-englander changed the title Language switcher button has hardcoded and disallowed attributes [Refactor] Language switcher button has hardcoded and disallowed attributes Mar 2, 2023
danny-englander added a commit that referenced this issue Mar 6, 2023
danny-englander added a commit that referenced this issue Mar 6, 2023
danny-englander added a commit that referenced this issue Mar 6, 2023
@danny-englander
Copy link
Contributor Author

danny-englander commented Mar 10, 2023

@nehemiah-abuga Ready for testing

@nehemiah-abuga
Copy link
Contributor

@danny-englander - On localhost:3000, When I switch languages to Spanish and inspect, href does NOT lead to /en. It has / without "en" value href="/"

@danny-englander
Copy link
Contributor Author

@nehemiah-abuga Thanks for flagging this, my bad, /en is never in the url. I have updated the instructions above. Thank you!

@danny-englander danny-englander removed their assignment Mar 20, 2023
@nehemiah-abuga
Copy link
Contributor

I have validated this change and it looks good!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants