Skip to content

Commit ffd3100

Browse files
committed
增加双语注释
1 parent c1e08a4 commit ffd3100

2 files changed

Lines changed: 54 additions & 27 deletions

File tree

src/components/BootstrapBlazor.Term/Components/Term/Term.razor.cs

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,42 @@
77
namespace BootstrapBlazor.Components;
88

99
/// <summary>
10-
/// Term 终端组件
10+
/// <para lang="zh">Term 终端组件</para>
11+
/// <para lang="en">Term Component</para>
1112
/// </summary>
1213
[JSModuleAutoLoader("./_content/BootstrapBlazor.Term/Components/Term/Term.razor.js", JSObjectReference = true)]
1314
public partial class Term
1415
{
1516
/// <summary>
16-
/// 获得/设置 UI Element
17+
/// <para lang="zh">获得/设置 UI Element</para>
18+
/// <para lang="en">Gets or sets the UI Element.</para>
1719
/// </summary>
1820
private ElementReference Element { get; set; }
1921

2022
/// <summary>
21-
/// 获得/设置 Options
23+
/// <para lang="zh">获得/设置 Options</para>
24+
/// <para lang="en">Gets or sets the Options.</para>
2225
/// </summary>
2326
[Parameter]
2427
public TermOptions Options { get; set; } = new TermOptions();
2528

2629
/// <summary>
27-
/// 获得/设置 收到数据回调
30+
/// <para lang="zh">获得/设置 收到数据回调</para>
31+
/// <para lang="en">Gets or sets the callback when data is received.</para>
2832
/// </summary>
2933
[Parameter]
3034
public Func<byte[], Task>? OnData { get; set; }
3135

3236
/// <summary>
33-
/// 获得/设置 终端 Resize 回调
37+
/// <para lang="zh">获得/设置 终端 Resize 回调</para>
38+
/// <para lang="en">Gets or sets the callback when terminal is resized.</para>
3439
/// </summary>
3540
[Parameter]
3641
public Func<int, int, Task>? OnResize { get; set; }
3742

3843
/// <summary>
39-
/// 获得/设置 高度 默认 300px
44+
/// <para lang="zh">获得/设置 高度 默认 300px</para>
45+
/// <para lang="en">Gets or sets the height. Default is 300px.</para>
4046
/// </summary>
4147
[Parameter]
4248
public string Height { get; set; } = "300px";
@@ -76,7 +82,8 @@ protected override async Task InvokeInitAsync()
7682
}
7783

7884
/// <summary>
79-
/// 写入数据
85+
/// <para lang="zh">写入数据</para>
86+
/// <para lang="en">Writes data to the terminal.</para>
8087
/// </summary>
8188
/// <param name="data"></param>
8289
/// <returns></returns>
@@ -86,7 +93,8 @@ public async Task Write(string data)
8693
}
8794

8895
/// <summary>
89-
/// 写入一行数据
96+
/// <para lang="zh">写入一行数据</para>
97+
/// <para lang="en">Writes a line of data to the terminal.</para>
9098
/// </summary>
9199
/// <param name="data"></param>
92100
/// <returns></returns>
@@ -96,7 +104,8 @@ public async Task WriteLine(string data)
96104
}
97105

98106
/// <summary>
99-
/// 清空终端
107+
/// <para lang="zh">清空终端</para>
108+
/// <para lang="en">Clears the terminal.</para>
100109
/// </summary>
101110
/// <returns></returns>
102111
public async Task Clear()
@@ -105,7 +114,8 @@ public async Task Clear()
105114
}
106115

107116
/// <summary>
108-
/// 连接流
117+
/// <para lang="zh">连接流</para>
118+
/// <para lang="en">Connects a stream.</para>
109119
/// </summary>
110120
/// <param name="stream"></param>
111121
/// <returns></returns>
@@ -149,7 +159,8 @@ private async Task ReadStreamAsync()
149159
}
150160

151161
/// <summary>
152-
/// 写入数据 (Byte[])
162+
/// <para lang="zh">写入数据 (Byte[])</para>
163+
/// <para lang="en">Writes byte array data to the terminal.</para>
153164
/// </summary>
154165
/// <param name="data"></param>
155166
/// <returns></returns>
@@ -159,7 +170,8 @@ public async Task Write(byte[] data)
159170
}
160171

161172
/// <summary>
162-
/// 收到数据 JSInvoke
173+
/// <para lang="zh">收到数据 JSInvoke</para>
174+
/// <para lang="en">Callback when data is received from JS.</para>
163175
/// </summary>
164176
/// <param name="data"></param>
165177
/// <returns></returns>
@@ -190,17 +202,20 @@ protected override async ValueTask DisposeAsync(bool disposing)
190202
}
191203

192204
/// <summary>
193-
/// 获得 终端行数
205+
/// <para lang="zh">获得 终端行数</para>
206+
/// <para lang="en">Gets the number of rows in the terminal.</para>
194207
/// </summary>
195208
public int Rows { get; private set; }
196209

197210
/// <summary>
198-
/// 获得 终端列数
211+
/// <para lang="zh">获得 终端列数</para>
212+
/// <para lang="en">Gets the number of columns in the terminal.</para>
199213
/// </summary>
200214
public int Columns { get; private set; }
201215

202216
/// <summary>
203-
/// Resize JSInvoke
217+
/// <para lang="zh">Resize JSInvoke</para>
218+
/// <para lang="en">Callback when terminal is resized from JS.</para>
204219
/// </summary>
205220
/// <param name="rows"></param>
206221
/// <param name="cols"></param>

src/components/BootstrapBlazor.Term/Components/Term/TermOptions.cs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,75 @@
55
namespace BootstrapBlazor.Components;
66

77
/// <summary>
8-
/// Term Options
8+
/// <para lang="zh">Term 选项类</para>
9+
/// <para lang="en">Term Options</para>
910
/// </summary>
1011
public class TermOptions
1112
{
1213
/// <summary>
13-
/// 获得/设置 终端字体大小 默认 14
14+
/// <para lang="zh">获得/设置 终端字体大小 默认 14</para>
15+
/// <para lang="en">Gets or sets the font size of the terminal. Default is 14.</para>
1416
/// </summary>
1517
public int FontSize { get; set; } = 14;
1618

1719
/// <summary>
18-
/// 获得/设置 终端字体
20+
/// <para lang="zh">获得/设置 终端字体</para>
21+
/// <para lang="en">Gets or sets the font family of the terminal.</para>
1922
/// </summary>
2023
public string FontFamily { get; set; } = "Consolas, 'Courier New', monospace";
2124

2225
/// <summary>
23-
/// 获得/设置 终端主题 默认 null 使用默认主题
26+
/// <para lang="zh">获得/设置 终端主题 默认 null 使用默认主题</para>
27+
/// <para lang="en">Gets or sets the theme of the terminal. Default is null (uses default theme).</para>
2428
/// </summary>
2529
public TermTheme? Theme { get; set; }
2630

2731
/// <summary>
28-
/// 获得/设置 光标闪烁 默认 true
32+
/// <para lang="zh">获得/设置 光标闪烁 默认 true</para>
33+
/// <para lang="en">Gets or sets whether the cursor blinks. Default is true.</para>
2934
/// </summary>
3035
public bool CursorBlink { get; set; } = true;
3136

3237
/// <summary>
33-
/// 获得/设置 行高 默认 1.0
38+
/// <para lang="zh">获得/设置 行高 默认 1.0</para>
39+
/// <para lang="en">Gets or sets the line height. Default is 1.0.</para>
3440
/// </summary>
3541
public double LineHeight { get; set; } = 1.0;
3642

3743
/// <summary>
38-
/// 获得/设置 是否将 \n 转换为 \r\n 默认 false
44+
/// <para lang="zh">获得/设置 是否将 \n 转换为 \r\n 默认 false</para>
45+
/// <para lang="en">Gets or sets whether to convert \n to \r\n. Default is false.</para>
3946
/// </summary>
4047
public bool ConvertEol { get; set; }
4148
}
4249

4350
/// <summary>
44-
/// Term Theme
51+
/// <para lang="zh">Term 主题类</para>
52+
/// <para lang="en">Term Theme</para>
4553
/// </summary>
4654
public class TermTheme
4755
{
4856
/// <summary>
49-
/// Background color
57+
/// <para lang="zh">背景色</para>
58+
/// <para lang="en">Background color</para>
5059
/// </summary>
5160
public string? Background { get; set; }
5261

5362
/// <summary>
54-
/// Foreground color
63+
/// <para lang="zh">前景色</para>
64+
/// <para lang="en">Foreground color</para>
5565
/// </summary>
5666
public string? Foreground { get; set; }
5767

5868
/// <summary>
59-
/// Cursor color
69+
/// <para lang="zh">光标颜色</para>
70+
/// <para lang="en">Cursor color</para>
6071
/// </summary>
6172
public string? Cursor { get; set; }
6273

6374
/// <summary>
64-
/// Selection color
75+
/// <para lang="zh">选中颜色</para>
76+
/// <para lang="en">Selection color</para>
6577
/// </summary>
6678
public string? Selection { get; set; }
6779
}

0 commit comments

Comments
 (0)