!1779 doc(#I47O64): add english translation of globalException page

* doc: 修复资源文件
* Merge branch 'dev' of https://gitee.com/LongbowEnterprise/BootstrapBla…
* doc: 添加 GlobalExecption 页面资源文件
This commit is contained in:
Nine 2021-08-29 13:05:05 +00:00 committed by Argo
parent f831887be0
commit f9c454946a
3 changed files with 41 additions and 14 deletions

View File

@ -390,6 +390,19 @@
"ToastText": "Toast",
"TimerText": "Timer"
},
"BootstrapBlazor.Shared.Pages.GlobalException": {
"Title": "Global exception",
"P1": "Added component <code>BlazorLogger</code> Through this component, global logs and exceptions can be output uniformly; currently, the <code>Blazor</code> framework does not provide a <code>MVC</code> like < b>Global exception</b> The overall solution, for the time being, you need to use <code>try/catch</code> in the code block for exception capture",
"H1": "Instructions",
"P2": "1. Add <code>AddLogging</code> to the <code>Startup</code> file to enable the <code>net core</code> system log function",
"P3": "2. Use <code>BlazorLogger</code> to wrap the content, such as: <code>Body</code> in <code>MainLayout</code>",
"P4": "3. Use cascading parameters in the code to get examples",
"P5": "4. Console or <b>IIS</b> output visible log information",
"Block1Title": "Test",
"Block1Intro": "This function is to obtain the component instance through the cascade parameter and use its function",
"P6": "In this example code, an error code that divides by zero is written. Because <code>try/catch</code> is used to capture the exception, the error message is displayed in the console below",
"ButtonText": "test"
},
"BootstrapBlazor.Shared.Pages.Components.Block": {
"Title": "",
"SubTitle": "Demo"

View File

@ -97,10 +97,6 @@
"P9": "<b>不显示标签</b><div>设置 <code>ShowLabel='false'</code>,组件内的所有表单组件 <b>不显示</b> 标签</div>",
"P10": "<b>显示标签</b><div>设置样式 <code>form-inline</code>,组件内的所有表单组件标签前置</div>"
},
"BootstrapBlazor.Shared.Pages.Components.Block": {
"Title": "未设置",
"SubTitle": "示例"
},
"BootstrapBlazor.Shared.Pages.Install": {
"InstallTitle": "安装",
"GitP1": "Git 工具有很多种大家比较熟悉的,这里我介绍两款 Git 客户端工具",
@ -394,6 +390,23 @@
"ToastText": "轻量弹窗 Toast",
"TimerText": "计时器 Timer"
},
"BootstrapBlazor.Shared.Pages.GlobalException": {
"Title": "全局异常",
"P1": "增加组件 <code>BlazorLogger</code> 通过本组件可以对全局的日志、异常进行统一输出;目前由于 <code>Blazor</code> 框架并未提供一个类似 <code>MVC</code> 的 <b>全局异常</b> 整体解决方案,暂时还需要在代码块中使用 <code>try/catch</code> 进行异常捕获",
"H1": "使用方法",
"P2": "1. <code>Startup</code> 文件中增加 <code>AddLogging</code> 开启 <code>net core</code> 系统日志功能",
"P3": "2. 使用 <code>BlazorLogger</code> 对内容进行包裹,如:<code>MainLayout</code> 中对 <code>Body</code> 使用",
"P4": "3. 代码中使用级联参数获取实例",
"P5": "4. 控制台或者 <b>IIS</b> 输出可见日志信息",
"Block1Title": "测试",
"Block1Intro": "本功能是通过级联参数获取到组件实例并使用其功能",
"P6": "本例代码中写了一个除以零的错误代码,由于使用了 <code>try/catch</code> 对异常进行了捕获,将错误信息显示到下面控制台中",
"ButtonText": "测试"
},
"BootstrapBlazor.Shared.Pages.Components.Block": {
"Title": "未设置",
"SubTitle": "示例"
},
"BootstrapBlazor.Shared.Pages.Components.Tips": {
"Title": "小提示"
},

View File

@ -1,26 +1,27 @@
@page "/globalexception"
@layout ComponentLayout
@inject IStringLocalizer<GlobalException> Localizer
<h3>全局异常</h3>
<h3>@Localizer["Title"]</h3>
<p>增加组件 <code>BlazorLogger</code> 通过本组件可以对全局的日志、异常进行统一输出;目前由于 <code>Blazor</code> 框架并未提供一个类似 <code>MVC</code> 的 <b>全局异常</b> 整体解决方案,暂时还需要在代码块中使用 <code>try/catch</code> 进行异常捕获</p>
<p>@((MarkupString)Localizer["P1"].Value)</p>
<h4>使用方法</h4>
<h4>@Localizer["H1"]</h4>
<p>1. <code>Startup</code> 文件中增加 <code>AddLogging</code> 开启 <code>net core</code> 系统日志功能</p>
<p>@((MarkupString)Localizer["P2"].Value)</p>
<Pre>public void ConfigureServices(IServiceCollection services)
{
services.AddLogging(builder => builder.AddConsole());
}</Pre>
<p>2. 使用 <code>BlazorLogger</code> 对内容进行包裹,如:<code>MainLayout</code> 中对 <code>Body</code> 使用</p>
<p>@((MarkupString)Localizer["P3"].Value)</p>
<Pre>&lt;BlazorLogger&gt;
@@Body
&lt;/BlazorLogger&gt;</Pre>
<p>3. 代码中使用级联参数获取实例</p>
<p>@((MarkupString)Localizer["P4"].Value)</p>
<Pre>[CascadingParameter]
[NotNull]
@ -39,7 +40,7 @@ private void OnClick()
}
}</Pre>
<p>4. 控制台或者 <b>IIS</b> 输出可见日志信息</p>
<p>@((MarkupString)Localizer["P5"].Value)</p>
<Pre>crit: BootstrapBlazor.Components.BlazorLogger[0]
TimeStamp: 8/23/2021 12:20:46 PM
MachineName: ECS-A399
@ -57,8 +58,8 @@ private void OnClick()
System.DivideByZeroException: Attempted to divide by zero.
at BootstrapBlazor.Shared.Pages.GlobalException.OnClick() in D:\Argo\src\BB\BootstrapBlazor\src\BootstrapBlazor.Shared\Pages\GlobalException.razor.cs:line 30</Pre>
<Block Title="测试" Introduction="本功能是通过级联参数获取到组件实例并使用其功能">
<p>本例代码中写了一个除以零的错误代码,由于使用了 <code>try/catch</code> 对异常进行了捕获,将错误信息显示到下面控制台中</p>
<Button Icon="fa fa-fa" Text="测试" OnClick="OnClick" />
<Block Title="@Localizer["Block1Title"]" Introduction="@Localizer["Block1Intro"]">
<p>@((MarkupString)Localizer["P6"].Value)</p>
<Button Icon="fa fa-fa" Text="@Localizer["ButtonText"]" OnClick="OnClick" />
<BlockLogger @ref="Trace" class="mt-3" />
</Block>