File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ class LanguageSelector extends React.Component {
1313 bindAll ( this , [
1414 'handleChange'
1515 ] ) ;
16+ document . documentElement . lang = this . props . currentLocale ;
1617 }
1718 handleChange ( e ) {
1819 const newLocale = e . target . value ;
1920 if ( this . props . supportedLocales . includes ( newLocale ) ) {
2021 this . props . onChangeLanguage ( newLocale ) ;
22+ document . documentElement . lang = newLocale ;
2123 }
2224 }
2325 render ( ) {
@@ -27,7 +29,6 @@ class LanguageSelector extends React.Component {
2729 children,
2830 ...props
2931 } = this . props ;
30- document . documentElement . lang = this . props . currentLocale ; //update the lang attribute of the html for screenreaders
3132 return (
3233 < LanguageSelectorComponent
3334 onChange = { this . handleChange }
You can’t perform that action at this time.
0 commit comments