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

Toots in Chinese regional variants from iOS are not rendered in the correct font #28884

Open
timdream opened this issue Jan 24, 2024 · 1 comment
Labels
area/web interface Related to the Mastodon web interface bug Something isn't working i18n Internationalization and localization status/to triage This issue needs to be triaged

Comments

@timdream
Copy link

timdream commented Jan 24, 2024

Steps to reproduce the problem

  1. Post a toot from Mastodon on iOS with language set to a specific zh locale code, e.g. zh-Hant.
  2. Observe the post on Web.

Mastodon instance

mastodon.social

Mastodon version

v4.3.0-alpha.0+pr-28693-384ec56
Mastodon for iOS v2023.16 (6043)

Browser name and version

Safari Version 16.6 (18615.3.12.11.2)

Operating system

macOS 13.5.2 (22G91)

Technical details

Inspecting the generated HTML I can see

<div class="status__content__text status__content__text--visible translate" lang="zh"><p>文字</p></div>

with lang="zh" being the problem there. The lang attribute should be marked with zh-tw to allow browsers to pick the right font.

Background

See #27081 for explainer on Han Unification.

Expected behaviour

The post is rendered in a font for zh-Hant

Actual behaviour

The post is rendered in a font for zh

Detailed description

(See technical details below)

Mastodon instance

mastodon.social

Mastodon version

v4.3.0-alpha.0+pr-28693-384ec56, Mastodon for iOS v2023.16 (6043)

Browser name and version

Safari Version 17.1.2 (19616.2.9.11.12)

Operating system

macOS 14.1.2

Technical details

This the same issue as #27081 but here the metadata of the example toot comes with lang=zh-Hant, instead of zh-TW. Given that zh-TW isn't a "valid locale", the fix in #27099 didn't fix it.

(Background: zh-TW is a "language + region" locale code, while zh-Hant is a "language + script" locale code.)

@timdream timdream added area/web interface Related to the Mastodon web interface bug Something isn't working status/to triage This issue needs to be triaged labels Jan 24, 2024
@vmstan vmstan added the i18n Internationalization and localization label Jan 25, 2024
@flashymittens
Copy link

This might also be relevant: https://en.wikipedia.org/wiki/ISO_639_macrolanguage#zho as, from what I can see, “zh” is a legacy code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web interface Related to the Mastodon web interface bug Something isn't working i18n Internationalization and localization status/to triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants