Skip to content

Commit

Permalink
feat: add zh-hant language (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitayoshi authored and xiaoyuhen committed Mar 26, 2019
1 parent 783db04 commit 32d37bb
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 21 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.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
English | [简体中文](./CONTRIBUTING-zh_CN.md)
English | [简体中文](./CONTRIBUTING-zh-Hans.md)

# How to Contribute

Expand Down
2 changes: 1 addition & 1 deletion README-ja_JP.md → README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/zhihu/griffith/blob/master/CONTRIBUTING.md)

[English](./README.md) | [简体中文](./README-zh_CN.md) | [日本語](./README-ja_JP.md)
[English](./README.md) | [简体中文](./README-zh-Hans.md) | [日本語](./README-ja.md)

# はじめに

Expand Down
8 changes: 4 additions & 4 deletions README-zh_CN.md → README-zh-Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/zhihu/griffith/blob/master/CONTRIBUTING.md)

[English](./README.md) | [简体中文](./README-zh_CN.md) | [日本語](./README-ja_JP.md)
[English](./README.md) | [简体中文](./README-zh-Hans.md) | [日本語](./README-ja.md)

## 简介

Expand Down Expand Up @@ -45,7 +45,7 @@ const sources = {
render(<Player sources={sources} />)
```

[查看详细使用方法](./packages/griffith/README-zh_CN.md)
[查看详细使用方法](./packages/griffith/README-zh-Hans.md)

**注意:暂不支持 SSR 应用**

Expand All @@ -68,7 +68,7 @@ const sources = {
Griffith.createPlayer(element).render({sources})
```

[查看 Standalone 模式详细使用方法](./packages/griffith-standalone/README-zh_CN.md)
[查看 Standalone 模式详细使用方法](./packages/griffith-standalone/README-zh-Hans.md)

## 项目结构

Expand Down Expand Up @@ -120,7 +120,7 @@ module.exports = {

### 贡献指南

查看我们的[贡献指南](./CONTRIBUTING-zh_CN.md)来了解我们的开发流程。
查看我们的[贡献指南](./CONTRIBUTING-zh-Hans.md)来了解我们的开发流程。

### 贡献者

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/zhihu/griffith/blob/master/CONTRIBUTING.md)

[English](./README.md) | [简体中文](./README-zh_CN.md) | [日本語](./README-ja_JP.md)
[English](./README.md) | [简体中文](./README-zh-Hans.md) | [日本語](./README-ja.md)

# Introduction

Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions packages/griffith-message/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# griffith-message

English | [简体中文](./README-zh_CN.md)
English | [简体中文](./README-zh-Hans.md)

Griffith message communication plugin

Expand Down Expand Up @@ -92,10 +92,10 @@ Events received from the player

Event sent to the player

| `messageName` | Description | `data` | Status |
| --------------------------------- | ---------------- | ----------------------------------------------------------- | ------ |
| `ACTIONS.PLAYER.PLAY` | Play | `{applyOnFullScreen: boolean}` Applied to full screen video | TODO |
| `ACTIONS.PLAYER.PAUSE` | Pause | Applied to full screen video | |
| `ACTIONS.PLAYER.SET_VOLUME` | Set the volume | `{volume: number}` Volume value from 0 to 1 | TODO |
| `ACTIONS.PLAYER.ENTER_FULLSCREEN` | Enter fullScreen | null | TODO |
| `ACTIONS.PLAYER.EXIT_FULLSCREEN` | Exit fullscreen | null | TODO |
| `messageName` | Description | `data` | Status |
| --------------------------------- | ---------------- | ----------------------------------------------------------- | --------- |
| `ACTIONS.PLAYER.PLAY` | Play | `{applyOnFullScreen: boolean}` Applied to full screen video | TODO |
| `ACTIONS.PLAYER.PAUSE` | Pause | Applied to full screen video | SUPPORTED |
| `ACTIONS.PLAYER.SET_VOLUME` | Set the volume | `{volume: number}` Volume value from 0 to 1 | TODO |
| `ACTIONS.PLAYER.ENTER_FULLSCREEN` | Enter fullScreen | null | TODO |
| `ACTIONS.PLAYER.EXIT_FULLSCREEN` | Exit fullscreen | null | TODO |
2 changes: 1 addition & 1 deletion packages/griffith-standalone/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# griffith-standalone

English | [简体中文](./README-zh_CN.md)
English | [简体中文](./README-zh-Hans.md)

Griffith bundled with React, React DOM and other dependencies. You can use it by add a `script` tag in your HTML file.

Expand Down
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 \| ja \| zh-Hans \| zh-Hant` | `en` | 界面语言 |

`sources` 字段:

Expand Down
4 changes: 2 additions & 2 deletions packages/griffith/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# griffith

English | [简体中文](./README-zh_CN.md)
English | [简体中文](./README-zh-Hans.md)

## Usage

Expand Down 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 \| ja \| 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' | 'ja' | '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 32d37bb

Please sign in to comment.