Repository navigation
Conversation
reknih
left a comment
There was a problem hiding this comment.
Thank you for your translation. I added a few comments on enum and constant names and our current handling of breaking changes.
I also want to keep zh in addition to the explicit zhs and zht and make it pick the correct language variant for zh based on which region the user picked. Do you think that could work?
The `zht` language implies `region: "TW"`.
Co-Authored-By: Martin Haug <[email protected]>
- `Lang::CHINESE` has been removed. - `Lang::Chinese` has been renamed to `Lang::ChineseSimplified`. Co-Authored-By: Martin Haug <[email protected]>
Co-authored-by: Martin Haug <[email protected]>
I prefer to leverage our already-have We may need to refactor #set text(lang: "zh", region: "TW") |
I'm second to this. |
| @@ -0,0 +1,6 @@ | |||
|
|
|||
| --- | |||
| #text(lang: "zh")["你好, '世界'."] | |||
There was a problem hiding this comment.
I do not think implement smart quote for CJK text is a good idea. The smart quote is designed for western language users, who often typed (U+0022 Quotation Mark) instead of “true” open and close quotations. (In English that's U+201C/U+201D) But when CJK users typing their language, an input method is always used. Input methods will take care of U+0022 to U+201C/U+201D conversion and there is no need for typst to do smart quote transition.
The text in this test is rarely occurred in real world text. In Simplified Chinese, it's much more easy for us to write “你好,‘世界’。” than "你好, '世界'.". (Note that we use U+FF0C FULLWIDTH COMMA instead of U+002C COMMA) I believe this is true for all CJK languages.
Also, the smart quote currently do not working correctly in text without space, which is the case of CJK.
There was a problem hiding this comment.
Sure, I'll remove the related changes!
tthe standard code will be
Note: there are also other variants like |
It is not that complicated. We can already specify |
|
I'm currently working on the LocalName refactor. PR of this will be landed soon. |
102fa05 to
b79121d
Compare
This PR distinguishes Simplified Chinese and Traditional Chinese1, and adds the translation, quoting, and partial support of numbering.
CHINESEtoCHINESE_SIMPLIFIEDto distinguish them.TRAD_CHINESEis namedzht– the only 3-char code inLang.zhtandzhs. It is better to add a “lang” flag to indicate which numbering kind should be used. I now mark it as#[allow(unused)]and add aTODOon it.CHINESE_SIMPLIFIEDas中文(简体);CHINESE_TRADITIONALas中文(繁體).Footnotes
Traditional Chinese is used mainly by people in Taiwan, Hong Kong, etc. ↩