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

uses valid BCP47/RFC5646 RequestLocaleInfo.language_tags in locale selectors #6067

Merged
merged 3 commits into from
Aug 27, 2021

Conversation

cfm
Copy link
Member

@cfm cfm commented Aug 16, 2021

Status

Ready for review, but this branch depends on and includes commits pending merge in:

Description of Changes

Closes #6056 by:

  1. refactoring i18n.map_locale_display_names() so that the values of the global LOCALES dictionary are i18n.RequestLocaleInfo instances rather than strings; and
  2. updating securedrop/{journalist,source}_templates/locales.html accordingly to use the RequestLocaleInfo.display_name property in user-facing text and the RequestLocaleInfo.language_tag property as required for the a[lang,hreflang] attributes to validate.

Testing

Follow #6056's steps to reproduce:

  1. on develop (or, pending refactors Source Interface for semantic HTML5/ARIA markup #6041, on its branch5986-semantic-source-interface)
    1. The locale selectors fail HTML validation on their a[lang,hreflang] attributes.
  2. on this branch 6056-language-tag
    • The locale selectors pass HTML validation on their a[lang,hreflang] attributes.
    • The locale selectors are otherwise unchanged.

Deployment

No deployment considerations.

Checklist

If you made changes to the server application code:

  • Linting (make lint) and tests (make test) pass in the development container

@cfm cfm requested a review from a team as a code owner August 16, 2021 21:17
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop left a comment

Choose a reason for hiding this comment

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

Test plan passes, changes LGTM

@zenmonkeykstop zenmonkeykstop merged commit 3234de2 into develop Aug 27, 2021
@zenmonkeykstop zenmonkeykstop deleted the 6056-language-tag branch August 27, 2021 15:34
@eloquence eloquence added this to the 2.1.0 milestone Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make BCP47/RFC5646 RequestLocaleInfo.language_tag property available in locale selectors
3 participants