Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ namespace BootstrapBlazor.Components;
/// <para lang="zh">JSModuleAutoLoaderAttribute 类</para>
/// <para lang="en">JSModuleAutoLoaderAttribute class</para>
/// </summary>
/// <param name="path"><para lang="zh">JavaScript 模块的路径</para><para lang="en">The path to the JavaScript module</para></param>
/// <param name="path">
/// <para lang="zh">JavaScript 模块的路径</para>
/// <para lang="en">The path to the JavaScript module</para>
/// </param>
[AttributeUsage(AttributeTargets.Class)]
public class JSModuleAutoLoaderAttribute(string? path = null) : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// <para lang="zh">JSModuleNotInheritedAttribute <see cref="JSModuleAutoLoaderAttribute"/></para>
/// <para lang="en">JSModuleNotInheritedAttribute <see cref="JSModuleAutoLoaderAttribute"/></para>
/// <para lang="zh">表示该类不继承 JSModuleAutoLoaderAttribute 的特性</para>
/// <para lang="en">Indicates that this class does not inherit the JSModuleAutoLoaderAttribute</para>
Comment on lines +9 to +10
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summary text mentions JSModuleAutoLoaderAttribute as plain text. Using <see cref="JSModuleAutoLoaderAttribute"/> here (as done elsewhere in the codebase) would preserve clickable API links in generated docs and avoid drift between the zh/en summaries.

Suggested change
/// <para lang="zh">表示该类不继承 JSModuleAutoLoaderAttribute 的特性</para>
/// <para lang="en">Indicates that this class does not inherit the JSModuleAutoLoaderAttribute</para>
/// <para lang="zh">表示该类不继承 <see cref="JSModuleAutoLoaderAttribute"/> 的特性</para>
/// <para lang="en">Indicates that this class does not inherit the <see cref="JSModuleAutoLoaderAttribute"/>.</para>

Copilot uses AI. Check for mistakes.
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public sealed class JSModuleNotInheritedAttribute : Attribute
Expand Down
50 changes: 14 additions & 36 deletions src/BootstrapBlazor/Attributes/TableMetadataForAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,18 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// <para lang="zh">定义目标数据类型的 UI 生成元数据组</para>
/// <para lang="zh">通常模型类型位于与 Blazor 组件 UI 层不同的层</para>
/// <para lang="zh">在这种情况下,使用 <see cref="TableMetadataForAttribute"/> 为 Table 组件定义元数据类型</para>
/// <para lang="zh">然后使用 <seealso cref="TableMetadataTypeService"/> 注册元数据类型</para>
/// <para lang="en">Define a group of UI generation metadata for target data type</para>
/// <para lang="en">Usually model types are at different layer to the blazor component UI layer</para>
/// <para lang="en">In this case, use <see cref="TableMetadataForAttribute"/> to define a metadata type for Table component</para>
/// <para lang="en">Then register metadata type with <seealso cref="TableMetadataTypeService"/></para>
///
/// <para lang="zh">定义目标数据类型的 UI 生成元数据组,通常模型类型位于与 Blazor 组件 UI 层不同的层,在这种情况下,使用 <see cref="TableMetadataForAttribute"/> 为 Table 组件定义元数据类型,然后使用 <seealso cref="TableMetadataTypeService"/> 注册元数据类型</para>
/// <para lang="en">Defines a group of UI generation metadata for the target data type. Usually, model types are located in a different layer than the Blazor component UI layer. In this case, use <see cref="TableMetadataForAttribute"/> to define a metadata type for the Table component, and then use <seealso cref="TableMetadataTypeService"/> to register the metadata type.</para>
/// <example>
/// <para lang="zh">示例:</para>
/// <para lang="zh">Pig 数据类型通常位于业务层或数据层</para>
/// <para lang="en">Example:</para>
/// <para lang="en">the Pig data type is usually at biz or data layer</para>
/// <code>
/// <para>示例:Pig 数据类型通常位于业务层或数据层; Example: the Pig data type is usually at biz or data layer</para>
/// <code>
Comment on lines 11 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Avoid mixing languages in a single XML doc paragraph to keep localization clearer.

Previously, zh/en text was split into separate <para> elements with lang attributes, which is better for localized tooling and for readers. Here both languages are merged into one <para> with a semicolon. Please restore separate <para lang="zh"> and <para lang="en"> entries so each audience has a clear sentence and tooling can distinguish them.

Suggested change
/// <example>
/// <para lang="zh">示例:</para>
/// <para lang="zh">Pig 数据类型通常位于业务层或数据层</para>
/// <para lang="en">Example:</para>
/// <para lang="en">the Pig data type is usually at biz or data layer</para>
/// <code>
/// <para>示例:Pig 数据类型通常位于业务层或数据层; Example: the Pig data type is usually at biz or data layer</para>
/// <code>
We need to split the mixed-language `<para>` into two localized paragraphs, restoring `lang` attributes for tooling and clarity.
/// <example>
/// <para lang="zh">示例:Pig 数据类型通常位于业务层或数据层</para>
/// <para lang="en">Example: the Pig data type is usually at biz or data layer</para>
/// <code>

Comment on lines 11 to +13
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<example> section mixes Chinese and English in a single <para> without lang attributes. This is inconsistent with the rest of the repo’s bilingual XML-doc pattern (separate <para lang="zh"> / <para lang="en">, e.g. Attributes/AutoGenerateColumnAttribute.cs) and makes it harder for tooling/readers to select the right language. Please split these into separate localized <para> entries (and keep the languages separate).

Copilot uses AI. Check for mistakes.
/// public class Pig
/// {
/// public string? Name1 { get; set; }
///
/// public string? Name2 { get; set; }
/// }
/// </code>
/// <para lang="zh">PigMetadata 可以定义在 UI/组件层</para>
/// <para lang="en">the PigMetadata can be defined at UI/component layer</para>
/// <code>
///
/// [TableMetadataFor(typeof(Pig))]
/// [AutoGenerateClass(Align = Alignment.Center)]
/// public class PigMetadata
Expand All @@ -41,28 +28,19 @@ namespace BootstrapBlazor.Components;
/// [AutoGenerateColumn(Align = Alignment.Center, Order = -2)]
/// public string? Name2 { get; set; }
/// }
/// </code>
/// <para lang="zh">在使用元数据之前,需要注册元数据类型</para>
/// <para lang="zh">在程序集中注册元数据类型</para>
/// <para lang="en">before using the metadata, it needs to register the metadata types</para>
/// <para lang="en">register metadata types in assembly</para>
/// <code>
/// </code>
/// <para>register metadata types in assembly</para>
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example text register metadata types in assembly is not localized (no lang attribute, and only English). To keep docs consistent and avoid mixed-language output, please provide both zh/en <para lang=...> entries here as well.

Suggested change
/// <para>register metadata types in assembly</para>
/// <para lang="zh">在程序集中注册元数据类型</para>
/// <para lang="en">Register metadata types in the assembly</para>

Copilot uses AI. Check for mistakes.
/// <code>
/// TableMetadataTypeService.RegisterMetadataTypes(typeof(Pig).Assembly);
/// var cols = Utility.GetTableColumns&lt;Pig&gt;().ToList();
/// Assert.Single(cols);
/// </code>
/// <para lang="zh">或者您可以单独注册类型</para>
/// <para lang="en">or you can register types individually</para>
/// <code>
/// // or
/// TableMetadataTypeService.RegisterMetadataType(metadataType, dataType);
/// </code>
/// </code>
/// </example>
/// </summary>
/// <remarks>
/// <para lang="zh">TableMetadataForAttribute 构造函数</para>
/// <para lang="en">Constructor TableMetadataForAttribute for target data type</para>
/// </remarks>
/// <param name="dataType"><para lang="zh">目标模型/数据类型</para><para lang="en">The target model/data type</para></param>
/// <param name="dataType">
/// <para lang="zh">目标模型/数据类型</para>
/// <para lang="en">The target model/data type</para>
/// </param>
[AttributeUsage(AttributeTargets.Class)]
public class TableMetadataForAttribute(Type dataType) : Attribute
{
Expand Down
Loading