Skip to content

Commit 91466d0

Browse files
j4587698ArgoZhang
andauthored
doc(Component): comments support both Chinese and English (#7531)
* 添加部分zh en多语言注释 * 继续增加多语言注释 * 继续增加 * 完成更新 * refactor: 删除冗余注释信息 * chore: 格式化文档 * chore: 更新注释 --------- Co-authored-by: Argo Zhang <argo@live.ca>
1 parent da441c3 commit 91466d0

750 files changed

Lines changed: 16821 additions & 7797 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,87 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
/// Base class for AutoGenerateColumn attribute, used to mark auto-generated columns in <see cref="Table{TItem}"/>
9+
/// <para lang="zh">AutoGenerateColumn 属性基类,用于标记 <see cref="Table{TItem}"/> 中的自动生成列</para>
10+
/// <para lang="en">Base class for AutoGenerateColumn attribute, used to mark auto-generated columns in <see cref="Table{TItem}"/></para>
1011
/// </summary>
1112
public abstract class AutoGenerateBaseAttribute : Attribute
1213
{
1314
/// <summary>
14-
/// Gets or sets whether the current column is editable. Default is true. When set to false, the auto-generated edit UI will not generate this column.
15+
/// <para lang="zh">获得/设置 当前列是否可编辑。默认为 true。当设置为 false 时,自动编辑 UI 不会生成此列。</para>
16+
/// <para lang="en">Gets or sets whether the current column is editable. Default is true. When set to false, the auto-generated edit UI will not generate this column.</para>
1517
/// </summary>
1618
[Obsolete("Deprecated. If it is editable, use the Readonly parameter. If it is visible, use the Ignore parameter.")]
1719
[ExcludeFromCodeCoverage]
1820
public bool Editable { get; set; } = true;
1921

2022
/// <summary>
21-
/// Gets or sets whether the current column is rendered. Default is false. When set to true, the UI will not generate this column.
23+
/// <para lang="zh">获得/设置 当前列是否渲染。默认为 false。当设置为 true 时,UI 不会生成此列。</para>
24+
/// <para lang="en">Gets or sets whether the current column is rendered. Default is false. When set to true, the UI will not generate this column.</para>
2225
/// </summary>
2326
public bool Ignore { get; set; }
2427

2528
/// <summary>
26-
/// Gets or sets whether the current edit item is read-only. Default is false.
29+
/// <para lang="zh">获得/设置 当前编辑项是否只读。默认为 false。</para>
30+
/// <para lang="en">Gets or sets whether the current edit item is read-only. Default is false.</para>
2731
/// </summary>
2832
public bool Readonly { get; set; }
2933

3034
/// <summary>
31-
/// Gets or sets whether the current edit item is visible. Default is true.
35+
/// <para lang="zh">获得/设置 当前编辑项是否可见。默认为 true。</para>
36+
/// <para lang="en">Gets or sets whether the current edit item is visible. Default is true.</para>
3237
/// </summary>
3338
public bool Visible { get; set; } = true;
3439

3540
/// <summary>
36-
/// Gets or sets whether sorting is allowed. Default is false.
41+
/// <para lang="zh">获得/设置 是否允许排序。默认为 false。</para>
42+
/// <para lang="en">Gets or sets whether sorting is allowed. Default is false.</para>
3743
/// </summary>
3844
public bool Sortable { get; set; }
3945

4046
/// <summary>
41-
/// Gets or sets whether data filtering is allowed. Default is false.
47+
/// <para lang="zh">获得/设置 是否允许数据筛选。默认为 false。</para>
48+
/// <para lang="en">Gets or sets whether data filtering is allowed. Default is false.</para>
4249
/// </summary>
4350
public bool Filterable { get; set; }
4451

4552
/// <summary>
46-
/// Gets or sets whether the column participates in search. Default is false.
53+
/// <para lang="zh">获得/设置 此列是否参与搜索。默认为 false。</para>
54+
/// <para lang="en">Gets or sets whether the column participates in search. Default is false.</para>
4755
/// </summary>
4856
public bool Searchable { get; set; }
4957

5058
/// <summary>
51-
/// Gets or sets whether text wrapping is allowed in this column. Default is false.
59+
/// <para lang="zh">获得/设置 此列是否允许文本换行。默认为 false。</para>
60+
/// <para lang="en">Gets or sets whether text wrapping is allowed in this column. Default is false.</para>
5261
/// </summary>
5362
public bool TextWrap { get; set; }
5463

5564
/// <summary>
56-
/// Gets or sets whether text overflow is ellipsis in this column. Default is false.
65+
/// <para lang="zh">获得/设置 此列文本溢出时是否显示省略号。默认为 false。</para>
66+
/// <para lang="en">Gets or sets whether text overflow is ellipsis in this column. Default is false.</para>
5767
/// </summary>
5868
public bool TextEllipsis { get; set; }
5969

6070
/// <summary>
61-
/// Gets or sets the text alignment. Default is Alignment.None.
71+
/// <para lang="zh">获得/设置 文本对齐方式。默认为 Alignment.None。</para>
72+
/// <para lang="en">Gets or sets the text alignment. Default is Alignment.None.</para>
6273
/// </summary>
6374
public Alignment Align { get; set; }
6475

6576
/// <summary>
66-
/// Gets or sets whether to show tooltips on mouse hover. Default is false.
77+
/// <para lang="zh">获得/设置 鼠标悬停时是否显示提示信息。默认为 false。</para>
78+
/// <para lang="en">Gets or sets whether to show tooltips on mouse hover. Default is false.</para>
6779
/// </summary>
6880
public bool ShowTips { get; set; }
6981

7082
/// <summary>
71-
/// Gets or sets whether the column can be copied. Default is false.
83+
/// <para lang="zh">获得/设置 列是否可以被复制。默认为 false。</para>
84+
/// <para lang="en">Gets or sets whether the column can be copied. Default is false.</para>
7285
/// </summary>
7386
public bool ShowCopyColumn { get; set; }
7487
}

src/BootstrapBlazor/Attributes/AutoGenerateClassAttribute.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
/// AutoGenerateColumn attribute class, used to mark auto-generated columns in <see cref="Table{TItem}"/>
9+
/// <para lang="zh">AutoGenerateColumn 属性类,用于在 <see cref="Table{TItem}"/> 中标记自动生成的列</para>
10+
/// <para lang="en">AutoGenerateColumn attribute class, used to mark auto-generated columns in <see cref="Table{TItem}"/></para>
1011
/// </summary>
1112
[AttributeUsage(AttributeTargets.Class)]
1213
public class AutoGenerateClassAttribute : AutoGenerateBaseAttribute

src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
/// AutoGenerateColumn attribute class, used to mark auto-generated columns in <see cref="Table{TItem}"/>
9+
/// <para lang="zh">AutoGenerateColumn 属性类,用于在 <see cref="Table{TItem}"/> 中标记自动生成的列</para>
10+
/// <para lang="en">AutoGenerateColumn attribute class, used to mark auto-generated columns in <see cref="Table{TItem}"/></para>
1011
/// </summary>
1112
[AttributeUsage(AttributeTargets.Property)]
1213
public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColumn
1314
{
1415
/// <summary>
15-
/// Gets or sets the display order. The rules are as follows:
16-
/// <para></para>
17-
/// &gt;0 for the front, 1,2,3...
18-
/// <para></para>
19-
/// =0 for the middle (default)
20-
/// <para></para>
21-
/// &lt;0 for the back, ...-3,-2,-1
16+
/// <para lang="zh">获得/设置 显示顺序。规则如下:</para>
17+
/// <para lang="en">Gets or sets the display order. The rules are as follows:</para>
18+
/// <para lang="zh">&gt;0 正序排列,1,2,3...</para>
19+
/// <para lang="en">&gt;0 for the front, 1,2,3...</para>
20+
/// <para lang="zh">=0 保持默认</para>
21+
/// <para lang="en">=0 for the middle (default)</para>
22+
/// <para lang="zh">&lt;0 倒序排列,...-3,-2,-1</para>
23+
/// <para lang="en">&lt;0 for the back, ...-3,-2,-1</para>
2224
/// </summary>
2325
public int Order { get; set; }
2426

@@ -33,7 +35,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
3335
public bool SkipValidate { get; set; }
3436

3537
/// <summary>
36-
/// Gets or sets whether the column is read-only when adding a new item. Default is null, using the <see cref="IEditorItem.Readonly"/> value.
38+
/// <para lang="zh">获得/设置 新建时此列是否只读。默认值为 null,使用 <see cref="IEditorItem.Readonly"/> 值。</para>
39+
/// <para lang="en">Gets or sets whether the column is read-only when adding a new item. Default is null, using the <see cref="IEditorItem.Readonly"/> value.</para>
3740
/// </summary>
3841
public bool IsReadonlyWhenAdd { get; set; }
3942

@@ -44,7 +47,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
4447
}
4548

4649
/// <summary>
47-
/// Gets or sets whether the column is read-only when editing an item. Default is null, using the <see cref="IEditorItem.Readonly"/> value.
50+
/// <para lang="zh">获得/设置 编辑时此列是否只读。默认值为 null,使用 <see cref="IEditorItem.Readonly"/> 值。</para>
51+
/// <para lang="en">Gets or sets whether the column is read-only when editing an item. Default is null, using the <see cref="IEditorItem.Readonly"/> value.</para>
4852
/// </summary>
4953
public bool IsReadonlyWhenEdit { get; set; }
5054

@@ -55,7 +59,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
5559
}
5660

5761
/// <summary>
58-
/// Gets or sets whether the column is visible when adding a new item. Default is null, using the <see cref="AutoGenerateBaseAttribute.Visible"/> value.
62+
/// <para lang="zh">获得/设置 新建时此列是否可见。默认值为 null,使用 <see cref="AutoGenerateBaseAttribute.Visible"/> 值。</para>
63+
/// <para lang="en">Gets or sets whether the column is visible when adding a new item. Default is null, using the <see cref="AutoGenerateBaseAttribute.Visible"/> value.</para>
5964
/// </summary>
6065
public bool IsVisibleWhenAdd { get; set; } = true;
6166

@@ -66,7 +71,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
6671
}
6772

6873
/// <summary>
69-
/// Gets or sets whether the column is visible when editing an item. Default is null, using the <see cref="AutoGenerateBaseAttribute.Visible"/> value.
74+
/// <para lang="zh">获得/设置 编辑时此列是否可见。默认值为 null,使用 <see cref="AutoGenerateBaseAttribute.Visible"/> 值。</para>
75+
/// <para lang="en">Gets or sets whether the column is visible when editing an item. Default is null, using the <see cref="AutoGenerateBaseAttribute.Visible"/> value.</para>
7076
/// </summary>
7177
public bool IsVisibleWhenEdit { get; set; } = true;
7278

@@ -90,7 +96,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
9096
public string? RequiredErrorMessage { get; set; }
9197

9298
/// <summary>
93-
/// Gets or sets whether to show label tooltip. Mostly used when the label text is too long and gets truncated. Default is false.
99+
/// <para lang="zh">获得/设置 是否显示标签工具提示。通常用于标签文本过长被截断时。默认为 false。</para>
100+
/// <para lang="en">Gets or sets whether to show label tooltip. Mostly used when the label text is too long and gets truncated. Default is false.</para>
94101
/// </summary>
95102
public bool ShowLabelTooltip { get; set; }
96103

@@ -101,14 +108,16 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
101108
}
102109

103110
/// <summary>
104-
/// Gets or sets the default sort order. Default is SortOrder.Unset.
111+
/// <para lang="zh">获得/设置 默认排序顺序。默认为 SortOrder.Unset。</para>
112+
/// <para lang="en">Gets or sets the default sort order. Default is SortOrder.Unset.</para>
105113
/// </summary>
106114
public SortOrder DefaultSortOrder { get; set; }
107115

108116
IEnumerable<SelectedItem>? IEditorItem.Items { get; set; }
109117

110118
/// <summary>
111-
/// Gets or sets the column width.
119+
/// <para lang="zh">获得/设置 列宽。</para>
120+
/// <para lang="en">Gets or sets the column width.</para>
112121
/// </summary>
113122
public int Width { get; set; }
114123

@@ -230,6 +239,9 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
230239
/// </summary>
231240
public bool ShowSearchWhenSelect { get; set; }
232241

242+
/// <summary>
243+
/// <inheritdoc/>
244+
/// </summary>
233245
/// <summary>
234246
/// <inheritdoc/>
235247
/// </summary>
@@ -253,17 +265,17 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
253265
ILookupService? ILookup.LookupService { get; set; }
254266

255267
/// <summary>
256-
/// <inheritdoc/>>
268+
/// <inheritdoc/>
257269
/// </summary>
258270
public string? LookupServiceKey { get; set; }
259271

260272
/// <summary>
261-
/// <inheritdoc/>>
273+
/// <inheritdoc/>
262274
/// </summary>
263275
public object? LookupServiceData { get; set; }
264276

265277
/// <summary>
266-
/// <inheritdoc/>>
278+
/// <inheritdoc/>
267279
/// </summary>
268280
public StringComparison LookupStringComparison { get; set; } = StringComparison.OrdinalIgnoreCase;
269281

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
/// Constructor
9+
/// <para lang="zh">构造函数</para>
10+
/// <para lang="en">Constructor</para>
1011
/// </summary>
1112
/// <param name="path"></param>
1213
class BootstrapModuleAutoLoaderAttribute(string? path = null) : JSModuleAutoLoaderAttribute(path)
1314
{
1415
/// <summary>
15-
/// Gets or sets the module name. Automatically uses scripts from the modules folder.
16+
/// <para lang="zh">获得/设置 模块名称。自动使用 modules 文件夹中的脚本。</para>
17+
/// <para lang="en">Gets or sets the module name. Automatically uses scripts from the modules folder.</para>
1618
/// </summary>
1719
public string? ModuleName { get; set; }
1820
}

src/BootstrapBlazor/Attributes/FileValidationAttribute.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -9,25 +9,29 @@
99
namespace BootstrapBlazor.Components;
1010

1111
/// <summary>
12-
/// 上传文件扩展名验证标签类
12+
/// <para lang="zh">上传文件扩展名验证标签类</para>
13+
/// <para lang="en">Upload file extension validation attribute class</para>
1314
/// </summary>
1415
[AttributeUsage(AttributeTargets.Property)]
1516
public class FileValidationAttribute : ValidationAttribute
1617
{
1718
private IStringLocalizer? Localizer { get; set; }
1819

1920
/// <summary>
20-
/// 获得/设置 允许的扩展名
21+
/// <para lang="zh">获得/设置 允许的扩展名</para>
22+
/// <para lang="en">Gets or sets allowed extensions</para>
2123
/// </summary>
2224
public string[] Extensions { get; set; } = [];
2325

2426
/// <summary>
25-
/// 获得/设置 文件大小 默认为 0 未限制
27+
/// <para lang="zh">获得/设置 文件大小 默认为 0 未限制</para>
28+
/// <para lang="en">Gets or sets file size. Default is 0 (no limit)</para>
2629
/// </summary>
2730
public long FileSize { get; set; }
2831

2932
/// <summary>
30-
/// 是否合规判断方法
33+
/// <para lang="zh">是否合规判断方法</para>
34+
/// <para lang="en">Is valid method</para>
3135
/// </summary>
3236
/// <param name="value"></param>
3337
/// <param name="validationContext"></param>
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
/// JSModuleAutoLoaderAttribute class
9+
/// <para lang="zh">JSModuleAutoLoaderAttribute 类</para>
10+
/// <para lang="en">JSModuleAutoLoaderAttribute class</para>
1011
/// </summary>
11-
/// <param name="path">The path to the JavaScript module</param>
12+
/// <param name="path"><para lang="zh">JavaScript 模块的路径</para><para lang="en">The path to the JavaScript module</para></param>
1213
[AttributeUsage(AttributeTargets.Class)]
1314
public class JSModuleAutoLoaderAttribute(string? path = null) : Attribute
1415
{
1516
/// <summary>
16-
/// Gets the path property
17+
/// <para lang="zh">获得 路径属性</para>
18+
/// <para lang="en">Gets the path property</para>
1719
/// </summary>
1820
public string? Path { get; } = path;
1921

2022
/// <summary>
21-
/// Represents a reference to a JavaScript object. Default value is false.
23+
/// <para lang="zh">表示对 JavaScript 对象的引用。默认值为 false。</para>
24+
/// <para lang="en">Represents a reference to a JavaScript object. Default value is false.</para>
2225
/// </summary>
2326
public bool JSObjectReference { get; set; }
2427

2528
/// <summary>
26-
/// Gets or sets whether to automatically invoke init. Default is true.
29+
/// <para lang="zh">获得/设置 是否自动调用 init。默认值为 true。</para>
30+
/// <para lang="en">Gets or sets whether to automatically invoke init. Default is true.</para>
2731
/// </summary>
2832
public bool AutoInvokeInit { get; set; } = true;
2933

3034
/// <summary>
31-
/// Gets or sets whether to automatically invoke dispose. Default is true.
35+
/// <para lang="zh">获得/设置 是否自动调用 dispose。默认值为 true。</para>
36+
/// <para lang="en">Gets or sets whether to automatically invoke dispose. Default is true.</para>
3237
/// </summary>
3338
public bool AutoInvokeDispose { get; set; } = true;
3439
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
/// JSModuleNotInheritedAttribute <see cref="JSModuleAutoLoaderAttribute"/>
9+
/// <para lang="zh">JSModuleNotInheritedAttribute <see cref="JSModuleAutoLoaderAttribute"/></para>
10+
/// <para lang="en">JSModuleNotInheritedAttribute <see cref="JSModuleAutoLoaderAttribute"/></para>
1011
/// </summary>
1112
[AttributeUsage(AttributeTargets.Class)]
1213
public sealed class JSModuleNotInheritedAttribute : Attribute
1314
{
14-
// 增加 sealed 关键字防止二开写派生类导致 type.GetCustomAttribute<JSModuleNotInheritedAttribute>() 报错
15-
// BootstrapModuleComponentBase 类 OnLoadJSModule 方法
15+
1616
}

0 commit comments

Comments
 (0)