Skip to content

Commit af6b710

Browse files
muibotmbrookes
authored andcommitted
Squash changes (#13510)
1 parent e2f3e6f commit af6b710

File tree

48 files changed

+609
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+609
-465
lines changed

docs/src/pages/customization/css-in-js/css-in-js-zh.md

Lines changed: 79 additions & 79 deletions
Large diffs are not rendered by default.

docs/src/pages/customization/default-theme/default-theme-zh.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Default Theme
1+
# 默认主题
22

3-
<p class="description">Here's what the theme object looks like with the default values.</p>
3+
<p class="description">以下是theme(主题)对象在默认值情况下的样子。</p>
44

55
{{"demo": "pages/customization/default-theme/DefaultTheme.js", "hideEditButton": true}}
66

7-
The theme normalizes implementation by providing default values for palette, dark and light types, typography, breakpoints, shadows, transitions, etc.
7+
主题通过为调色板、深色和浅色类型、排版、断点、阴影、过渡等提供默认值来实现其用途。
88

99
Tip: you can play with the theme object in your console too. **We expose a global `theme` variable on all the pages**.
1010

docs/src/pages/customization/themes/themes-zh.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ const theme = createMuiTheme({
310310

311311
## Accessing the theme in a component
312312

313-
You might need to access the theme variables inside your React components. Let's say you want to display the value of the primary color, you can use the `withTheme()` higher-order component to do so. Here is an example:
313+
You might need to access the theme variables inside your React components. Let's say you want to display the value of the primary color, you can use the `withTheme()` higher-order component to do so. 下面是一个示例:
314314

315315
{{"demo": "pages/customization/themes/WithTheme.js"}}
316316

@@ -335,7 +335,7 @@ This component takes a `theme` property, and makes the `theme` available down th
335335

336336
You can see the full properties API in [this dedicated page](/api/mui-theme-provider/).
337337

338-
#### Examples
338+
#### 例子
339339

340340
```jsx
341341
import React from 'react';
@@ -360,15 +360,15 @@ render(<App />, document.querySelector('#app'));
360360

361361
Generate a theme base on the options received.
362362

363-
#### Arguments
363+
#### 参数
364364

365365
1. `options` (*Object*): Takes an incomplete theme object and adds the missing parts.
366366

367-
#### Returns
367+
#### 返回结果
368368

369369
`theme` (*Object*): A complete, ready to use theme object.
370370

371-
#### Examples
371+
#### 例子
372372

373373
```js
374374
import { createMuiTheme } from '@material-ui/core/styles';
@@ -390,15 +390,15 @@ const theme = createMuiTheme({
390390

391391
Provide the `theme` object as a property of the input component so it can be used in the render method.
392392

393-
#### Arguments
393+
#### 参数
394394

395395
1. `Component`: The component that will be wrapped.
396396

397-
#### Returns
397+
#### 返回结果
398398

399399
`Component`: The new component created.
400400

401-
#### Examples
401+
#### 例子
402402

403403
```js
404404
import { withTheme } from '@material-ui/core/styles';

docs/src/pages/demos/buttons/buttons-zh.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ components: Button, IconButton, ButtonBase, Zoom
44
---
55
# 按钮
66

7-
<p class="description">按钮允许用户只需轻按一下即可采取行动并做出选择。</p>
7+
<p class="description">按钮允许用户以轻触行为采取行动并做出选择。</p>
88

9-
[按钮](https://material.io/design/components/buttons.html) 传达用户可以执行的操作。 它们通常放置在整个UI中,例如: - 对话 - 模态窗口 - 表单 - 卡片 - 工具栏
9+
[Buttons](https://material.io/design/components/buttons.html) communicate actions that users can take. They are typically placed throughout your UI, in places like:
10+
11+
- 对话框
12+
- Modal windows
13+
- Forms
14+
- 卡片
15+
- Toolbars
1016

1117
## 文本按钮
1218

1319
[文本按钮](https://material.io/design/components/buttons.html#text-button) 通常用于不太明显的操作, 包括那些位于:
1420

15-
- 在对话框中
16-
- 在卡片
21+
- In dialogs
22+
- In cards
1723

1824
在卡片中,文本按钮有助于在卡片内容之上强调按钮的存在。
1925

docs/src/pages/demos/dialogs/dialogs-zh.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,28 @@ components: Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions
1414

1515
基本对话框可以提供有关列表项的详细信息或操作。 例如, 它们可以显示头像、图标、解释或交互操作 (如添加帐户)。
1616

17-
触摸操作机制: -选择一个选项,可立即提交选项并关闭菜单 -在对话框外触摸或按下“返回”,将取消操作并关闭对话框。
17+
Touch mechanics:
18+
19+
- Choosing an option immediately commits the option and closes the menu
20+
- Touching outside of the dialog, or pressing Back, cancels the action and closes the dialog
1821

1922
{{"demo": "pages/demos/dialogs/SimpleDialog.js"}}
2023

2124
## 警报
2225

2326
警报是一种紧急中断的行为,用以通知用户某一情况并需要确认,。
2427

25-
大多数警报不需要标题。 他们通过以下其中一种方式的一两句话来得出一个决定: -问一个问题 (例如 "确认删除此对话?") -发表一个和动作按钮相关的声明
28+
Most alerts don't need titles. They summarize a decision in a sentence or two by either:
29+
30+
- Asking a question (e.g. "Delete this conversation?")
31+
- Making a statement related to the action buttons
2632

2733
仅对高风险情况使用带标题栏警报,,例如连接可能丢失。 用户应该仅根据标题和按钮文本,就能理解要做出的选择。
2834

2935
如果需要标题请:
3036

31-
- 使用明确的问题或声明,并在内容区域对其做出解释, 例如 "擦除 USB 存储?"。
32-
- 避免道歉、模棱两可或问题, 例如 "警告!" 或 "你确定吗?“
37+
- Use a clear question or statement with an explanation in the content area, such as "Erase USB storage?".
38+
- Avoid apologies, ambiguity, or questions, such as “Warning!” or “Are you sure?”
3339

3440
{{"demo": "pages/demos/dialogs/AlertDialog.js"}}
3541

@@ -67,7 +73,10 @@ components: Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions
6773

6874
## 长内容滚动
6975

70-
当对话框根据用户不同的设备和视图大小变得很长时,可以让他们进行滚动。 - `scroll=paper` 可以使对话框的内容在paper元素中滚动。 - `scroll=body`可以使对话框的内容在body元素内滚动。
76+
When dialogs become too long for the user’s viewport or device, they scroll.
77+
78+
- `scroll=paper` the content of the dialog scrolls within the paper element.
79+
- `scroll=body` the content of the dialog scrolls within the body element.
7180

7281
请尝试下面的例子来加深理解:
7382

docs/src/pages/demos/drawers/drawers-zh.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Drawer React component
2+
title: 抽屉React组件
33
components: Drawer, SwipeableDrawer
44
---
55
# 抽屉
@@ -40,42 +40,42 @@ const iOS = process.browser && /iPad|iPhone|iPod/.test(navigator.userAgent);
4040

4141
{{"demo": "pages/demos/drawers/ResponsiveDrawer.js", "iframe": true}}
4242

43-
## Permanent drawer
43+
## 永久抽屉
4444

45-
Permanent navigation drawers are always visible and pinned to the left edge, at the same elevation as the content or background. They cannot be closed.
45+
永久抽屉始终可见并固定在左侧,与内容或背景位于同一高度。他们无法被关闭。
4646

47-
Permanent navigation drawers are the **recommended default for desktop**.
47+
推荐在**桌面环境上默认**使用永久抽屉。
4848

4949
### 全高度导航栏
5050

51-
Apps focused on information consumption that use a left-to-right hierarchy.
51+
这种情况下应用程序侧重与从左到右层次结构的信息消费。
5252

5353
{{"demo": "pages/demos/drawers/PermanentDrawerLeft.js", "iframe": true}}
5454

5555
{{"demo": "pages/demos/drawers/PermanentDrawerRight.js", "iframe": true}}
5656

57-
### 剪切在应用栏下
57+
### 从应用栏下开始分割
5858

59-
Apps focused on productivity that require balance across the screen.
59+
应用专注于生产力,需要在整个屏幕上保持平衡。
6060

6161
{{"demo": "pages/demos/drawers/ClippedDrawer.js", "iframe": true}}
6262

63-
## Persistent drawer
63+
## 持久抽屉
6464

65-
Persistent navigation drawers can toggle open or closed. The drawer sits on the same surface elevation as the content. It is closed by default and opens by selecting the menu icon, and stays open until closed by the user. The state of the drawer is remembered from action to action and session to session.
65+
持久抽屉在打开和关闭的状态中相互切换 抽屉与内容位于同一平面的高度上。 它默认情况下是关闭的,可通过选择菜单图标打开,它会保持打开状态,直到用户关闭。 操作和切换都会记住抽屉的状态。
6666

67-
When the drawer is outside of the page grid and opens, the drawer forces other content to change size and adapt to the smaller viewport.
67+
当抽屉位于页面网格之外并打开时,抽屉会强制其他内容更改大小并适应较小的视口。
6868

69-
Persistent navigation drawers are acceptable for all sizes larger than mobile. They are not recommended for apps with multiple levels of hierarchy that require using an up arrow for navigation.
69+
对于比移动设备更大的尺寸,可以使用持久性导航抽屉。 对于具有多级层次结构且需要使用向上箭头进行导航的应用,建议不要使用它们。
7070

7171
{{"demo": "pages/demos/drawers/PersistentDrawerLeft.js", "iframe": true}}
7272

7373
{{"demo": "pages/demos/drawers/PersistentDrawerRight.js", "iframe": true}}
7474

75-
## Mini variant drawer
75+
## 迷你变型抽屉
7676

77-
In this variation, the persistent navigation drawer changes its width. Its resting state is as a mini-drawer at the same elevation as the content, clipped by the app bar. When expanded, it appears as the standard persistent navigation drawer.
77+
在这种情况下,持久抽屉会更改其宽度。 它的静止状态是一个迷你抽屉,与内容相同面,由应用栏遮盖住。 展开后,它将显示为标准的持久抽屉。
7878

79-
The mini variant is recommended for apps sections that need quick selection access alongside content.
79+
对于需要快速切换访问内容的应用部分,建议使用迷你变形抽屉。
8080

8181
{{"demo": "pages/demos/drawers/MiniDrawer.js", "iframe": true}}

docs/src/pages/demos/expansion-panels/expansion-panels-zh.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ components: ExpansionPanel, ExpansionPanelActions, ExpansionPanelDetails, Expans
66

77
<p class="description">扩展面板包含创建流程,允许轻量编辑元素。</p>
88

9-
[扩展面板](https://material.io/archive/guidelines/components/expansion-panels.html)是一个轻量级容器,既可以单独使用,也可以连接到更大的表面, 比如卡片
9+
[扩展面板](https://material.io/archive/guidelines/components/expansion-panels.html)是一个轻量级容器,既可以单独使用,也可以和卡片这样更大的平面相结合
1010

1111
## 简单的扩展面板
1212

@@ -20,6 +20,6 @@ components: ExpansionPanel, ExpansionPanelActions, ExpansionPanelDetails, Expans
2020

2121
## 受控手风琴
2222

23-
扩展默认面板行为以使用 ExpansionPanel </ code>组件创建手风琴。</p>
23+
扩展默认面板行为以使用` ExpansionPanel `组件创建手风琴。
2424

25-
<p>{{"demo": "pages/demos/expansion-panels/ControlledExpansionPanels.js"}}</p>
25+
{{"demo": "pages/demos/expansion-panels/ControlledExpansionPanels.js"}}

docs/src/pages/demos/lists/lists-zh.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ components: Collapse, Divider, List, ListItem, ListItemAvatar, ListItemIcon, Lis
1212

1313
{{"demo": "pages/demos/lists/SimpleList.js"}}
1414

15-
The last item of the previous demo shows how you can render a link:
15+
上一个样例的最后一项展示了如何渲染一个链接:
1616

1717
```jsx
1818
function ListItemLink(props) {
@@ -26,7 +26,7 @@ function ListItemLink(props) {
2626
</ListItemLink>
2727
```
2828

29-
You can find a [demo with React Router following this section](/guides/composition/#react-router) of the documentation.
29+
你可以从这里查看[React Router与文档此部分结合使用的相关样例](/guides/composition/#react-router)
3030

3131
## 文件夹列表
3232

@@ -46,29 +46,29 @@ You can find a [demo with React Router following this section](/guides/compositi
4646

4747
## 固定 Subheader 列表
4848

49-
Upon scrolling, subheaders remain pinned to the top of the screen until pushed off screen by the next subheader.
49+
滚动列表时,子标题保持固定在屏幕的顶端,直到被下一个子标题推离屏幕。
5050

51-
This feature is relying on the CSS sticky positioning. Unfortunately it's [not implemented](https://caniuse.com/#search=sticky) by all the browsers we are supporting. We default to `disableSticky` when not supported.
51+
此功能依赖于 CSS sticky 定位。 不幸的是, 这一功能并未在我们支持的所有浏览器中 [实现](https://caniuse.com/#search=sticky) 。 如果不支持, 则默认为 `disableSticky`
5252

5353
{{"demo": "pages/demos/lists/PinnedSubheaderList.js"}}
5454

5555
## 列表控件
5656

5757
### 复选框
5858

59-
A checkbox can either be a primary action or a secondary action.
59+
复选框可以是主操作或辅助操作。
6060

61-
The checkbox is the primary action and the state indicator for the list item. The comment button is a secondary action and a separate target.
61+
复选框是列表项的主要操作和状态指示器。 评论按钮是辅助操作和单独的目标。
6262

6363
{{"demo": "pages/demos/lists/CheckboxList.js"}}
6464

65-
The checkbox is the secondary action for the list item and a separate target.
65+
复选框是列表项的辅助操作和单独的目标。
6666

6767
{{"demo": "pages/demos/lists/CheckboxListSecondary.js"}}
6868

6969
### 开关
7070

71-
The switch is the secondary action and a separate target.
71+
开关是辅助操作和单独的目标。
7272

7373
{{"demo": "pages/demos/lists/SwitchListSecondary.js"}}
7474

docs/src/pages/demos/menus/menus-zh.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,20 @@ components: Menu, MenuItem, MenuList, ClickAwayListener, Popover, Popper
5656

5757
这是[render props](https://reactjs.org/docs/render-props.html) 的例子。保持跟踪单个菜单的本地状态。
5858

59-
{{"demo": "pages/demos/menus/RenderPropsMenu.js"}}
59+
{{"demo": "pages/demos/menus/RenderPropsMenu.js"}}
60+
61+
## 局限性
62+
63+
There is [a flexbox bug](https://bugs.chromium.org/p/chromium/issues/detail?id=327437) that prevents `text-overflow: ellipse` from working in a flexbox layout. You can use the `Typography` component to workaround this issue:
64+
65+
{{"demo": "pages/demos/menus/TypographyMenu.js"}}
66+
67+
## Complementary projects
68+
69+
For more advanced use cases you might be able to take advantage of:
70+
71+
### PopupState helper
72+
73+
There is a 3rd party package [`material-ui-popup-state`](https://github.com/jcoreio/material-ui-popup-state) that takes care of menu state for you in most cases.
74+
75+
{{"demo": "pages/demos/menus/MenuPopupState.js"}}

docs/src/pages/demos/pickers/pickers-zh.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 日期、时间选择器 React 组件
33
components: TextField
44
---
5-
# 选择器
5+
# Pickers
66

77
<p class="description">选择器提供了一种从预先设定的集合中选取单个值的简单方法。</p>
88

@@ -15,19 +15,19 @@ components: TextField
1515

1616
⚠️ 浏览器原生输入控件[并不完美](https://caniuse.com/#feat=input-datetime)
1717

18-
## 日期选择器
18+
## Date pickers
1919

2020
一个原生的 `type="date"` 日期选择器示例 ,它也可以用作日历:
2121

2222
{{"demo": "pages/demos/pickers/DatePickers.js"}}
2323

24-
## 时间选择器
24+
## Time pickers
2525

2626
一个原生的 `type="time"` 时间选择器示例 :
2727

2828
{{"demo": "pages/demos/pickers/TimePickers.js"}}
2929

30-
## 日期和时间选择器
30+
## Date & Time pickers
3131

3232
一个原生的 `type="datetime-local"` 日期和时间选择器示例 :
3333

docs/src/pages/demos/progress/progress-zh.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ components: CircularProgress, LinearProgress
6464
进度组件接受一个 0 - 100 范围的值。 作为默认的最小/最大值,这简化了屏幕阅读用户的使用。 但是有时,你可能会使用值超出这个范围的数据源。 这里告诉您如何轻松的将一个任意范围的值转换为0 - 100区间的值。
6565

6666
```jsx
67-
// MIN = 最小值
68-
// MAX = 最大值
69-
70-
// 正常化值的函数(MIN / MAX 可相互协调)
67+
// MIN = Minimum expected value
68+
// MAX = Maximium expected value
69+
// Function to normalise the values (MIN / MAX could be integrated)
7170
const normalise = value => (value - MIN) * 100 / (MAX - MIN);
7271

73-
// 在 render 函数中,利用`正常化`函数的示例组件
72+
// Example component that utilizes the `normalise` function at the point of render.
7473
function Progress(props) {
7574
return (
7675
<React.Fragment>
@@ -87,10 +86,18 @@ function Progress(props) {
8786

8887
{{"demo": "pages/demos/progress/DelayingAppearance.js"}}
8988

89+
## Customized Progress
90+
91+
The last demo demonstrates how you can build a Facebook like spinner.
92+
93+
{{"demo": "pages/demos/progress/CustomizedProgress.js"}}
94+
9095
## 局限性
9196

92-
在特别慢的加载时,可能丢失stroke dash动画或看到环形进度的半径随机的情况。 为了不阻塞主渲染进程,应该在web worker中或批处理中执行密集操作的处理器。
97+
Under heavy load, you might lose the stroke dash animation or see random CircularProgress ring widths. You should run processor intensive operations in a web worker or by batch in order not to block the main rendering thread.
98+
99+
![heavy load](/static/images/progress/heavy-load.gif)
93100

94-
![慢加载](/static/images/progress/heavy-load.gif)
101+
When it's not possible, you can leverage the `disableShrink` property to mitigate the issue. See https://github.com/mui-org/material-ui/issues/10327
95102

96-
https://github.com/mui-org/material-ui/issues/10327
103+
{{"demo": "pages/demos/progress/CircularUnderLoad.js"}}

0 commit comments

Comments
 (0)