mapbox / mapbox/mapbox-gl-js

Chinese cannot be recognized using the browser language

Open
#13,510 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Hello, the current mapbox language settings are: Simplified Chinese: zh-Hans, Traditional Chinese: zh-Hant, but in the browser, zh-Hans and zh-Hant are not recognized language codes, so there is no way to automatically display Chinese for users in Chinese areas.

The language codes recognized in the browser are:

Simplified Chinese: zh-cn, zh-sg, zh
Traditional Chinese: zh-tw, zh-hk

![Image](https://github.com/user-attachments/assets/1daf1946-042e-4175-914f-8c89a76191e6)

![Image](https://github.com/user-attachments/assets/f3f05900-8831-4812-b77f-f1895d493c20)

I hope it can be adjusted, thank you!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the browser-language detection and Mapbox language settings described in the issue. Check how zh-Hans and zh-Hant are matched against browser codes such as zh-cn, zh-sg, zh-tw, and zh-hk; done means Chinese-language browsers automatically display the appropriate Chinese variant.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, internationalization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.