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

Add support for using multiple languages in a single post #23698

Closed
ChasBelov opened this issue Feb 18, 2023 · 8 comments
Closed

Add support for using multiple languages in a single post #23698

ChasBelov opened this issue Feb 18, 2023 · 8 comments
Labels
suggestion Feature suggestion

Comments

@ChasBelov
Copy link

ChasBelov commented Feb 18, 2023

Steps to reproduce the problem

  1. Visit ohai.social in English
  2. Click in the What's on your mind? field.
  3. Type:

The following should be translated as "Did you have boba?"

有冇波霸奶茶?

The following would reasonably be colloquially translated as "No, and I'm miserable!"

冇囉!

  1. Select 有冇波霸奶茶?
  2. In the UI footer, click EN
  3. In the search box which pops up, type Chinese
  4. Click 中文 (Chinese)
  5. Select 冇囉!

Expected behaviour

Current language in the UI displays as EN, and I can proceed to set 冇囉! to ZH as well. When I subsequently post, most of the post will not be wrapped in a tag having the lang="ZH" attribute, only "有冇波霸奶茶?" and "冇囉!" will.

Actual behaviour

Current language in the UI displays as ZH. If I post now, the entire toot will be wrapped in a tag having the lang="ZH" attribute.

Detailed description

WCAG 2.1 has 3.1.2 Language of Parts (Level AA), which states that all content not in the main page's language must be marked with a language attribute.

This is not possible to satisfy for a mixed-language toot. There is a language marker facility, but it can only be applied to the entire toot.

The correct accessible Mastodon behavior would be to support such markup within a toot.

Discussion:

Technically, this is also an issue for mixed-language alternative text attributes, title attributes, and aria-label attributes. However, since HTML does not support language markup within HTML tag attributes, there is nothing Mastodon can do as of Feb. 18, 2023, to remedy this until such time HTML is updated to support Language of Parts within attributes.

Note that the Chinese text is colloquial Cantonese and would best be marked as YUE or ZH-YUE rather than ZH, but that's a feature request and separate from this current issue.

Specifications

Mastodon 4.1.0
macOS 13.2.1
Firefox 110.0

@ChasBelov ChasBelov added the bug Something isn't working label Feb 18, 2023
@ClearlyClaire ClearlyClaire added suggestion Feature suggestion and removed bug Something isn't working labels Feb 20, 2023
@ClearlyClaire ClearlyClaire changed the title Cannot satisfy Language of Parts on a mixed-language toot Add support for using multiple languages in a single post Feb 20, 2023
@velw
Copy link

velw commented Feb 23, 2023

Not sure if there's a detail I've missed but this appears to be a duplicate of #22766

@ChasBelov
Copy link
Author

Duplicate of #22766.

Agreed, this and that cover the same topic. Will close this one as duplicate and cross-post there.

@trwnh
Copy link
Member

trwnh commented May 19, 2023

i'd actually disagree -- this issue and that issue seem to be different. this one asks for tagging a post as containing multiple languages; #22766 asks for making a post with different versions for different languages.

@trwnh
Copy link
Member

trwnh commented May 19, 2023

with that said: #18538 (comment)

mul - Multiple languages - For when a toot contains multiple languages simultaneously without any one being the "main one", e.g. Hello! Hola! Bonjour! Olá in a single toot.

so #18538 seems like the closest duplicate of this.

@trwnh trwnh closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2023
@velw
Copy link

velw commented May 19, 2023

with that said: #18538 (comment)

mul - Multiple languages - For when a toot contains multiple languages simultaneously without any one being the "main one", e.g. Hello! Hola! Bonjour! Olá in a single toot.

so #18538 seems like the closest duplicate of this.

That's only one suggestion within the entire comment thread of #18538 , though, and what's requested in this issue isn't mentioned in the description for #18538 at all. This request for the ability to tag a post with multiple languages could get lost completely if this is closed in favour of an issue where the requirement is mentioned only in passing in a thread of over 30 comments so far.

Adding multiple languages to one post isn't the same as adding a "multiple language" tag, either. If I want to filter for a language I want to be able to find posts that contain some of that language. How would I filter for posts that contain both Japanese and English, for example, if any post containing multiple languages was just tagged "multiple languages"? There'd be no way. The Japanese and English post has to be tagged in a one-to-many relationship with all languages used, so people who want to see posts containing either language will see it.

@velw
Copy link

velw commented May 19, 2023

It seems more like a duplicate of #18241 if anything... no?

@trwnh
Copy link
Member

trwnh commented May 19, 2023

possibly! i think after closing duplicates i will try to gather up "related issues" into larger "tracking issues", and this one would definitely fall under #18241

@ChasBelov
Copy link
Author

Noting that a multiple-language tag would violate WCAG 2.0 AA language of parts. WCAG requires that each language's content be individually marked as specifically being in that language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

4 participants