Skip to content

Commit f1f5097

Browse files
committed
doc: 参数文档本地化
1 parent a7bce59 commit f1f5097

File tree

4 files changed

+65
-21
lines changed

4 files changed

+65
-21
lines changed

src/BootstrapBlazor.Server/Components/Samples/FlipClocks.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@
7878
</div>
7979
</GroupBox>
8080
</section>
81-
<FlipClock BackgroundColor="radial-gradient(ellipse at center, #ac85f1 0%, #833bf8 100%)" Height="@HeightValueString" FontSize="@FontSizeValueString" CardHeight="@CardHeightValueString" CardWidth="@CardWidthValueString" CardMargin="@CardMarginValueString" CardGroupMargin="@CardGroupMarginValueString"></FlipClock>
81+
<FlipClock BackgroundColor="radial-gradient(ellipse at center, #ac85f1 0%, #833bf8 100%)" Height="@HeightValueString"
82+
FontSize="@FontSizeValueString" CardHeight="@CardHeightValueString" CardWidth="@CardWidthValueString"
83+
CardMargin="@CardMarginValueString" CardGroupMargin="@CardGroupMarginValueString"></FlipClock>
8284
</DemoBlock>
8385

8486
<AttributeTable Items="@GetAttributes()" />

src/BootstrapBlazor.Server/Components/Samples/FlipClocks.razor.cs

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,132 +48,140 @@ private Task OnCompletedAsync()
4848
/// GetAttributes
4949
/// </summary>
5050
/// <returns></returns>
51-
private static AttributeItem[] GetAttributes() =>
51+
private AttributeItem[] GetAttributes() =>
5252
[
53+
new()
54+
{
55+
Name = nameof(FlipClock.ShowDay),
56+
Description = Localizer["ShowDay_Description"],
57+
Type = "boolean",
58+
ValueList = "true|false",
59+
DefaultValue = "false"
60+
},
5361
new()
5462
{
5563
Name = nameof(FlipClock.ShowHour),
56-
Description = "是否显示小时",
64+
Description = Localizer["ShowHour_Description"],
5765
Type = "boolean",
5866
ValueList = "true|false",
5967
DefaultValue = "true"
6068
},
6169
new()
6270
{
6371
Name = nameof(FlipClock.ShowMinute),
64-
Description = "是否显示分钟",
72+
Description = Localizer["ShowMinute_Description"],
6573
Type = "boolean",
6674
ValueList = "true|false",
6775
DefaultValue = "true"
6876
},
6977
new()
7078
{
7179
Name = nameof(FlipClock.ViewMode),
72-
Description = "是否显示分钟",
80+
Description = Localizer["ViewMode_Description"],
7381
Type = "FlipClockViewMode",
7482
ValueList = "DateTime|Count|CountDown",
7583
DefaultValue = "DateTime"
7684
},
7785
new()
7886
{
7987
Name = nameof(FlipClock.StartValue),
80-
Description = "开始时间",
88+
Description = Localizer["StartValue_Description"],
8189
Type = "TimeSpan",
8290
ValueList = " — ",
8391
DefaultValue = " — "
8492
},
8593
new()
8694
{
8795
Name = nameof(FlipClock.OnCompletedAsync),
88-
Description = "计时结束回调方法",
96+
Description = Localizer["OnCompletedAsync_Description"],
8997
Type = "Func<Task>",
9098
ValueList = " — ",
9199
DefaultValue = " — "
92100
},
93101
new()
94102
{
95103
Name = nameof(FlipClock.Height),
96-
Description = "组件高度",
104+
Description = Localizer["Height_Description"],
97105
Type = "string?",
98106
ValueList = " — ",
99107
DefaultValue = " — "
100108
},
101109
new()
102110
{
103111
Name = nameof(FlipClock.BackgroundColor),
104-
Description = "组件背景色",
112+
Description = Localizer["BackgroundColor_Description"],
105113
Type = "string?",
106114
ValueList = " — ",
107115
DefaultValue = " — "
108116
},
109117
new()
110118
{
111119
Name = nameof(FlipClock.FontSize),
112-
Description = "组件字体大小",
120+
Description = Localizer["FontSize_Description"],
113121
Type = "string?",
114122
ValueList = " — ",
115123
DefaultValue = " — "
116124
},
117125
new()
118126
{
119127
Name = nameof(FlipClock.CardWidth),
120-
Description = "组件卡片宽度",
128+
Description = Localizer["CardWidth_Description"],
121129
Type = "string?",
122130
ValueList = " — ",
123131
DefaultValue = " — "
124132
},
125133
new()
126134
{
127135
Name = nameof(FlipClock.CardHeight),
128-
Description = "组件卡片高度",
136+
Description = Localizer["CardHeight_Description"],
129137
Type = "string?",
130138
ValueList = " — ",
131139
DefaultValue = " — "
132140
},
133141
new()
134142
{
135143
Name = nameof(FlipClock.CardColor),
136-
Description = "组件卡片字体颜色",
144+
Description = Localizer["CardColor_Description"],
137145
Type = "string?",
138146
ValueList = " — ",
139147
DefaultValue = " — "
140148
},
141149
new()
142150
{
143151
Name = nameof(FlipClock.CardBackgroundColor),
144-
Description = "组件卡片背景颜色",
152+
Description = Localizer["CardBackgroundColor_Description"],
145153
Type = "string?",
146154
ValueList = " — ",
147155
DefaultValue = " — "
148156
},
149157
new()
150158
{
151159
Name = nameof(FlipClock.CardDividerHeight),
152-
Description = "组件卡片分割线高度",
160+
Description = Localizer["CardDividerHeight_Description"],
153161
Type = "string?",
154162
ValueList = " — ",
155163
DefaultValue = " — "
156164
},
157165
new()
158166
{
159167
Name = nameof(FlipClock.CardDividerColor),
160-
Description = "组件卡片分割线颜色",
168+
Description = Localizer["CardDividerColor_Description"],
161169
Type = "string?",
162170
ValueList = " — ",
163171
DefaultValue = " — "
164172
},
165173
new()
166174
{
167175
Name = nameof(FlipClock.CardMargin),
168-
Description = "组件卡片间隔",
176+
Description = Localizer["CardMargin_Description"],
169177
Type = "string?",
170178
ValueList = " — ",
171179
DefaultValue = " — "
172180
},
173181
new()
174182
{
175183
Name = nameof(FlipClock.CardGroupMargin),
176-
Description = "组件卡片组间隔",
184+
Description = Localizer["CardGroupMargin_Description"],
177185
Type = "string?",
178186
ValueList = " — ",
179187
DefaultValue = " — "

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6820,7 +6820,24 @@
68206820
"CardHeight": "Card Height",
68216821
"CardWidth": "Card Width",
68226822
"CardMargin": "Card Margin",
6823-
"CardGroupMargin": "Card Group Margin"
6823+
"CardGroupMargin": "Card Group Margin",
6824+
"ShowDay_Description": "Show day",
6825+
"ShowHour_Description": "Show hour",
6826+
"ShowMinute_Description": "Show minute",
6827+
"ViewMode_Description": "View mode",
6828+
"StartValue_Description": "Start time",
6829+
"OnCompletedAsync_Description": "Callback when timer completed",
6830+
"Height_Description": "Height",
6831+
"BackgroundColor_Description": "Background color",
6832+
"FontSize_Description": "Font size",
6833+
"CardWidth_Description": "Card width",
6834+
"CardHeight_Description": "Card height",
6835+
"CardColor_Description": "Card font color",
6836+
"CardBackgroundColor_Description": "Card background color",
6837+
"CardDividerHeight_Description": "Card divider height",
6838+
"CardDividerColor_Description": "Card divider color",
6839+
"CardMargin_Description": "Card margin",
6840+
"CardGroupMargin_Description": "Card group margin"
68246841
},
68256842
"BootstrapBlazor.Server.Components.Samples.Icons.BootstrapIcons": {
68266843
"Title": "Bootstrap Icons",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@
11781178
},
11791179
"BootstrapBlazor.Server.Components.Components.InstallContent": {
11801180
"P5": "使用 BootstrapBlazor Project Template 扩展创建项目",
1181-
"InstallByTemplate":"您可以通过 <a href=\"template\">[传送门]</a> 下载安装扩展后,通过扩展创建项目, <code>强烈推荐</code>",
1181+
"InstallByTemplate": "您可以通过 <a href=\"template\">[传送门]</a> 下载安装扩展后,通过扩展创建项目, <code>强烈推荐</code>",
11821182
"P9": "使用 Visual Studio 创建项目",
11831183
"P10": "步骤一、创建项目",
11841184
"P11": "打开 Visual Studio",
@@ -6820,7 +6820,24 @@
68206820
"CardHeight": "卡片高度",
68216821
"CardWidth": "卡片宽度",
68226822
"CardMargin": "卡片边距",
6823-
"CardGroupMargin": "卡片组边距"
6823+
"CardGroupMargin": "卡片组边距",
6824+
"ShowDay_Description": "是否显示日",
6825+
"ShowHour_Description": "是否显示小时",
6826+
"ShowMinute_Description": "是否显示分钟",
6827+
"ViewMode_Description": "显示模式",
6828+
"StartValue_Description": "开始时间",
6829+
"OnCompletedAsync_Description": "计时结束回调方法",
6830+
"Height_Description": "高度",
6831+
"BackgroundColor_Description": "背景色",
6832+
"FontSize_Description": "字体大小",
6833+
"CardWidth_Description": "卡片宽度",
6834+
"CardHeight_Description": "卡片高度",
6835+
"CardColor_Description": "卡片字体颜色",
6836+
"CardBackgroundColor_Description": "卡片背景颜色",
6837+
"CardDividerHeight_Description": "卡片分割线高度",
6838+
"CardDividerColor_Description": "卡片分割线颜色",
6839+
"CardMargin_Description": "卡片间隔",
6840+
"CardGroupMargin_Description": "卡片组间隔"
68246841
},
68256842
"BootstrapBlazor.Server.Components.Samples.Icons.BootstrapIcons": {
68266843
"Title": "Bootstrap Icons",

0 commit comments

Comments
 (0)