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

Handle language change update in javascript to update html lang attri… #3235

Merged
merged 1 commit into from Sep 6, 2018

Conversation

adamjarling
Copy link
Member

…bute

Fixes #2980

Updates the <html lang="" /> attribute when a new language is selected from the dropdown.

html-lang-selector

@samvera/hyrax-code-reviewers

@adamjarling adamjarling self-assigned this Sep 5, 2018
this.addLangClickListener();
}

addLangClickListener() {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add documentation that explains what this method is doing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea no problem. I just updated the file. This function handles the event of changing (by clicking), a new language in the top bar language selector dropdown. And the thought was the class InternationalizationHelper.js could serve as a generic, helper class to organize internationalization event handling.

@adamjarling adamjarling force-pushed the 2980-home-page-language-selector-update branch from 3b40f61 to 4da4faf Compare September 5, 2018 19:36
}

/**
* Handle the event of selecting a new language from top bar, language select element.
Copy link
Member

@jcoyne jcoyne Sep 5, 2018

Choose a reason for hiding this comment

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

Would you also add, "this updates the html@lang attribute which is important for screen readers"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, just added the text.

@adamjarling adamjarling force-pushed the 2980-home-page-language-selector-update branch from 4da4faf to 41a0c54 Compare September 6, 2018 13:33
@adamjarling adamjarling added this to Review in Hyrax WG -- Sprint 3 Sep 6, 2018
@no-reply no-reply merged commit c932248 into master Sep 6, 2018
Hyrax WG -- Sprint 3 automation moved this from Review to Done Sep 6, 2018
@no-reply no-reply deleted the 2980-home-page-language-selector-update branch September 6, 2018 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants