Common-voice: Set html lang attribute according to language

Created on 15 Jun 2018  路  3Comments  路  Source: mozilla/common-voice

lang attribute is currently fixed to en for all languages.

<html lang="en">

This should be set according to the language used on the page. Setting it to "tr" for Turkish is specifically important because it causes capitalization errors otherwise.

help wanted

Most helpful comment

@mikehenrty I think that one's on us.

Probably best to run document.documentElement.setAttribute('lang', locale) in our locale change listener for now.

All 3 comments

@stasm, is this something that should be fixed on the fluent side?

@mikehenrty I think that one's on us.

Probably best to run document.documentElement.setAttribute('lang', locale) in our locale change listener for now.

Thanks for asking, @mikehenrty, and thanks for answering, @Gregoor :) I was away for the weekend and yesterday. I agree that it's best to fix this in the app for now and I'm happy to see how simple the fix was.

Was this page helpful?
0 / 5 - 0 ratings