File tree Expand file tree Collapse file tree 5 files changed +52
-1
lines changed Expand file tree Collapse file tree 5 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ npm install react-native-paper-dates --save
3636
3737### Supported
3838
39- React-Native-Paper-Dates currently supports ` en/nl/de/pl/pt/ar/ko/fr/he/hi/tr/enGB ` translations. Ideally you would do this somewhere before react-native-paper-dates is used. For example, you might add the follow to your ` index.js ` or ` app.js ` .
39+ React-Native-Paper-Dates currently supports ` en/nl/de/pl/pt/ar/ko/fr/he/hi/tr/enGB/zh/zh-TW ` translations. Ideally you would do this somewhere before react-native-paper-dates is used. For example, you might add the follow to your ` index.js ` or ` app.js ` .
4040
4141``` javascript
4242import { enGB , registerTranslation } from ' react-native-paper-dates'
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ import {
3737 pt ,
3838 registerTranslation ,
3939 tr ,
40+ zh ,
41+ zhTW ,
4042} from '../../src'
4143
4244function App ( ) {
@@ -89,6 +91,8 @@ function App() {
8991 'hi' ,
9092 'tr' ,
9193 'en-GB' ,
94+ 'zh' ,
95+ 'zh-TW' ,
9296 ]
9397 let timeDate = new Date ( )
9498 time . hours !== undefined && timeDate . setHours ( time . hours )
@@ -166,6 +170,10 @@ function App() {
166170 return pt
167171 case 'tr' :
168172 return tr
173+ case 'zh' :
174+ return zh
175+ case 'zh-TW' :
176+ return zhTW
169177 default :
170178 return enGB
171179 }
Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ export { default as nl } from './translations/nl'
2222export { default as pl } from './translations/pl'
2323export { default as pt } from './translations/pt'
2424export { default as tr } from './translations/tr'
25+ export { default as zh } from './translations/zh'
26+ export { default as zhTW } from './translations/zhTW'
Original file line number Diff line number Diff line change 1+ import type { TranslationsType } from './utils'
2+
3+ const zh : TranslationsType = {
4+ save : '保存' ,
5+ selectSingle : '选择日期' ,
6+ selectMultiple : '选择多个日期' ,
7+ selectRange : '选择期间' ,
8+ notAccordingToDateFormat : ( inputFormat ) => `日期格式必须是 ${ inputFormat } ` ,
9+ mustBeHigherThan : ( date ) => `必须晚于 ${ date } ` ,
10+ mustBeLowerThan : ( date ) => `必须早于 ${ date } ` ,
11+ mustBeBetween : ( startDate , endDate ) =>
12+ `必须在 ${ startDate } - ${ endDate } 之间` ,
13+ dateIsDisabled : '日期不可选' ,
14+ previous : '上一个' ,
15+ next : '下一个' ,
16+ typeInDate : '输入日期' ,
17+ pickDateFromCalendar : '从日历中选择日期' ,
18+ close : '关闭' ,
19+ }
20+ export default zh
Original file line number Diff line number Diff line change 1+ import type { TranslationsType } from './utils'
2+
3+ const zhTW : TranslationsType = {
4+ save : '保存' ,
5+ selectSingle : '選擇日期' ,
6+ selectMultiple : '選擇多個日期' ,
7+ selectRange : '選擇期間' ,
8+ notAccordingToDateFormat : ( inputFormat ) => `日期格式必須是 ${ inputFormat } ` ,
9+ mustBeHigherThan : ( date ) => `必須晚於 ${ date } ` ,
10+ mustBeLowerThan : ( date ) => `必須早於 ${ date } ` ,
11+ mustBeBetween : ( startDate , endDate ) =>
12+ `必須在 ${ startDate } - ${ endDate } 之間` ,
13+ dateIsDisabled : '日期不可選' ,
14+ previous : '上一個' ,
15+ next : '下一個' ,
16+ typeInDate : '輸入日期' ,
17+ pickDateFromCalendar : '從日曆中選擇日期' ,
18+ close : '關閉' ,
19+ }
20+
21+ export default zhTW
You can’t perform that action at this time.
0 commit comments