Skip to content

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

@timdream

Description

@timdream

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/web interfaceRelated to the Mastodon web interfacei18nInternationalization and localizationstatus/to triageThis issue needs to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions