Skip to content

Commit d6eccf8

Browse files
author
Zhicheng WANG
committed
feat: 翻译 API 模板
1 parent 6c0a194 commit d6eccf8

10 files changed

+35
-35
lines changed

tools/dgeni/templates/class.template.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ <h4 id="{$ class.name $}" class="docs-header-link docs-api-h4 docs-api-class-nam
1414
</h4>
1515

1616
{%- if class.description -%}
17-
<p class="docs-api-class-description">{$ class.description | marked | safe $}</p>
17+
<div class="docs-api-class-description">{$ class.description | marked | safe $}</div>
1818
{%- endif -%}
1919

2020
{%- if class.directiveSelectors -%}
21-
<p class="docs-api-directive-selectors">
22-
<span class="docs-api-class-selector-label">Selector:</span>
21+
<div class="docs-api-directive-selectors">
22+
<span class="docs-api-class-selector-label">选择器:</span>
2323
{% for selector in class.directiveSelectors %}
2424
<span class="docs-api-class-selector-name">{$ selector $}</span>
2525
{% endfor %}
26-
</p>
26+
</div>
2727
{%- endif -%}
2828

2929
{%- if class.directiveExportAs -%}
30-
<span class="docs-api-class-export-label">Exported as:</span>
30+
<span class="docs-api-class-export-label">导出为:</span>
3131
<span class="docs-api-class-export-name">{$ class.directiveExportAs $}</span>
3232
{%- endif -%}
3333

3434
{%- if class.isDeprecated -%}
3535
<div class="docs-api-class-deprecated-marker" {$ macros.deprecationTitle(class) $}>
36-
Deprecated
36+
已弃用
3737
</div>
3838
{%- endif -%}
3939

tools/dgeni/templates/constant.template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ <h4 id="{$ constant.name $}" class="docs-header-link docs-api-h4 docs-api-consta
77

88
{%- if constant.isDeprecated -%}
99
<div class="docs-api-constant-deprecated-marker" {$ macros.deprecationTitle(constant) $}>
10-
Deprecated
10+
已弃用
1111
</div>
1212
{%- endif -%}
1313

1414
{%- if constant.description -%}
15-
<p class="docs-api-constant-description">{$ constant.description | marked | safe $}</p>
15+
<div class="docs-api-constant-description">{$ constant.description | marked | safe $}</div>
1616
{%- endif -%}
1717

1818
<div class="docs-markdown">

tools/dgeni/templates/entry-point.template.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
<div class="docs-api">
3535
<h2>
36-
API reference for Angular {$ doc.packageDisplayName $} {$ doc.displayName $}
36+
Angular {$ doc.packageDisplayName $} {$ doc.displayName $} API 参考文档
3737
</h2>
3838

3939
<p class="docs-api-module-import">
@@ -45,7 +45,7 @@ <h2>
4545
{%- if doc.services.length -%}
4646
<h3 id="{$ doc.name $}-services" class="docs-header-link docs-api-h3">
4747
<span header-link="services"></span>
48-
Services
48+
服务
4949
</h3>
5050
{% for service in doc.services %}
5151
{$ class(service) $}
@@ -56,7 +56,7 @@ <h3 id="{$ doc.name $}-services" class="docs-header-link docs-api-h3">
5656
{%- if doc.directives.length -%}
5757
<h3 id="{$ doc.name $}-directives" class="docs-header-link docs-api-h3">
5858
<span header-link="directives"></span>
59-
Directives
59+
指令
6060
</h3>
6161
{% for directive in doc.directives %}
6262
{$ class(directive) $}
@@ -66,7 +66,7 @@ <h3 id="{$ doc.name $}-directives" class="docs-header-link docs-api-h3">
6666
{%- if doc.classes.length -%}
6767
<h3 id="{$ doc.name $}-classes" class="docs-header-link docs-api-h3">
6868
<span header-link="classes"></span>
69-
Classes
69+
7070
</h3>
7171
{% for other in doc.classes %}
7272
{$ class(other) $}
@@ -76,7 +76,7 @@ <h3 id="{$ doc.name $}-classes" class="docs-header-link docs-api-h3">
7676
{%- if doc.interfaces.length -%}
7777
<h3 id="{$ doc.name $}-interfaces" class="docs-header-link docs-api-h3">
7878
<span header-link="interfaces"></span>
79-
Interfaces
79+
接口
8080
</h3>
8181
{% for item in doc.interfaces %}
8282
{$ interface(item) $}
@@ -86,7 +86,7 @@ <h3 id="{$ doc.name $}-interfaces" class="docs-header-link docs-api-h3">
8686
{%- if doc.functions.length -%}
8787
<h3 id="{$ doc.name $}-functions" class="docs-header-link docs-api-h3">
8888
<span header-link="functions"></span>
89-
Functions
89+
函数
9090
</h3>
9191
{% for item in doc.functions %}
9292
{#
@@ -100,7 +100,7 @@ <h3 id="{$ doc.name $}-functions" class="docs-header-link docs-api-h3">
100100
{%- if doc.typeAliases.length -%}
101101
<h3 id="{$ doc.name $}-type_aliases" class="docs-header-link docs-api-h3">
102102
<span header-link="type_aliases"></span>
103-
Type aliases
103+
类型别名
104104
</h3>
105105
{% for item in doc.typeAliases %}
106106
{$ typeAlias(item) $}
@@ -110,7 +110,7 @@ <h3 id="{$ doc.name $}-type_aliases" class="docs-header-link docs-api-h3">
110110
{%- if doc.constants.length -%}
111111
<h3 id="{$ doc.name $}-constants" class="docs-header-link docs-api-h3">
112112
<span header-link="constants"></span>
113-
Constants
113+
常量
114114
</h3>
115115
{% for item in doc.constants %}
116116
{$ constant(item) $}

tools/dgeni/templates/interface.template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ <h4 id="{$ interface.name $}" class="docs-header-link docs-api-h4 docs-api-inter
66
</h4>
77

88
{%- if interface.description -%}
9-
<p class="docs-api-interface-description">{$ interface.description | marked | safe $}</p>
9+
<div class="docs-api-interface-description">{$ interface.description | marked | safe $}</div>
1010
{%- endif -%}
1111

1212
{%- if interface.isDeprecated -%}
1313
<div class="docs-api-interface-deprecated-marker" {$ macros.deprecationTitle(interface) $}>
14-
Deprecated
14+
已弃用
1515
</div>
1616
{%- endif -%}
1717

tools/dgeni/templates/macros.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% macro deprecationTitle(doc) %}
22
{%- if doc.breakingChange -%}
3-
title="Will be deleted in v{$ doc.breakingChange $}"
3+
title="将会在 v{$ doc.breakingChange $} 中删除"
44
{%- endif -%}
55
{% endmacro %}

tools/dgeni/templates/method-list.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{%- if methodList.length -%}
2-
<h5 class="docs-api-h5 docs-api-method-header">Methods</h5>
2+
<h5 class="docs-api-h5 docs-api-method-header">方法</h5>
33
{% for m in methodList %}
44
{$ method(m) $}
55
{% endfor %}

tools/dgeni/templates/method.template.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<th colspan="2" class="docs-api-method-name-cell">
77
{%- if method.isDeprecated -%}
88
<div class="docs-api-deprecated-marker" {$ macros.deprecationTitle(method) $}>
9-
Deprecated
9+
已弃用
1010
</div>
1111
{%- endif -%}
1212
{%- if method.isAsync -%}
1313
<div class="docs-api-async-method-marker">
14-
async
14+
异步
1515
</div>
1616
{%- endif -%}
1717
{$ method.name $}
@@ -29,7 +29,7 @@
2929
{%- if method.params.length -%}
3030
<thead>
3131
<tr class="docs-api-method-parameters-header-row">
32-
<th colspan="2" class="docs-api-method-parameters-header-cell">Parameters</th>
32+
<th colspan="2" class="docs-api-method-parameters-header-cell">参数</th>
3333
</tr>
3434
</thead>
3535
{% for parameter in method.params %}
@@ -44,9 +44,9 @@
4444
<code class="docs-api-method-parameter-type">{$ parameter.type $}</code>
4545
</td>
4646
<td class="docs-api-method-parameter-description-cell">
47-
<p class="docs-api-method-parameter-description">
47+
<div class="docs-api-method-parameter-description">
4848
{$ parameter.description | marked | safe $}
49-
</p>
49+
</div>
5050
</td>
5151
</tr>
5252
{% endfor %}
@@ -55,17 +55,17 @@
5555
{%- if method.type and method.type !== "void" -%}
5656
<thead>
5757
<tr class="docs-api-method-returns-header-row">
58-
<th colspan="2" class="docs-api-method-returns-header-cell">Returns</th>
58+
<th colspan="2" class="docs-api-method-returns-header-cell">返回值</th>
5959
</tr>
6060
</thead>
6161
<tr>
6262
<td class="docs-api-method-returns-type-cell">
6363
<code class="docs-api-method-returns-type">{$ method.type $}</code>
6464
</td>
6565
<td class="docs-api-method-returns-description-cell">
66-
<p class="docs-api-method-returns-description">
66+
<div class="docs-api-method-returns-description">
6767
{$ method.returns.description | marked | safe $}
68-
</p>
68+
</div>
6969
</td>
7070
</tr>
7171
{%- endif -%}

tools/dgeni/templates/property-list.template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{%- if propertyList.length -%}
2-
<h5 class="docs-api-h5 docs-api-method-header">Properties</h5>
2+
<h5 class="docs-api-h5 docs-api-method-header">属性</h5>
33
<table class="docs-api-properties-table">
44
<tr class="docs-api-properties-header-row">
5-
<th class="docs-api-properties-th">Name</th>
6-
<th class="docs-api-properties-th">Description</th>
5+
<th class="docs-api-properties-th">名称</th>
6+
<th class="docs-api-properties-th">描述</th>
77
</tr>
88
{% for p in propertyList %}
99
{$ property(p) $}

tools/dgeni/templates/property.template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
{%- endif -%}
2323
{%- if property.isDeprecated -%}
2424
<div class="docs-api-deprecated-marker" {$ macros.deprecationTitle(property) $}>
25-
Deprecated
25+
已弃用
2626
</div>
27-
{%- endif -%}
27+
{%- endif -%}
2828

2929
<p class="docs-api-property-name">
3030
<code>{$ property.name $}: {$ property.type $}</code>

tools/dgeni/templates/type-alias.template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ <h4 id="{$ alias.name $}" class="docs-header-link docs-api-h4 docs-api-type-alia
77

88
{%- if alias.isDeprecated -%}
99
<div class="docs-api-type-alias-deprecated-marker" {$ macros.deprecationTitle(alias) $}>
10-
Deprecated
10+
已弃用
1111
</div>
1212
{%- endif -%}
1313

1414
{%- if alias.description -%}
15-
<p class="docs-api-type-alias-description">{$ alias.description | marked | safe $}</p>
15+
<div class="docs-api-type-alias-description">{$ alias.description | marked | safe $}</div>
1616
{%- endif -%}
1717

1818
<div class="docs-markdown">

0 commit comments

Comments
 (0)