DEV Community

Discussion on: NextJS add lang attribute to HTML tag

Collapse
 
dailydevtips1 profile image
Chris Bongers

Hi Max,

I haven't gotten that far in to tell you in detail, but perhaps @inhuofficial or @abbeyperini can shed some light on this?

Collapse
 
abbeyperini profile image
Abbey Perini

Hey! I haven't built a language select, only written some i18next code, but there are some good resources out there:

Looks like one of the main gotchas is you should only use flags if you're having the user select countries - many languages are spoken in multiple countries and many countries have multiple languages spoken within their borders. Otherwise, making the component accessible depends on the HTML element you choose to use.

Thread Thread
 
maxfindel profile image
Max F. Findel

Oh wow, thanks for all the resources! I'm gonna look into i18next ๐Ÿ‘
I totally agree with the flags vs languages. I prefer to use the ISO abbreviations :)