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

Language cannot be set on posts #15350

Open
karlgroves opened this issue Apr 30, 2019 · 10 comments
Open

Language cannot be set on posts #15350

karlgroves opened this issue Apr 30, 2019 · 10 comments
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Internationalization (i18n) Issues or PRs related to internationalization efforts Needs Accessibility Feedback Need input from accessibility Needs Design Feedback Needs general design feedback.

Comments

@karlgroves
Copy link

Language cannot be set on posts

  • Severity: High
  • Affected Populations:
    • Blind
    • Low-Vision
    • Cognitively Impaired
  • Platform(s):
    • All / Universal
  • Components affected:
    • Output Markup

Issue description

Posts written in languages other than the editor's own setting cannot
have the correct language attributes defined.

Declaring the correct language of a page is vital, so that browsers can
determine how to render the textual content, and assistive technologies
can determine how it should be pronounced.

Issue Code
    <article id="post-19" class="...">...</article>

Remediation Guidance

Allow authors to set lang and dir attributes that apply to the
whole post.

Recommended Code
    <article lang="es" id="post-19" class="...">...</article>

Relevant standards

Note: This issue may be a duplicate with other existing accessibility-related bugs in this project. This issue comes from the Gutenberg accessibility audit, performed by Tenon and funded by WP Campus. This issue is GUT-110 in Tenon's report

@gziolo gziolo added the Needs Accessibility Feedback Need input from accessibility label Apr 30, 2019
@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Internationalization (i18n) Issues or PRs related to internationalization efforts and removed Needs Accessibility Feedback Need input from accessibility labels May 4, 2019
@afercia
Copy link
Contributor

afercia commented May 4, 2019

This is a very interesting point. Historically, for multi-language sites, WordPress relied on plugins that offer the ability to translate the whole page, including the post content.

To my knowledge, the need to have only the post content in a different language, while keeping the rest of a web page in the original language, hasn't been considered so often. This isn't new, as the Classic Editor doesn't provide any user interface to offer this ability.

However, I guess Gutenberg could add this feature, as in providing a way to add "meta" information to the post content. In this specific case, these meta info would be rendered as lang and dir attributes on the post content container.

@StommePoes
Copy link

Relatedly, language direction on pages or parts of page #12352

@kjellr
Copy link
Contributor

kjellr commented May 10, 2019

We discussed this in today's #design triage.

As noted in #15349, I think it'd be really interesting to dive into this holistically. It's clear from this and other issues that the experience for writers who use multiple languages is subpar, and it'd be great to focus in on that use case in its entirety. Seeing as this functionality didn't appear in the classic editor, I'm not sure if this would best be explored in a plugin or here, but it's worth exploring in any case. Adding the Needs Design tag to hopefully get that ball rolling.

@kjellr kjellr added Needs Design Needs design efforts. and removed Needs Design Feedback Needs general design feedback. labels May 10, 2019
@enriquesanchez
Copy link
Contributor

Setting the post's lang attribute from the Document settings sidebar could look something like this:

Screen Shot 2019-12-18 at 15 06 12

This would set the post's lang attribute to <article lang="en-US"> and by default, it should be set to the site's language.

While I don't think this setting alone calls for a new accordion section in the sidebar, if we were to also implement the dir attribute, then it might be worth exploring a new accordion menu section.

See #15349 for a block-level exploration of this same setting.

@enriquesanchez enriquesanchez added Needs Design Feedback Needs general design feedback. Needs Accessibility Feedback Need input from accessibility and removed Needs Design Needs design efforts. labels Dec 18, 2019
@mapk
Copy link
Contributor

mapk commented Dec 19, 2019

As pointed out earlier, this use-case is normally handled through plugins. I wonder if we should leave this in the plugin territory?

The design to make this happen from @enriquesanchez looks fairly straightforward and may not require a lot of development if it's a setting that just appends a lang and dir.

cc @mtias and @youknowriad for additional thoughts.

@swissspidy
Copy link
Member

Reminds me of https://github.com/glueckpress/wordpress-post-language.

IMO we should take a more holistic approach on this as part of Gutenberg phase 4 instead of just adding some setting field for post meta and later regret it because of backward compatibility.

@mtias
Copy link
Member

mtias commented Dec 20, 2019

Agreed about not rushing anything, even if it seems simple on the surface, and focus properly on the full problem in phase 4.

@enriquesanchez
Copy link
Contributor

Alrighty then, closing for now and will wait for Phase 4's support for multilingual sites.

@afercia
Copy link
Contributor

afercia commented Jul 12, 2020

Not sure why this issue was closed, as the problem is yet to solve. I do realize improvements are planned for multilingual support in phase 4 but that doesn't seem a good reason to close a valid issue :)

Also, please do not close issues from the WPCampus accessibility audit if not solved. Keeping them open serves the purpose of keeping track of the progress on the audit. Thanks.

@afercia afercia reopened this Jul 12, 2020
@paaljoachim
Copy link
Contributor

I brought it up during a Gutenberg Design Triage. I see that nothing should be done here at the moment and approach it again when we begin to think about multilingual sites in phase 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Internationalization (i18n) Issues or PRs related to internationalization efforts Needs Accessibility Feedback Need input from accessibility Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

No branches or pull requests