Closed Bug 484191 Opened 16 years ago Closed 3 years ago

lang="yue" and lang="zh-yue" (Cantonese) displayed using Simplified Chinese and Japanese fonts

Categories

(Core :: Internationalization, defect)

All
Windows
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: henry.fai.hang.chan, Assigned: m_kato)

References

(Depends on 1 open bug, )

Details

(Keywords: fonts, intl)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4pre) Gecko/20090316 Shiretoko/3.1b4pre Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4pre) Gecko/20090316 Shiretoko/3.1b4pre When a website has ' lang="zh-yue"' in the html element, somehow firefox uses the Simplified Chinese font specified in options. zh-yue is the local for Cantonese, used primary in Hong Kong, so therefore it should have used the Traditional (Hong Kong) font specified. Reproducible: Always Steps to Reproduce: 1.Go to the site 2.Change your font settings of Simplified Chinese to any Chinese Font 3.You see changes immediately 4.Change your font settings of Traditional Chinese (Hong Kong) to any Chinese Font 5.Change your font settings of Traditional Chinese (Hong Kong) to any Chinese Font 6.Nothing happens after 4 and 5, thus showing firefox wrongly detects the language. However with the ' lang="zh"' attribute at http://zh.wikipedia.org/, changing any of the Simp Chinese / Trad Chinese (Taiwan) / Trad Chinese (Hong Kong) is reflected instantly.
zh-yue is the "locale" for Cantonese, not "local"
Assignee: nobody → smontagu
Component: File Handling → Internationalization
Product: Firefox → Core
QA Contact: file.handling → i18n
Is Cantonese not also used in Simplified Chinese script in some areas of mainland China?
Yes but the Wikipedia site has focused to use Traditional Chinese script. The standard for written Chinese in China is that [all traditional words, old word form (字型, for example two dots instead of three for some words), derived words (異體字) and common written changes (俗字) (actually simpfified. Chinese is based on common writing in China about 50 years ago, when words written without their ideograph meaning were most common)] is forbidden to be used in normal circumstances. I wouldn't think China would extend this policy to cover any website, since they encourages people to follow their "standard". (The Taiwan or Hong Kong "standard" of word form is not very good either, although most of the time it follows the ideograph meaning) Hong Kong people are much more likely to write in Cantonese dialect instead of Guangdong citizens due to the policies (although the chance isn't very high in both cases). Well then it might be better if firefox could detect Traditional Chinese / Simplified Chinese based on context.
I think the only satisfying solution will be to create a new font category for written Cantonese. This is the only way not to impose traditional to mainland users, nor simplified to Hong-Kong users. Also Cantonese does use a few specific characters, so you might want a font with a good version of those that would not be be the preferred font for neither traditional nor simplified .
PMingLiu-ExtB would be a good choice. For the while being i think resolving zh-yue to zh-hk would be a good choice since 1) mainland blocks all wikimedia projects 2) most people that use written cantonese are in hong kong 3) fonts for hk (PMingLiu-ExtB) are the default for zh-hk 4) written cantonese forms are not in GB standards, but in HKSCS standards. 5) written cantonese are historically encoded in big5-hkscs.
Nowadays Wikipedia in Cantonese specifies lang="yue". On my system, much of the text is rendered in a mixture of MS PGothic (a Japanese font) and Microsoft YaHei (a Simplified Chinese font). Since Firefox doesn't recognize the language code, the end result is basically the hodge-podge mentioned in bug 677919. The following user style improves things somewhat. It can be applied with the Stylish add-on [1] or the userContent.css file [2]. @-moz-document domain("zh-yue.wikipedia.org") { * { font-family: "Microsoft JhengHei", sans-serif !important; } [lang]:not([lang$="yue"]) { font-family: sans-serif !important; } } [1] https://addons.mozilla.org/firefox/addon/stylish/ [2] http://kb.mozillazine.org/UserContent.css
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: fonts, intl
OS: Windows XP → Windows
Hardware: x86 → All
Summary: lang="zh-yue" uses simplified Chinese fonts → lang="yue" and lang="zh-yue" (Cantonese) displayed using Simplified Chinese and Japanese fonts
This is unsatisfactory. At least, either zh-HK or zh-CN fonts should be used.
Assignee: smontagu → m_kato
I don't add reftest (compare of html lang="zh-hk" vs html lang="yue") due to our reftest VMs cannot compare both lang fonts
(In reply to Makoto Kato [:m_kato] from comment #9) > I don't add reftest (compare of html lang="zh-hk" vs html lang="yue") due to > our reftest VMs cannot compare both lang fonts I don't understand this... can you explain what you mean? Why wouldn't it work to have reftests that compare a testcase with lang="yue" against a reference with lang="zh-hk"?
(In reply to Jonathan Kew (:jfkthame) from comment #10) > (In reply to Makoto Kato [:m_kato] from comment #9) > > I don't add reftest (compare of html lang="zh-hk" vs html lang="yue") due to > > our reftest VMs cannot compare both lang fonts > > I don't understand this... can you explain what you mean? Why wouldn't it > work to have reftests that compare a testcase with lang="yue" against a > reference with lang="zh-hk"? https://treeherder.mozilla.org/#/jobs?repo=try&revision=642f599a5c8e Non-fontconfig platforms (Windows, Mac and Android) has full font name list into preferences such as font.name-list. But fontconfig platform such as GTK doesn't have font name list into it. So, fontconfig resolves real font name by generic family name since preferences uses "serif" etc. Since lang is different, it will return another font. Also, although I compare zh-yue and yue, it is failure. Should I add this reftest and skip-if(gtk)?
Sounds fine to just skip-if(gtk) if that works.
Depends on: 1379017

Can we drop the r? and close this bug?

Flags: needinfo?(jfkthame)

It looks like lang=yue is still what wikipedia (for example) is using, so I suspect this is still an issue.

Makoto, should we be going ahead with the patch here, or have other changes made it obsolete or unimportant?

Flags: needinfo?(jfkthame) → needinfo?(m_kato)

I re-look this issue. Since we have moved langGroup.properties to mozilla::intl::Locate to parse locale string, "yue" is parsed to "zh-HK" now. And, also, rendering text doesn't select Simplified Chinese now.

This should close as WFM. But feel free to reopen this if there is still this issue.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(m_kato)
Resolution: --- → WORKSFORME
Attachment #8721183 - Flags: review?(jfkthame)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: