Skip to content

Commit 3d7e35f

Browse files
committed
fix(adev): 翻译文档框架
1 parent e5de410 commit 3d7e35f

File tree

105 files changed

+1031
-1004
lines changed

Some content is hidden

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

105 files changed

+1031
-1004
lines changed

adev/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ APPLICATION_FILES = [
2525
"//adev/src/assets:content",
2626
"//adev/src/assets:context",
2727
"//adev/src/content/examples:embeddable",
28+
"//adev/src/assets/css",
29+
"//adev/src/assets/fonts",
2830
] + glob(
2931
["src/**/*"],
3032
exclude = ["src/**/*.spec.ts"],

adev/angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
},
4747
"configurations": {
4848
"production": {
49-
"outputHashing": "all"
49+
"outputHashing": "all",
50+
"ssr": false
5051
},
5152
"development": {
5253
"optimization": false,

adev/shared-docs/components/cookie-popup/cookie-popup.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
@if (!hasAccepted()) {
22
<div class="docs-cookies-popup docs-invert-mode">
3-
<p>This site uses cookies from Google to deliver its services and to analyze traffic.</p>
3+
<p>本网站使用 Google 的 Cookie 来提供服务并分析流量。</p>
44

55
<div>
66
<a href="https://policies.google.com/technologies/cookies" target="_blank" rel="noopener">
7-
<button class="docs-primary-btn" [attr.text]="'Learn more'" aria-label="Learn More">
8-
Learn more
7+
<button class="docs-primary-btn" [attr.text]="'了解更多'" aria-label="了解更多">
8+
了解更多
99
</button>
1010
</a>
1111
<button
1212
type="button"
1313
(click)="accept()"
1414
class="docs-primary-btn"
15-
[attr.text]="'Ok, Got it'"
16-
aria-label="Ok, Got it"
15+
[attr.text]="'好的,我知道了'"
16+
aria-label="好的,我知道了"
1717
>
18-
Ok, Got it
18+
好的,我知道了
1919
</button>
2020
</div>
2121
</div>

adev/shared-docs/components/navigation-list/navigation-list.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<button
7676
type="button"
7777
(click)="toggle(item)"
78-
[attr.aria-label]="(item.isExpanded ? 'Collapse' : 'Expand') + ' ' + item.label"
78+
[attr.aria-label]="(item.isExpanded ? '收起' : '展开') + ' ' + item.label"
7979
[attr.aria-expanded]="item.isExpanded"
8080
class="docs-secondary-nav-button"
8181
[class.docs-faceted-list-item-active]="item | isActiveNavigationItem: activeItem()"
@@ -111,8 +111,8 @@
111111

112112
<ng-template let-item #itemStatus>
113113
@if (item.status === 'new') {
114-
<span class="tag docs-new-item">New</span>
114+
<span class="tag docs-new-item">新增</span>
115115
} @else if (item.status === 'updated') {
116-
<span class="tag docs-updated-item">Updated</span>
116+
<span class="tag docs-updated-item">已更新</span>
117117
}
118118
</ng-template>

adev/shared-docs/components/search-dialog/search-dialog.component.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[autofocus]="true"
55
[hideIcon]="true"
66
[formControl]="searchControl"
7-
[resetLabel]="'Clear the search'"
7+
[resetLabel]="'清除搜索'"
88
class="docs-search-input"
9-
placeholder="Search docs"
9+
placeholder="搜索文档"
1010
/>
1111

1212
@if (searchResults().length) {
@@ -51,11 +51,11 @@
5151
<div class="docs-search-results docs-mini-scroll-track">
5252
@if (!resultsResource.hasValue()) {
5353
<div class="docs-search-results__start-typing">
54-
<span>Start typing to see results</span>
54+
<span>开始输入以查看结果</span>
5555
</div>
5656
} @else if (searchResults().length === 0) {
5757
<div class="docs-search-results__no-results">
58-
<span>No results found</span>
58+
<span>未找到结果</span>
5959
</div>
6060
}
6161
</div>
@@ -64,8 +64,9 @@
6464
<div class="docs-search-footer">
6565
<ul class="docs-search-commands">
6666
<li>
67+
6768
<kbd class="docs-search-commands-key">
68-
<svg width="15" height="15" aria-label="Enter key" role="img">
69+
<svg width="15" height="15" aria-label="回车键" role="img">
6970
<g
7071
fill="none"
7172
stroke="currentColor"
@@ -77,11 +78,12 @@
7778
</g>
7879
</svg>
7980
</kbd>
80-
<span>to select</span>
81+
<span>选取</span>
8182
</li>
8283
<li>
84+
8385
<kbd class="docs-search-commands-key">
84-
<svg width="15" height="15" aria-label="Arrow down" role="img">
86+
<svg width="15" height="15" aria-label="向下箭头" role="img">
8587
<g
8688
fill="none"
8789
stroke="currentColor"
@@ -94,7 +96,7 @@
9496
</svg>
9597
</kbd>
9698
<kbd class="docs-search-commands-key">
97-
<svg width="15" height="15" aria-label="Arrow up" role="img">
99+
<svg width="15" height="15" aria-label="向上箭头" role="img">
98100
<g
99101
fill="none"
100102
stroke="currentColor"
@@ -106,11 +108,11 @@
106108
</g>
107109
</svg>
108110
</kbd>
109-
<span>to navigate</span>
111+
<span>导航</span>
110112
</li>
111113
<li>
112114
<kbd class="docs-search-commands-key"
113-
><svg width="15" height="15" aria-label="Escape key" role="img">
115+
><svg width="15" height="15" aria-label="Escape " role="img">
114116
<g
115117
fill="none"
116118
stroke="currentColor"
@@ -124,18 +126,19 @@
124126
</g>
125127
</svg>
126128
</kbd>
127-
<span>to close</span>
129+
<span>关闭</span>
128130
</li>
129131
</ul>
130132
<div class="docs-algolia">
131-
<span>Search by</span>
133+
<span></span>
132134
<a
133135
target="_blank"
134136
rel="noopener"
135137
href="https://www.algolia.com/developers/?utm_source=angular.dev&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"
136138
>
137139
<docs-algolia-icon />
138140
</a>
141+
<span>提供搜索支持</span>
139142
</div>
140143
</div>
141144
</div>

adev/shared-docs/components/search-history/search-history.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@let items = history.items();
22

33
@if (items.recent.length) {
4-
<p class="title">Recent</p>
4+
<p class="title">最近</p>
55
<ul class="history-results recent">
66
@for (item of items.recent; track item.id; let idx = $index) {
77
<li docsSearchItem [item]="item" (mouseenter)="onMouseEnter($event, idx)">
@@ -18,15 +18,15 @@
1818
type="button"
1919
class="fav-btn"
2020
(click)="history.makeFavorite(item)"
21-
title="Make favorite"
21+
title="收藏"
2222
>
2323
<i role="presentation" class="material-symbols-outlined" aria-hidden="true"> star </i>
2424
</button>
2525
<button
2626
type="button"
2727
class="remove-btn"
2828
(click)="history.removeItem(item)"
29-
title="Remove item"
29+
title="移除"
3030
>
3131
<i role="presentation" class="material-symbols-outlined" aria-hidden="true"> close </i>
3232
</button>
@@ -36,7 +36,7 @@
3636
}
3737

3838
@if (items.favorite.length) {
39-
<p class="title">Favorite</p>
39+
<p class="title">收藏</p>
4040
<ul class="history-results favorite">
4141
@for (item of items.favorite; track item.id; let idx = $index) {
4242
<li
@@ -56,7 +56,7 @@
5656
type="button"
5757
class="remove-btn"
5858
(click)="history.removeItem(item)"
59-
title="Remove item"
59+
title="移除"
6060
>
6161
<i role="presentation" class="material-symbols-outlined" aria-hidden="true"> close </i>
6262
</button>

adev/shared-docs/components/table-of-contents/table-of-contents.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<aside>
22
<nav>
33
<header>
4-
<h2 class="docs-title">On this page</h2>
4+
<h2 class="docs-title">在本页中</h2>
55
</header>
66
<ul class="docs-faceted-list">
77
<!-- TODO: Hide li elements with class docs-toc-item-h3 for laptop, table and phone screen resolutions -->
@@ -18,6 +18,6 @@ <h2 class="docs-title">On this page</h2>
1818
</nav>
1919
<button type="button" (click)="scrollToTop()">
2020
<docs-icon role="presentation">arrow_upward_alt</docs-icon>
21-
Back to the top
21+
返回顶部
2222
</button>
23-
</aside>
23+
</aside>

adev/shared-docs/components/viewers/example-viewer/example-viewer.component.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
role="switch"
2424
class="docs-example-code-toggle"
2525
[attr.aria-checked]="showCode()"
26-
[attr.aria-label]="showCode() ? 'Hide code' : 'Show code'"
26+
[attr.aria-label]="showCode() ? '隐藏代码' : '显示代码'"
2727
(click)="showCode.set(!showCode())"
28-
[matTooltip]="showCode() ? 'Hide code' : 'Show code'"
28+
[matTooltip]="showCode() ? '隐藏代码' : '显示代码'"
2929
matTooltipPosition="above"
3030
>
3131
<docs-icon>{{showCode() ? 'code_off' : 'code'}}</docs-icon>
3232
</button>
3333
<button
3434
type="button"
3535
class="docs-example-copy-link"
36-
[attr.aria-label]="'Copy link to ' + exampleMetadata()?.title + ' example to the clipboard'"
36+
[attr.aria-label]="'' + exampleMetadata()?.title + ' 示例的链接复制到剪贴板'"
3737
(click)="copyLink()"
38-
matTooltip="Copy link to example"
38+
matTooltip="复制示例链接"
3939
matTooltipPosition="above"
4040
>
4141
<i aria-hidden="true">
@@ -60,8 +60,8 @@
6060
<button
6161
type="button"
6262
(click)="toggleExampleVisibility()"
63-
[attr.aria-label]="(expanded() ? 'Collapse' : 'Expand') + ' code example'"
64-
matTooltip="{{ expanded() ? 'Collapse' : 'Expand' }} example"
63+
[attr.aria-label]="(expanded() ? '收起' : '展开') + ' 代码示例'"
64+
matTooltip="{{ expanded() ? '收起' : '展开' }}示例"
6565
matTooltipPosition="above"
6666
>
6767
<i aria-hidden="true">
@@ -123,8 +123,8 @@
123123
[href]="githubUrl()"
124124
target="_blank"
125125
class="docs-example-github-link"
126-
aria-label="Open example on GitHub"
127-
matTooltip="Open example on GitHub"
126+
aria-label="GitHub 上打开示例"
127+
matTooltip="GitHub 上打开示例"
128128
matTooltipPosition="above"
129129
>
130130
<i aria-hidden="true">
@@ -151,8 +151,8 @@
151151
[href]="stackblitzUrl()"
152152
target="_blank"
153153
class="docs-example-stackblitz-link"
154-
aria-label="Edit example in StackBlitz"
155-
matTooltip="Edit example in StackBlitz"
154+
aria-label="StackBlitz 中编辑示例"
155+
matTooltip="StackBlitz 中编辑示例"
156156
matTooltipPosition="above"
157157
>
158158
<i aria-hidden="true">

adev/src/app/app.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<button (click)="focusFirstHeading()" class="adev-skip">Skip to main content</button>
1+
<button (click)="focusFirstHeading()" class="adev-skip">跳转到主要内容</button>
22

33
@defer (when isBrowser) {
44
<adev-progress-bar />
5-
<docs-top-level-banner expiry="2024-12-10" id="state-of-js-2024" link="https://survey.devographics.com/en-US/survey/state-of-js/2024?source=angular_homepage" text="Share your experience with Angular in The State of JavaScript 2024 survey" />
5+
<docs-top-level-banner expiry="2024-12-10" id="state-of-js-2024" link="https://survey.devographics.com/en-US/survey/state-of-js/2024?source=angular_homepage" text="The State of JavaScript 2024 survey 中分享您的 Angular 体验" />
66
}
77

88
<div class="adev-nav"></div>

0 commit comments

Comments
 (0)