Skip to content

Commit

Permalink
feat: add zh-hant support
Browse files Browse the repository at this point in the history
  • Loading branch information
kitayoshi committed Mar 26, 2019
1 parent 783db04 commit 0f492a6
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ package-lock.json
.eslintcache
*.log
.DS_Store

# Editor
.vscode
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/griffith/README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ render(<Player {...props} />)
| `shouldObserveResize` | `boolean` | `false` | 是否监听窗口 resize |
| `initialObjectFit` | `fill \| \contain \| cover \| none \| scale-down` | `contain` | object-fit 参数 |
| `useMSE` | `boolean` | `false` | 是否启用 MSE |
| `locale` | `en \| zh_cn` | `en` | 界面语言 |
| `locale` | `en \| jp \| zh-Hans \| zh-Hant` | `en` | 界面语言 |

`sources` 字段:

Expand Down
2 changes: 1 addition & 1 deletion packages/griffith/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ render(<Player {...props} />)
| `shouldObserveResize` | `boolean` | `false` | Listen to the window resize |
| `initialObjectFit` | `fill \| contain \| cover \| none \| scale-down` | `contain` | object-fit |
| `useMSE` | `boolean` | `false` | Enable Media Source Extensions™ |
| `locale` | `en \| zh_cn` | `en` | UI Locale |
| `locale` | `en \| jp \| zh-Hans \| zh-Hant` | `en` | UI Locale |

`sources`:

Expand Down
2 changes: 1 addition & 1 deletion packages/griffith/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface PlayerContainerProps {
shouldObserveResize?: boolean
initialObjectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'
useMSE?: boolean
locale?: 'en' | 'zh_cn'
locale?: 'en' | 'jp' | 'zh-Hans' | 'zh-Hant'
}

interface Subscription {
Expand Down
20 changes: 19 additions & 1 deletion packages/griffith/src/components/TranslatedText/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,30 @@ export default {
'action-enter-fullscreen': 'Fullscreen',
'action-exit-fullscreen': 'Exit Fullscreen',
},
zh_cn: {
ja: {
'quality-auto': '自動',
'quality-ld': '低画質',
'quality-sd': '標準画質',
'quality-hd': '高画質',
'action-enter-fullscreen': '全画面',
'action-exit-fullscreen': '全画面終了',
},
// covers zh-Hans-CN and zh-Hans-SG
'zh-Hans': {
'quality-auto': '自动',
'quality-ld': '低清',
'quality-sd': '标清',
'quality-hd': '超清',
'action-enter-fullscreen': '全屏',
'action-exit-fullscreen': '退出全屏',
},
// covers zh-Hant-HK and zh-Hant-TW
'zh-Hant': {
'quality-auto': '自動',
'quality-ld': '低畫質',
'quality-sd': '標準畫質',
'quality-hd': '高畫質',
'action-enter-fullscreen': '全螢幕',
'action-exit-fullscreen': '結束全螢幕',
},
}

0 comments on commit 0f492a6

Please sign in to comment.