mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-02 03:59:14 +08:00
doc(GlobalOptions): add GlobalOpton documentation (#3848)
* doc: 更正单词拼写错误 * doc: 增加全局配置文档 * doc: 更改本地化键值 * doc: 更新文档
This commit is contained in:
parent
5880cc1e39
commit
098894b3bc
@ -0,0 +1,89 @@
|
||||
@page "/global-option"
|
||||
@inject IStringLocalizer<GlobalOption> Localizer
|
||||
|
||||
<h3>@Localizer["Title"]</h3>
|
||||
|
||||
<h4>@((MarkupString)Localizer["SubTitle"].Value)</h4>
|
||||
|
||||
<p class="code-label">1. <code>ToastDelay</code></p>
|
||||
|
||||
<p>通过此配置统一设置 <code>ToastService</code> 服务弹窗自动关闭延时时长,默认值为 <code>0</code> 未设置,使用服务内部设置</p>
|
||||
|
||||
<p class="code-label">2. <code>ToastPlacement</code></p>
|
||||
|
||||
<p>通过此配置统一设置 <code>ToastService</code> 服务弹窗出现位置,默认值为 <code>null</code> 未设置,使用服务内部设置</p>
|
||||
|
||||
<p class="code-label">3. <code>MessageDelay</code></p>
|
||||
|
||||
<p>通过此配置统一设置 <code>MessageService</code> 服务弹窗自动关闭延时时长,默认值为 <code>0</code> 未设置,使用服务内部设置</p>
|
||||
|
||||
<p class="code-label">4. <code>SwalDelay</code></p>
|
||||
|
||||
<p>通过此配置统一设置 <code>SwalService</code> 服务弹窗自动关闭延时时长,默认值为 <code>0</code> 未设置,使用服务内部设置</p>
|
||||
|
||||
<p class="code-label">5. <code>DefaultCultureInfo</code></p>
|
||||
|
||||
<p>默认文化信息,本组件开启多语言功能后,会自动根据浏览器请求语言设置相对应的文化信息,有时候我们设置一个默认文化信息,比如即使是英文浏览器,首次打开时也需要显示中文,此时可设置 <code>zh-CN</code> 默认为 null 未设置</p>
|
||||
|
||||
<p class="code-label">6. <code>FallbackCulture</code> 回落文化</p>
|
||||
|
||||
<p>通过此配置解决某些操作系统如 <code>CentOS</code> 等 <code>netcore</code> 程序默认无法读取当前进程/线程文化问题。默认值为 <code>en</code> 读取不到当前应用文化信息时使用此参数值</p>
|
||||
|
||||
<p class="code-label">7. <code>EnableFallbackCulture</code> 是否启用回落文化</p>
|
||||
|
||||
<p>通过此配置设置是否启用回落到父文化,如当前文化信息为 <code>zh-CN</code> 如果未找到其资源文件时,会自动寻找 <code>zh-hans</code> <code>zh</code>;如当前文化信息为 <code>en-US</code> 可回落到 <code>en</code></p>
|
||||
|
||||
<p class="code-label">8. <code>IgnoreLocalizerMissing</code> 忽略本地化丢失信息</p>
|
||||
|
||||
<p>启用本地化功能后,如果设置的本地化资源键值未找到时,客户端或者终端会显示提示信息,如果需要关闭这些信息,可设置 <code>IgnoreLocalizerMissing=\"true\"</code> 其默认值为 <code>false</code></p>
|
||||
|
||||
<p class="code-label">9. <code>EnableErrorLogger</code> 是否启用错误日志</p>
|
||||
|
||||
<p>通过此参数设置组件库内置 <code>ErrorLogger</code> 是否启用,默认值 <code>true</code></p>
|
||||
|
||||
<Pre>{
|
||||
"BootstrapBlazorOptions": {
|
||||
"ToastDelay": 4000,
|
||||
"MessageDelay": 4000,
|
||||
"SwalDelay": 4000,
|
||||
"EnableErrorLogger": true,
|
||||
"FallbackCulture": "en",
|
||||
"SupportedCultures": [
|
||||
"zh-CN",
|
||||
"en-US"
|
||||
],
|
||||
"TableSettings": {
|
||||
"CheckboxColumnWidth": 36,
|
||||
"TableExportOptions": {
|
||||
"EnableFormat": true,
|
||||
"EnableLookup": true,
|
||||
"AutoMergeArray": true,
|
||||
"ArrayDelimiter": ","
|
||||
}
|
||||
},
|
||||
"IgnoreLocalizerMissing": true,
|
||||
"StepSettings": {
|
||||
"Short": "1",
|
||||
"Int": "1",
|
||||
"Long": "1",
|
||||
"Float": "0.1",
|
||||
"Double": "0.01",
|
||||
"Decimal": "0.01"
|
||||
},
|
||||
"ConnectionHubOptions": {
|
||||
"Enable": true,
|
||||
"EnableIpLocator": true,
|
||||
"ExpirationScanFrequency": "00:05:00",
|
||||
"TimeoutInterval": "00:03:00",
|
||||
"BeatInterval": "00:00:30"
|
||||
},
|
||||
"IpLocatorOptions": {
|
||||
"EnableCache": true,
|
||||
"SlidingExpiration": "24:00:00",
|
||||
"ProviderName": "BaiduIpLocatorProvider"
|
||||
},
|
||||
"WebClientOptions": {
|
||||
"EnableIpLocator": true
|
||||
}
|
||||
}
|
||||
}</Pre>
|
@ -1,5 +1,5 @@
|
||||
@page "/globalization"
|
||||
@inject IStringLocalizer<Golbalization> Localizer
|
||||
@inject IStringLocalizer<Globalization> Localizer
|
||||
|
||||
<h3>@Localizer["Title"]</h3>
|
||||
|
@ -234,6 +234,11 @@ internal static class MenusLocalizerExtensions
|
||||
Url = "global-exception"
|
||||
},
|
||||
new()
|
||||
{
|
||||
Text = Localizer["GlobalOption"],
|
||||
Url = "global-option"
|
||||
},
|
||||
new()
|
||||
{
|
||||
Text = Localizer["WebAppBlazor"],
|
||||
Url = "install-webapp",
|
||||
|
@ -1179,7 +1179,7 @@
|
||||
"P17": "Install Project template",
|
||||
"P18": "Create Project"
|
||||
},
|
||||
"BootstrapBlazor.Server.Components.Pages.Golbalization": {
|
||||
"BootstrapBlazor.Server.Components.Pages.Globalization": {
|
||||
"Title": "Globalization",
|
||||
"SubTitle": "ASP.NET Core Blazor Globalization",
|
||||
"P1": "Please check <a href='https://learn.microsoft.com/zh-cn/aspnet/core/blazor/globalization-localization?WT.mc_id=DT-MVP-5004174' target='_blank'> before reading the following knowledge points Official document</a>"
|
||||
@ -1721,6 +1721,10 @@
|
||||
"Block2Title": "OnErrorHandleAsync",
|
||||
"Block2Intro": "Set custom exception handling logic by setting <code>OnErrorHandleAsync</code> callback method"
|
||||
},
|
||||
"BootstrapBlazor.Server.Components.Pages.GlobalOption": {
|
||||
"Title": "Global exception",
|
||||
"SubTitle": "Added component <code>ErrorLogger</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"
|
||||
},
|
||||
"BootstrapBlazor.Server.Components.Samples.Splits": {
|
||||
"SplitsTitle": "Split",
|
||||
"SplitsNormalTitle": "Basic usage",
|
||||
@ -4439,6 +4443,7 @@
|
||||
"Breakpoints": "Breakpoints",
|
||||
"Theme": "Theme",
|
||||
"GlobalException": "Global Exception",
|
||||
"GlobalOption": "Global Option",
|
||||
"LayoutPage": "Admin Template",
|
||||
"FAIcon": "FontAwesome Icons",
|
||||
"Components": "Components",
|
||||
|
@ -1179,7 +1179,7 @@
|
||||
"P17": "安装项目模板",
|
||||
"P18": "创建项目"
|
||||
},
|
||||
"BootstrapBlazor.Server.Components.Pages.Golbalization": {
|
||||
"BootstrapBlazor.Server.Components.Pages.Globalization": {
|
||||
"Title": "全球化",
|
||||
"SubTitle": "ASP.NET Core Blazor 全球化",
|
||||
"P1": "阅读以下知识点前请先查看 <a href='https://learn.microsoft.com/zh-cn/aspnet/core/blazor/globalization-localization?WT.mc_id=DT-MVP-5004174' target='_blank'>微软官方文档</a>"
|
||||
@ -1721,6 +1721,10 @@
|
||||
"Block2Title": "自定义错误处理",
|
||||
"Block2Intro": "通过设置 <code>OnErrorHandleAsync</code> 回调方法,设置自定义异常处理逻辑"
|
||||
},
|
||||
"BootstrapBlazor.Server.Components.Pages.GlobalOption": {
|
||||
"Title": "全局配置",
|
||||
"SubTitle": "组件库提供一种对当前应用程序中所有组件进行配置的方法,通过 <code>BootstrapBlazorOptions</code> 全局配置类实现此功能"
|
||||
},
|
||||
"BootstrapBlazor.Server.Components.Samples.Splits": {
|
||||
"SplitsTitle": "Split 面板分割",
|
||||
"SplitsNormalTitle": "基础用法",
|
||||
@ -4439,6 +4443,7 @@
|
||||
"Theme": "组件主题",
|
||||
"Labels": "表单标签",
|
||||
"GlobalException": "全局异常",
|
||||
"GlobalOption": "全局配置",
|
||||
"LayoutPage": "后台模拟器",
|
||||
"FAIcon": "FontAwesome 图标集合",
|
||||
"Components": "组件总览",
|
||||
|
Loading…
Reference in New Issue
Block a user