Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/calendar/demo/locale.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To set the properties like time zone, language and etc. en_US, zh_CN are support

````jsx
import { Calendar } from 'jgui';
import enUS from 'jgui/lib/calendar/locale/en_US';
import enUS from 'jgui/lib/calendar/locale/zh_TW';

function onPanelChange(value, mode) {
console.log(value, mode);
Expand Down
1 change: 1 addition & 0 deletions components/calendar/locale/zh_TW.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../date-picker/locale/zh_TW');
2 changes: 1 addition & 1 deletion components/date-picker/demo/locale.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use locale to set the properties like time zone, language and etc. en_US, zh_CN

````jsx
import { DatePicker } from 'jgui';
import enUS from 'jgui/lib/date-picker/locale/en_US';
import enUS from 'jgui/lib/date-picker/locale/zh_TW';

const customLocale = {
timezoneOffset: 0 * 60,
Expand Down
202 changes: 202 additions & 0 deletions components/date-picker/locale/zh_TW.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
export default {
"timezoneOffset": 480,
"firstDayOfWeek": 1,
"minimalDaysInFirstWeek": 1,
"lang": {
"placeholder": "請選擇日期",
"rangePlaceholder": [
"開始日期",
"結束日期"
],
"today": "今天",
"now": "此刻",
"backToToday": "返回今天",
"ok": "確 定",
"timeSelect": "選擇時間",
"dateSelect": "選擇日期",
"clear": "清除",
"month": "月",
"year": "年",
"previousMonth": "上個月",
"nextMonth": "下個月",
"monthSelect": "",
"yearSelect": "選擇年份",
"decadeSelect": "選擇年代",
"yearFormat": "yyyy'年'",
"monthFormat": "M'月'",
"dayFormat": "d'日'",
"dateFormat": "yyyy'年'M'月'd'日'",
"dateTimeFormat": "yyyy'年'M'月'd'日' HH'時'mm'分'ss'秒'",
"previousYear": "上一年",
"nextYear": "下一年",
"previousDecade": "上一年代",
"nextDecade": "下一年代",
"previousCentury": "上一世紀",
"nextCentury": "下一世紀",
"format": {
"eras": [
"公元前",
"公元"
],
"months": [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月"
],
"shortMonths": [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月"
],
"weekdays": [
"星期天",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六"
],
"shortWeekdays": [
"周日",
"周一",
"周二",
"周三",
"周四",
"周五",
"周六"
],
"veryShortWeekdays": [
"日",
"一",
"二",
"三",
"四",
"五",
"六"
],
"ampms": [
"上午",
"下午"
],
"datePatterns": [
"yyyy'年'M'月'd'日' EEEE",
"yyyy'年'M'月'd'日'",
"yyyy-M-d",
"yy-M-d"
],
"timePatterns": [
"ahh'時'mm'分'ss'秒' 'GMT'Z",
"ahh'時'mm'分'ss'秒'",
"H:mm:ss",
"ah:mm"
],
"dateTimePattern": "{date} {time}"
}
},
"timePickerLocale": {
"placeholder": "請選擇時間",
"clear": "清除",
"format": {
"eras": [
"公元前",
"公元"
],
"months": [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月"
],
"shortMonths": [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月"
],
"weekdays": [
"星期天",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六"
],
"shortWeekdays": [
"周日",
"周一",
"周二",
"周三",
"周四",
"周五",
"周六"
],
"veryShortWeekdays": [
"日",
"一",
"二",
"三",
"四",
"五",
"六"
],
"ampms": [
"上午",
"下午"
],
"datePatterns": [
"yyyy'年'M'月'd'日' EEEE",
"yyyy'年'M'月'd'日'",
"yyyy-M-d",
"yy-M-d"
],
"timePatterns": [
"ahh'時'mm'分'ss'秒' 'GMT'Z",
"ahh'時'mm'分'ss'秒'",
"H:mm:ss",
"ah:mm"
],
"dateTimePattern": "{date} {time}"
},
"calendar": {
"timezoneOffset": 480,
"firstDayOfWeek": 1,
"minimalDaysInFirstWeek": 1
}
}
}
2 changes: 1 addition & 1 deletion components/drawer/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DrawerDemo extends React.Component {
size: 250,
direction: 'right',
zIndex: 101,
transition: 'width .3s ease-out,height .3s ease',
transition: 'all .3s ease',
}

return (
Expand Down
11 changes: 5 additions & 6 deletions components/locale-provider/demo/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: 所有组件
````jsx
import { LocaleProvider, Pagination, DatePicker, TimePicker, Calendar,
Popconfirm, Table, Modal, Button, Select, Transfer, Radio } from 'jgui';
import enUS from 'jgui/lib/locale-provider/en_US';
import zhTW from 'jgui/lib/locale-provider/zh_TW';
const Option = Select.Option;
const RangePicker = DatePicker.RangePicker;

Expand Down Expand Up @@ -56,8 +56,7 @@ const Page = React.createClass({
</div>
<div className="example">
<Select showSearch style={{ width: 200 }}>
<Option value="jack">jack</Option>
<Option value="lucy">lucy</Option>

</Select>
<DatePicker />
<TimePicker />
Expand Down Expand Up @@ -97,7 +96,7 @@ const Page = React.createClass({
const App = React.createClass({
getInitialState() {
return {
locale: enUS,
locale: zhTW,
};
},
changeLocale(e) {
Expand All @@ -108,8 +107,8 @@ const App = React.createClass({
<div>
<div className="change-locale">
<span style={{ marginRight: 16 }}>Change locale of components: </span>
<Radio.Group defaultValue={enUS} onChange={this.changeLocale}>
<Radio.Button key="en" value={enUS}>English</Radio.Button>
<Radio.Group defaultValue={zhTW} onChange={this.changeLocale}>
<Radio.Button key="tw" value={zhTW}>繁體</Radio.Button>
<Radio.Button key="cn">中文</Radio.Button>
</Radio.Group>
</div>
Expand Down
4 changes: 2 additions & 2 deletions components/locale-provider/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ LocaleProvider 使用 React 的 [context](https://facebook.github.io/react/docs/


```jsx
import enUS from 'jgui/lib/locale-provider/en_US';
import zhTW from 'jgui/lib/locale-provider/zh_TW';

...

return <LocaleProvider locale={enUS}><App /></LocaleProvider>;
return <LocaleProvider locale={zhTW}><App /></LocaleProvider>;
```

### Add a language
Expand Down
35 changes: 35 additions & 0 deletions components/locale-provider/zh_TW.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import Pagination from '../pagination/rc-pagination/src/locale/zh_TW';
import DatePicker from '../date-picker/locale/zh_TW';
import TimePicker from '../time-picker/locale/zh_TW';
import Calendar from '../calendar/locale/zh_TW';

export default {
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: '篩選',
filterConfirm: '確定',
filterReset: '重置',
emptyText: 'No Data', // 看這兒: 這裡改為繁體 Demo出現一個 另一個No Data 重疊 問題。
},
Modal: {
okText: '確定',
cancelText: '取消',
justOkText: '確定',
},
Popconfirm: {
okText: '確定',
cancelText: '取消',
},
Transfer: {
notFoundContent: '列表為空',
searchPlaceholder: '請輸入搜索內容',
itemUnit: '條 ',
itemsUnit: '條',
},
Select: {
notFoundContent: '暫無數據',
},
};
2 changes: 2 additions & 0 deletions components/modal/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ export function changeConfirmLocale(newLocale) {
} else {
runtimeLocale = assign({}, defaultLocale);
}
console.log('runtimeLocaleruntimeLocale2',runtimeLocale)
}

export function getConfirmLocale() {
console.log('runtimeLocaleruntimeLocale',runtimeLocale)
return runtimeLocale;
}
6 changes: 3 additions & 3 deletions components/pagination/Pagination.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import RcPagination from 'rc-pagination';
import RcPagination from './rc-pagination/src/index';
import Select from '../select';
import MiniSelect from './MiniSelect';
import zhCN from './locale/zh_CN';
import zhTW from './locale/zh_TW';

export default class Pagination extends React.Component {
static defaultProps = {
locale: zhCN,
locale: zhTW,
className: '',
prefixCls: 'jgui-pagination',
}
Expand Down
2 changes: 1 addition & 1 deletion components/pagination/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ title: 基本
import { Pagination } from 'jgui';

ReactDOM.render(
<Pagination defaultCurrent={1} total={50} />,
<Pagination defaultCurrent={1} total={50}/>,
mountNode);
````
9 changes: 5 additions & 4 deletions components/pagination/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ english: Pagination

| 参数 | 说明 | 类型 | 默认值 |
|------------------|------------------------------------|---------------|--------------------------|
| showTitle | 鼠标移上是否显示title | Bool | false |
| current | 当前页数 | Number | 无 |
| defaultCurrent | 默认的当前页数 | Number | 1 |
| defaultCurrent | 默认的当前页数 | Number | 1 |
| total | 数据总数 | Number | 0 |
| defaultPageSize | 初始的每页条数 | Number | 10 |
| pageSize | 每页条数 | Number | |
| onChange | 页码改变的回调,参数是改变后的页码 | Function | noop |
| showSizeChanger | 是否可以改变 pageSize | Bool | false |
| pageSizeOptions | 指定每页可以显示多少条 | Array<String> | ['10', '20', '30', '40'] |
| onChange | 页码改变的回调,参数是改变后的页码 | Function | noop |
| showSizeChanger | 是否可以改变 pageSize | Bool | false |
| pageSizeOptions | 指定每页可以显示多少条 | Array<String> | ['10', '20', '30', '40'] |
| onShowSizeChange | pageSize 变化的回调 | Function | noop |
| showQuickJumper | 是否可以快速跳转至某页 | Bool | false |
| size | 当为「small」时,是小尺寸分页 | String | "" |
Expand Down
Loading