Skip to content

Commit

Permalink
feat: add both simplified & traditional Chinese (#30)
Browse files Browse the repository at this point in the history
Chinese words using default font seems a little bit weird, so I rewrite the 'font-family' rule and add 3 fonts for OS compatibility. By the way,  I also update languages.html for your convenience.
  • Loading branch information
etbox authored Jul 3, 2020
1 parent 0449713 commit 1cbe025
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lang/zh-hans.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:lang(zh-hans) .theorem::before { content: '定理 ' counter(theorem) '. ' !important; }
:lang(zh-hans) .lemma::before { content: '引理 ' counter(theorem) '. ' !important; }
:lang(zh-hans) .proof::before { content: '证明:' attr(title) !important; font-style: normal; }
:lang(zh-hans) .definition::before { content: '定义 ' counter(definition) '. ' !important; }
:lang(zh-hans) ::before { font-family: 'Microsoft Yahei', 'STHeiti', 'Source Han Sans CN'; }
5 changes: 5 additions & 0 deletions lang/zh-hant.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:lang(zh-hant) .theorem::before { content: '定理 ' counter(theorem) '. ' !important; }
:lang(zh-hant) .lemma::before { content: '引理 ' counter(theorem) '. ' !important; }
:lang(zh-hant) .proof::before { content: '證明:' attr(title) !important; font-style: normal; }
:lang(zh-hant) .definition::before { content: '定義 ' counter(definition) '. ' !important; }
:lang(zh-hant) ::before { font-family: 'Microsoft Yahei', 'STHeiti', 'Source Han Sans CN'; }
2 changes: 2 additions & 0 deletions languages.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ <h5>Abstract</h5>
<option value="mwl">Mirandese (mwl)</option>
<option value="pt">Portuguese (pt)</option>
<option value="ro">Romanian (ro)</option>
<option value="zh-hans">Simplified Chinese (zh-hans)</option>
<option value="zh-hant">Traditional Chinese (zh-hant)</option>
</select>

<div id="wrapper">
Expand Down

1 comment on commit 1cbe025

@vercel
Copy link

@vercel vercel bot commented on 1cbe025 Jul 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.