Skip to content

Commit d922cb7

Browse files
committed
fix: 翻译新增内容
1 parent d23d64c commit d922cb7

File tree

28 files changed

+566
-534
lines changed

28 files changed

+566
-534
lines changed

src/cdk/a11y/a11y.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class MyComponent {
197197

198198
The `FocusMonitor` is an injectable service that can be used to listen for changes in the focus
199199
state of an element. It's more powerful than just listening for `focus` or `blur` events because it
200-
tells you how the element was focused \(via the mouse, keyboard, touch, or programmatically\). It also
200+
tells you how the element was focused (via the mouse, keyboard, touch, or programmatically). It also
201201
allows listening for focus on descendant elements if desired.
202202

203203
`FocusMonitor` 是一个可注入的服务,可以用来监听元素焦点状态的变化。它比单纯监听 `focus``blur` 事件更有意义,因为它会告诉你该元素是如何获得焦点的(通过鼠标,键盘,触摸或编程方式)。如果需要,它还允许监听各级子元素。
@@ -232,7 +232,7 @@ defaults to `false` if not specified. The `monitor` method will return an Observ
232232

233233
In addition to emitting on the observable, the `FocusMonitor` will automatically apply CSS classes
234234
to the element when focused. It will add `.cdk-focused` if the element is focused and will further
235-
add `.cdk-${origin}-focused` \(with `${origin}` being `mouse`, `keyboard`, `touch`, or `program`\) to
235+
add `.cdk-${origin}-focused` (with `${origin}` being `mouse`, `keyboard`, `touch`, or `program`) to
236236
indicate how the element was focused.
237237

238238
除了在可观察对象中发送信息之外,`FocusMonitor` 还会自动对有焦点的元素元素应用一些 CSS 类。如果该元素拥有焦点,它会添加 `.cdk-focused` 类,并进一步添加 `.cdk-${origin}-focused` 类来表明元素是如何获得焦点的( `${origin}``mouse``keyboard``touch``program` 之一)。
@@ -344,7 +344,7 @@ The `high-contrast` mixin accepts two optional parameters, `$target` and `$encap
344344
`high-contrast` 这个 mixin 接受两个可选参数 `$target``$encapsulation`
345345

346346
The `$target` parameter allows you to specify which variation of high contrast mode your style
347-
targets. The accepted values are `active` \(default\), `black-on-white`, and `white-on-black`. These
347+
targets. The accepted values are `active` (default), `black-on-white`, and `white-on-black`. These
348348
values correspond to the supported values for the
349349
[`-ms-high-contrast` media query][ms-high-contrast].
350350

src/cdk/bidi/bidi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ application's LTR/RTL layout direction.
88
### 方向性
99

1010
When including the CDK's `BidiModule`, components can inject `Directionality` to get the current
11-
text direction \(RTL or LTR\);
11+
text direction (RTL or LTR);
1212

1313
当包含 CDK 的 `BidiModule` 时,组件中就可以注入 `Directionality` 来获取当前的文本方向了(RTL 或者 LTR);
1414

@@ -58,8 +58,8 @@ context.
5858
The CDK also supports the native `auto` value for the `dir` attribute, however there's a difference
5959
in how it is interpreted. Some parts of the CDK, like overlays and keyboard navigation, need to know
6060
if the element is in an RTL or LTR layout in order to work correctly. For performance reasons, we
61-
resolve the `auto` value by looking at the browser's language \(`navigator.language`\) and matching
61+
resolve the `auto` value by looking at the browser's language (`navigator.language`) and matching
6262
it against a set of known RTL locales. This differs from the way the browser handles it, which is
6363
based on the text content of the element.
6464

65-
CDK 还支持 `dir` 属性的原生 `auto` 值,但是它的解释方式有所不同。 CDK 的某些部分,如浮层和键盘导航,需要知道元素是在 RTL 还是 LTR 布局中才能正常工作。出于性能原因,我们通过查看浏览器的语言 \(`navigator.language` \) 并将其与一组已知的 RTL 语言环境进行匹配来解析 `auto` 值。这与浏览器处理它的方式不同,后者会基于元素的文本内容。
65+
CDK 还支持 `dir` 属性的原生 `auto` 值,但是它的解释方式有所不同。 CDK 的某些部分,如浮层和键盘导航,需要知道元素是在 RTL 还是 LTR 布局中才能正常工作。出于性能原因,我们通过查看浏览器的语言 (`navigator.language` ) 并将其与一组已知的 RTL 语言环境进行匹配来解析 `auto` 值。这与浏览器处理它的方式不同,后者会基于元素的文本内容。

src/cdk/dialog/dialog.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,17 @@ You can customize which element receives focus with the `autoFocus` property of
220220

221221
打开时, `Dialog` 会捕获浏览器焦点,使其无法离开带有 `role="dialog"` 的根元素。默认情况下,对话框中的第一个可 tab 到的元素会获得焦点。你可以使用 `DialogConfig``autoFocus` 属性来自定义哪个元素接收焦点,该属性支持以下值。
222222

223-
| Value | Behavior |
224-
| ---------------- | ---------------------------------------------------------------------- |
225-
|| 行为 |
226-
| `first-tabbable` | Focus the first tabbable element. This is the default setting. |
227-
| `first-tabbable` | 聚焦第一个可 tab 到的元素。这是默认设置。 |
228-
| `first-header` | Focus the first header element \(`role="heading"`, `h1` through `h6`\) |
229-
| `first-header` | 聚焦第一个标题元素( `role="heading"``h1``h6` |
230-
| `dialog` | Focus the root `role="dialog"` element. |
231-
| `dialog` | 聚焦根 `role="dialog"` 元素。 |
232-
| Any CSS selector | Focus the first element matching the given selector. |
233-
| 任何 CSS 选择器 | 聚焦与给定选择器匹配的第一个元素。 |
223+
| Value | Behavior |
224+
| ---------------- | -------------------------------------------------------------------- |
225+
|| 行为 |
226+
| `first-tabbable` | Focus the first tabbable element. This is the default setting. |
227+
| `first-tabbable` | 聚焦第一个可 tab 到的元素。这是默认设置。 |
228+
| `first-header` | Focus the first header element (`role="heading"`, `h1` through `h6`) |
229+
| `first-header` | 聚焦第一个标题元素( `role="heading"``h1``h6`|
230+
| `dialog` | Focus the root `role="dialog"` element. |
231+
| `dialog` | 聚焦根 `role="dialog"` 元素。 |
232+
| Any CSS selector | Focus the first element matching the given selector. |
233+
| 任何 CSS 选择器 | 聚焦与给定选择器匹配的第一个元素。 |
234234

235235
While the default setting applies the best behavior for most applications, special cases may benefit
236236
from these alternatives. Always test your application to verify the behavior that works best for

src/cdk/listbox/listbox.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ The directives in `@angular/cdk/listbox` set the appropriate roles on their host
1717

1818
`@angular/cdk/listbox` 中的指令在其宿主元素上设置适当的角色。
1919

20-
| Directive | ARIA Role |
21-
| --------- |-----------|
22-
| 指令 | ARIA 角色 |
23-
| cdkOption | option |
20+
| Directive | ARIA Role |
21+
| ---------- | --------- |
22+
| 指令 | ARIA 角色 |
23+
| cdkOption | option |
2424
| cdkListbox | listbox |
2525

2626
### CSS Styles and Classes
@@ -34,43 +34,43 @@ The available CSS classes are listed below, by directive.
3434

3535
`@angular/cdk/listbox` 旨在根据你的需要进行高度定制。因此,它不会对元素的样式进行任何假设。你应该应用任何所需的 CSS 样式,但这些指令确实应用了 CSS 类,以便你更轻松地添加自定义样式。下面按指令列出了可用的 CSS 类。
3636

37-
| Directive | CSS Class | Applied... |
38-
| :-------- |-------------------| ---------- |
39-
| 指令 | CSS 类 | 何时应用 |
40-
| cdkOption | .cdk-option | Always |
41-
| cdkOption | .cdk-option | 总是 |
42-
| cdkOption | .cdk-option-active | If the option is active |
43-
| cdkOption | .cdk-option-active | 如果选项处于活动状态 |
44-
| cdkListbox | .cdk-listbox | Always |
45-
| cdkListbox | .cdk-listbox | 总是 |
37+
| Directive | CSS Class | Applied... |
38+
| :--------- | ------------------ | ----------------------- |
39+
| 指令 | CSS 类 | 何时应用 |
40+
| cdkOption | .cdk-option | Always |
41+
| cdkOption | .cdk-option | 总是 |
42+
| cdkOption | .cdk-option-active | If the option is active |
43+
| cdkOption | .cdk-option-active | 如果选项处于活动状态 |
44+
| cdkListbox | .cdk-listbox | Always |
45+
| cdkListbox | .cdk-listbox | 总是 |
4646

4747
In addition to CSS classes, these directives add aria attributes that can be targeted in CSS.
4848

4949
除了 CSS 类之外,这些指令还添加了可以在 CSS 中定位的 aria 属性。
5050

51-
| Directive | Attribute Selector | Applied... |
52-
| :-------- |----------------------------------| ---------- |
53-
| 指令 | Attribute 选择器 | 何时应用 |
54-
| cdkOption | \[aria-disabled="true"] | If the option is disabled |
55-
| cdkOption | \[aria-disabled="true"] | 如果该选项已禁用 |
56-
| cdkOption | \[aria-disabled="false"] | If the option is not disabled |
57-
| cdkOption | \[aria-disabled="false"] | 如果该选项未禁用 |
58-
| cdkOption | \[aria-selected="true"] | If the option is selected |
59-
| cdkOption | \[aria-selected="true"] | 如果选定了该选项 |
60-
| cdkOption | \[aria-selected="false"] | If the option is not selected |
61-
| cdkOption | \[aria-selected="false"] | 如果未选定该选项 |
62-
| cdkListbox | \[aria-disabled="true"] | If the listbox is disabled |
63-
| cdkListbox | \[aria-disabled="true"] | 如果列表框已禁用 |
64-
| cdkListbox | \[aria-disabled="false"] | If the listbox is not disabled |
65-
| cdkListbox | \[aria-disabled="false"] | 如果列表框没有禁用 |
66-
| cdkListbox | \[aria-multiselectable="true"] | If the listbox is multiple selection |
67-
| cdkListbox | \[aria-multiselectable="true"] | 如果列表框是多选 |
68-
| cdkListbox | \[aria-multiselectable="false"] | If the listbox is single selection |
69-
| cdkListbox | \[aria-multiselectable="false"] | 如果列表框是单选 |
51+
| Directive | Attribute Selector | Applied... |
52+
| :--------- | -------------------------------- | --------------------------------------- |
53+
| 指令 | Attribute 选择器 | 何时应用 |
54+
| cdkOption | \[aria-disabled="true"] | If the option is disabled |
55+
| cdkOption | \[aria-disabled="true"] | 如果该选项已禁用 |
56+
| cdkOption | \[aria-disabled="false"] | If the option is not disabled |
57+
| cdkOption | \[aria-disabled="false"] | 如果该选项未禁用 |
58+
| cdkOption | \[aria-selected="true"] | If the option is selected |
59+
| cdkOption | \[aria-selected="true"] | 如果选定了该选项 |
60+
| cdkOption | \[aria-selected="false"] | If the option is not selected |
61+
| cdkOption | \[aria-selected="false"] | 如果未选定该选项 |
62+
| cdkListbox | \[aria-disabled="true"] | If the listbox is disabled |
63+
| cdkListbox | \[aria-disabled="true"] | 如果列表框已禁用 |
64+
| cdkListbox | \[aria-disabled="false"] | If the listbox is not disabled |
65+
| cdkListbox | \[aria-disabled="false"] | 如果列表框没有禁用 |
66+
| cdkListbox | \[aria-multiselectable="true"] | If the listbox is multiple selection |
67+
| cdkListbox | \[aria-multiselectable="true"] | 如果列表框是多选 |
68+
| cdkListbox | \[aria-multiselectable="false"] | If the listbox is single selection |
69+
| cdkListbox | \[aria-multiselectable="false"] | 如果列表框是单选 |
7070
| cdkListbox | \[aria-orientation="horizontal"] | If the listbox is oriented horizontally |
71-
| cdkListbox | \[aria-orientation="horizontal"] | 如果列表框是水平的 |
72-
| cdkListbox | \[aria-orientation="vertical"] | If the listbox is oriented vertically |
73-
| cdkListbox | \[aria-orientation="vertical"] | 如果列表框是垂直的 |
71+
| cdkListbox | \[aria-orientation="horizontal"] | 如果列表框是水平的 |
72+
| cdkListbox | \[aria-orientation="vertical"] | If the listbox is oriented vertically |
73+
| cdkListbox | \[aria-orientation="vertical"] | 如果列表框是垂直的 |
7474

7575
### Getting started
7676

@@ -102,7 +102,7 @@ following directives:
102102

103103
Each option in a listbox is bound to the value it represents when selected, e.g.
104104
`<li cdkOption="red">Red</li>`. Within a single listbox, each option must have a unique value. If
105-
an option is not explicitly given a value, its value is considered to be `''` \(empty string\), e.g.
105+
an option is not explicitly given a value, its value is considered to be `''` (empty string), e.g.
106106
`<li cdkOption>No color preference</li>`.
107107

108108
列表框中的每个选项都会绑定到它在被选中时代表的值,例如 `<li cdkOption="red">Red</li>` 。在单个列表框中,每个选项都必须具有唯一值。如果一个选项没有被明确地赋予一个值,它的值被认为是 `''` (空字符串),例如 `<li cdkOption>No color preference</li>`
@@ -132,7 +132,7 @@ Listboxes only support a single selected option at a time by default, but adding
132132

133133
### 列表框的值
134134

135-
The listbox's value is an array containing the values of the selected option\(s\). This is true even
135+
The listbox's value is an array containing the values of the selected option(s). This is true even
136136
for the single selection listbox, whose value is an array containing a single element. The listbox's
137137
value can be bound using `[cdkListboxValue]` and `(cdkListboxValueChange)`.
138138

@@ -226,7 +226,7 @@ listbox element.
226226
The directives defined in `@angular/cdk/listbox` follow accessibility best practices as defined
227227
in the [ARIA spec][aria]. Keyboard interaction is supported as defined in the
228228
[ARIA listbox keyboard interaction spec][keyboard] _without_ the optional selection follows focus
229-
logic \(TODO: should we make this an option?\).
229+
logic (TODO: should we make this an option?).
230230

231231
`@angular/cdk/listbox` 中定义的指令遵循[ARIA 规范][aria]中定义的无障碍性最佳实践。支持键盘交互,如[ARIA 列表框键盘交互规范][keyboard]中所定义,*没有*可选的选择结果会遵循焦点逻辑(TODO:我们应该将其作为一个选项吗?)。
232232

@@ -277,7 +277,7 @@ will still need to adjust your CSS styles to change the visual appearance.
277277
#### 预先输入选项
278278

279279
The CDK listbox supports typeahead based on the option text. If the typeahead text for your options
280-
needs to be different than the display text \(e.g. to exclude emoji\), this can be accomplished by
280+
needs to be different than the display text (e.g. to exclude emoji), this can be accomplished by
281281
setting the `cdkOptionTypeaheadLabel` on the option.
282282

283283
CDK 列表框支持基于选项文本的预先输入。如果选项的预先输入文本需要与显示文本不同(例如,排除表情符号),这可以通过在选项上设置 `cdkOptionTypeaheadLabel` 来实现。

src/cdk/menu/menu.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ The directives in `@angular/cdk/menu` set the appropriate roles on their host el
1717

1818
`@angular/cdk/menu` 中的指令在其宿主元素上设置适当的角色。
1919

20-
| Directive | ARIA Role |
21-
| --------- |------------------|
22-
| 指令 | ARIA 角色 |
23-
| CdkMenuBar | menubar |
24-
| CdkMenu | menu |
25-
| CdkMenuGroup | group |
26-
| CdkMenuItem | menuitem |
27-
| CdkMenuItemRadio | menuitemradio |
20+
| Directive | ARIA Role |
21+
| ------------------- | ---------------- |
22+
| 指令 | ARIA 角色 |
23+
| CdkMenuBar | menubar |
24+
| CdkMenu | menu |
25+
| CdkMenuGroup | group |
26+
| CdkMenuItem | menuitem |
27+
| CdkMenuItemRadio | menuitemradio |
2828
| CdkMenuItemCheckbox | menuitemcheckbox |
29-
| CdkMenuTrigger | button |
29+
| CdkMenuTrigger | button |
3030

3131
### CSS Styles and Classes
3232

@@ -324,7 +324,7 @@ feature for a menu and its sub-menus, add the `cdkMenuTargetAim` directive to th
324324
![menu aim diagram][diagram]
325325

326326
As demonstrated in the diagram above we first track the user's mouse movements within a menu. Next,
327-
when a user mouses into a sibling menu item \(e.g. Share button\) the sibling item asks the Menu Aim
327+
when a user mouses into a sibling menu item (e.g. Share button) the sibling item asks the Menu Aim
328328
service if it can perform its close actions. In order to determine if the current submenu can be
329329
closed out, the Menu Aim service calculates the slope between a selected target coordinate in the
330330
submenu and the previous mouse point, and the slope between the target and the current mouse point.

src/cdk/overlay/overlay.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ application.
130130
`RepositionScrollStrategy` 会在滚动时重新定位浮层元素。注意,这会对滚动带来一些性能影响 - 用户应该在每个具体应用的上下文中权衡这种代价。
131131

132132
A custom scroll strategy can be created by implementing the `ScrollStrategy` interface. Each
133-
strategy will typically inject `ScrollDispatcher` \(from `@angular/cdk/scrolling`\) to be notified
133+
strategy will typically inject `ScrollDispatcher` (from `@angular/cdk/scrolling`) to be notified
134134
of when scrolling takes place. See the documentation for `ScrollDispatcher` for more information
135135
on how scroll events are detected and dispatched.
136136

0 commit comments

Comments
 (0)