From b08d4c7f3292715161bfb49bdd0e5d87a469fca3 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 19 May 2026 12:56:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?doc:=20=E5=90=88=E5=B9=B6=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Layout/TutorialsNavMenu.razor.cs | 19 ++++++--------- .../Components/Pages/Tutorials.razor | 5 ++-- src/BootstrapBlazor.Server/Locales/en-US.json | 23 +++++++++++-------- src/BootstrapBlazor.Server/Locales/zh-CN.json | 23 +++++++++++-------- 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs b/src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs index 0a6b2b4bba3..710d2218814 100644 --- a/src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone -using BootstrapBlazor.Server.Components.Pages; using Microsoft.AspNetCore.Components.Web; using System.Text; @@ -20,11 +19,7 @@ public partial class TutorialsNavMenu [Inject] [NotNull] - private IStringLocalizer? TutorialsLocalizer { get; set; } - - [Inject] - [NotNull] - private IStringLocalizer? Localizer { get; set; } + private IStringLocalizer? Localizer { get; set; } [Inject] [NotNull] @@ -52,12 +47,12 @@ protected override async Task OnInitializedAsync() new() { Template = CreateDownloadButtonComponent("dashboard", _dashboardFileList), - Text = TutorialsLocalizer["DashboardSummary"], + Text = Localizer["DashboardSummary"], Url = "tutorials/dashboard" }, new() { - Text = TutorialsLocalizer["LoginSummary"], + Text = Localizer["LoginSummary"], Url = "tutorials/login", Items = [ @@ -96,24 +91,24 @@ protected override async Task OnInitializedAsync() new() { Template = CreateDownloadButtonComponent("waterfall", _waterfallFileList), - Text = TutorialsLocalizer["WaterfallSummary"], + Text = Localizer["WaterfallSummary"], Url = "tutorials/waterfall" }, new() { Template = CreateDownloadButtonComponent("translate", _translateFileList), - Text = TutorialsLocalizer["TranslateSummary"], + Text = Localizer["TranslateSummary"], Url = "tutorials/translate" }, new() { Template = CreateDownloadButtonComponent("drawing", _drawingAppFileList), - Text = TutorialsLocalizer["DrawingSummary"], + Text = Localizer["DrawingSummary"], Url = "tutorials/drawing" }, new() { - Text = TutorialsLocalizer["AdminSummary"], + Text = Localizer["AdminSummary"], Url = "tutorials/admin", }, new() diff --git a/src/BootstrapBlazor.Server/Components/Pages/Tutorials.razor b/src/BootstrapBlazor.Server/Components/Pages/Tutorials.razor index 146b4d641c7..386c74238a2 100644 --- a/src/BootstrapBlazor.Server/Components/Pages/Tutorials.razor +++ b/src/BootstrapBlazor.Server/Components/Pages/Tutorials.razor @@ -1,6 +1,6 @@ -@layout TutorialsLayout +@layout TutorialsLayout @page "/tutorials" -@inject IStringLocalizer Localizer +@inject IStringLocalizer Localizer @@ -10,4 +10,3 @@ - diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 4b79170e473..33f2afdaa68 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -469,6 +469,13 @@ "ZipArchive": "IZipArchiveService" }, "BootstrapBlazor.Server.Components.Layout.TutorialsNavMenu": { + "AdminSummary": "Admin", + "CategoryTitle": "Bootstrap Blazor Practical Cases", + "DashboardSummary": "Dashboard", + "DrawingSummary": "Drawing", + "LoginSummary": "Login&Register", + "TranslateSummary": "Translate", + "WaterfallSummary": "Waterfall", "MemorialMode": "Memorial", "MFA": "MFA", "OnlineSheet": "UniverSheet" @@ -716,15 +723,6 @@ "P8": "theme, please use the original", "P9": "The added style file is as follows" }, - "BootstrapBlazor.Server.Components.Pages.Tutorials": { - "AdminSummary": "Admin", - "CategoryTitle": "Bootstrap Blazor Practical Cases", - "DashboardSummary": "Dashboard", - "DrawingSummary": "Drawing", - "LoginSummary": "Login&Register", - "TranslateSummary": "Translate", - "WaterfallSummary": "Waterfall" - }, "BootstrapBlazor.Server.Components.Samples.Affixs": { "AffixIntro": "Fix the element to a specific visible area", "AffixNormalIntro": "Affix is fixed at the top of the page by default", @@ -5706,6 +5704,13 @@ "UrlDesc": "Use your iPhone's camera or the QR code scanning function to scan the QR code below, then open the Safari browser and open the current address", "WiFiDesc": "Use your iPhone's camera or the QR code scanner to scan the QR code below to automatically join the WiFi network." }, + "BootstrapBlazor.Server.Components.Samples.Tutorials.Memorial": { + "ToggleButtonText": "Toggle Memorial Mode", + "Step1Title": "1. Load the Utility module", + "Step2Title": "2. Enable memorial mode", + "Step3Title": "3. Enable memorial mode site-wide by default", + "Step3Description": "Update the App.razor document as follows" + }, "BootstrapBlazor.Server.Components.Samples.Tutorials.OnlineSheet.OnlineSheet": { "ToastOnReadyContent": "After 4 seconds the table is updated by other writers to change the content", "ToastOnReadyTitle": "Collaboration Notification" diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index fdaf580ce06..6ff7a336696 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -469,6 +469,13 @@ "ZipArchive": "压缩归档服务 IZipArchiveService" }, "BootstrapBlazor.Server.Components.Layout.TutorialsNavMenu": { + "AdminSummary": "中台 Admin", + "CategoryTitle": "BootstrapBlazor 实战案例", + "DashboardSummary": "仪表盘 Dashboard", + "DrawingSummary": "画图 Drawing", + "LoginSummary": "登陆注册 Login&Register", + "TranslateSummary": "翻译工具 Translate", + "WaterfallSummary": "瀑布流图片 Waterfall", "MemorialMode": "追悼模式", "MFA": "多因子认证 MFA", "OnlineSheet": "在线表格 UniverSheet" @@ -716,15 +723,6 @@ "P8": "主题,则请在原有", "P9": "内增加样式文件如下" }, - "BootstrapBlazor.Server.Components.Pages.Tutorials": { - "AdminSummary": "中台 Admin", - "CategoryTitle": "BootstrapBlazor 实战案例", - "DashboardSummary": "仪表盘 Dashboard", - "DrawingSummary": "画图 Drawing", - "LoginSummary": "登陆注册 Login&Register", - "TranslateSummary": "翻译工具 Translate", - "WaterfallSummary": "瀑布流图片 Waterfall" - }, "BootstrapBlazor.Server.Components.Samples.Affixs": { "AffixIntro": "将页面元素钉在可视范围", "AffixNormalIntro": "固钉默认固定在页面顶部", @@ -5706,6 +5704,13 @@ "UrlDesc": "使用 iPhone 手机相机或者扫描二维码功能扫描下方二维码后,打开 Safari 浏览器并且打开当前地址", "WiFiDesc": "使用 iPhone 手机相机或者扫描二维码功能扫描下方二维码后,自动加入 WiFi 网络" }, + "BootstrapBlazor.Server.Components.Samples.Tutorials.Memorial": { + "ToggleButtonText": "切换哀悼模式", + "Step1Title": "1. 加载 Utility 工具", + "Step2Title": "2. 设置哀悼模式", + "Step3Title": "3. 全站默认设置追悼模式方法", + "Step3Description": "更新 App.razor 文档内容如下" + }, "BootstrapBlazor.Server.Components.Samples.Tutorials.OnlineSheet.OnlineSheet": { "ToastOnReadyContent": "4 秒后表格更新其他写作人员更改内容", "ToastOnReadyTitle": "在线表格协作通知" From 1179158660868d778cdc39fae68b9e0da8ab6158 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 19 May 2026 12:59:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?doc:=20=E8=BF=BD=E6=82=BC=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=9A=E8=AF=AD=E8=A8=80=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Samples/Tutorials/Memorial.razor | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Tutorials/Memorial.razor b/src/BootstrapBlazor.Server/Components/Samples/Tutorials/Memorial.razor index 1bcbf7b2dbd..225c1243869 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Tutorials/Memorial.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Tutorials/Memorial.razor @@ -1,13 +1,14 @@ -@page "/tutorials/memorial" +@page "/tutorials/memorial" +@inject IStringLocalizer Localizer - + -

1. 加载 Utlity 工具

+

@((MarkupString)Localizer["Step1Title"].Value)

var module = await JSRuntime.LoadUtility();
-

2. 设置哀悼模式

+

@Localizer["Step2Title"]

await module.InvokeVoidAsync("SetMemorial", true);
-

3. 全站默认设置追悼模式方法

-

更新 App.razor 文档内容如下

+

@Localizer["Step3Title"]

+

@((MarkupString)Localizer["Step3Description"].Value)

<html lang="en" data-bs-theme='dark' data-bb-theme="memorial">
From a1202c81bc0ffb61eaaf13eeee36339c39768c41 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 19 May 2026 13:09:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?doc:=20=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Server/Locales/en-US.json | 14 +++++++------- src/BootstrapBlazor.Server/Locales/zh-CN.json | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 33f2afdaa68..227ec99a812 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -474,11 +474,11 @@ "DashboardSummary": "Dashboard", "DrawingSummary": "Drawing", "LoginSummary": "Login&Register", - "TranslateSummary": "Translate", - "WaterfallSummary": "Waterfall", "MemorialMode": "Memorial", "MFA": "MFA", - "OnlineSheet": "UniverSheet" + "OnlineSheet": "UniverSheet", + "TranslateSummary": "Translate", + "WaterfallSummary": "Waterfall" }, "BootstrapBlazor.Server.Components.Pages.Breakpoints": { "Amount": "pixel", @@ -4605,10 +4605,10 @@ }, "BootstrapBlazor.Server.Components.Samples.Table.TablesColumnDrag": { "AllowDragOrderDesc": "

Pressing the mouse over a column heading and dragging it to another column heading position can adjust the column to be in front of the target column, but the built-in columns in the Table component, such as detail row, row number, selection, and operation columns, cannot be adjusted

This example enables local storage by setting the ClientTableName parameter. After dragging and adjusting the order, the page can be refreshed, and the column order remains in the previous state

After version 10.6.1, use OnTableColumnClientStatusChanged to uniformly handle column dragging, column resizing, and auto-fit column width callbacks, replacing the original OnDragColumnEndAsync, OnResizeColumnAsync, and OnAutoFitContentAsync callbacks.

Notes:

Table state persistence has two modes. If the ClientTableName property is set, browser local storage is used to persist information. If it is not set, server-side storage persistence is implemented through callbacks. The persistence structure is TableColumnClientStatus, which consists of the column state collection and the table width parameter.

The table width parameter defaults to 0. When all columns have width values, the table width parameter is the actual width rendered on the client. A value of 0 means the table width is adaptive.

When using browser local storage for persistence, no additional settings are required. The table automatically loads the client state.

When using server-side storage for persistence, handle table state loading and saving logic in callbacks. In actual use, the state can be stored in a database or other storage as needed. Use the OnTableColumnClientStatusChanged callback to handle server-side state changes, and use the OnLoadTableColumnClientStatus callback to restore the table persistence state.

", - "ClearTableColumnClientStatusDesc": "By calling the ClearTableColumnClientStatus method of the table component instance, the current persistent settings are cleared, restoring the table to its default settings.", - "ResetButtonText": "Reset", "AllowDragOrderIntro": "By specifying AllowDragColumn, set the table columns to allow dragging column headings to adjust the table column order", "AllowDragOrderTitle": "Allow dragging column headings to adjust table column order", + "ClearTableColumnClientStatusDesc": "By calling the ClearTableColumnClientStatus method of the table component instance, the current persistent settings are cleared, restoring the table to its default settings.", + "ResetButtonText": "Reset", "TablesColumnDescription": "Used to display multiple pieces of data with similar structures, data can be sorted, filtered, compared or other custom operations.", "TablesColumnTitle": "Table Column" }, @@ -5705,11 +5705,11 @@ "WiFiDesc": "Use your iPhone's camera or the QR code scanner to scan the QR code below to automatically join the WiFi network." }, "BootstrapBlazor.Server.Components.Samples.Tutorials.Memorial": { - "ToggleButtonText": "Toggle Memorial Mode", "Step1Title": "1. Load the Utility module", "Step2Title": "2. Enable memorial mode", + "Step3Description": "Update the App.razor document as follows", "Step3Title": "3. Enable memorial mode site-wide by default", - "Step3Description": "Update the App.razor document as follows" + "ToggleButtonText": "Toggle Memorial Mode" }, "BootstrapBlazor.Server.Components.Samples.Tutorials.OnlineSheet.OnlineSheet": { "ToastOnReadyContent": "After 4 seconds the table is updated by other writers to change the content", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 6ff7a336696..63821b6c4e1 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -474,11 +474,11 @@ "DashboardSummary": "仪表盘 Dashboard", "DrawingSummary": "画图 Drawing", "LoginSummary": "登陆注册 Login&Register", - "TranslateSummary": "翻译工具 Translate", - "WaterfallSummary": "瀑布流图片 Waterfall", "MemorialMode": "追悼模式", "MFA": "多因子认证 MFA", - "OnlineSheet": "在线表格 UniverSheet" + "OnlineSheet": "在线表格 UniverSheet", + "TranslateSummary": "翻译工具 Translate", + "WaterfallSummary": "瀑布流图片 Waterfall" }, "BootstrapBlazor.Server.Components.Pages.Breakpoints": { "Amount": "像素", @@ -4605,10 +4605,10 @@ }, "BootstrapBlazor.Server.Components.Samples.Table.TablesColumnDrag": { "AllowDragOrderDesc": "

在列标题上按下鼠标拖动到其他列标题位置可将该列调整至目标列之前,但 Table 组件内置的列如明细行列、行号列、选择列、操作列等不可被调整

本示例通过设置 ClientTableName 参数开启了本地化存储,拖动调整顺序后,可刷新页面,列顺序是保持上次状态的

10.6.1 版本后使用 OnTableColumnClientStatusChanged 统一处理列拖拽、列宽调整与自适应列宽回调,移除原 OnDragColumnEndAsync OnResizeColumnAsyncOnAutoFitContentAsync 回调。

注意事项:

表格状态持久化功能分两种情况,设置 ClientTableName 属性即使用浏览器本地存储持久化信息,如果未设置则通过回调使用服务器端存储持久化信息。持久化信息结构体为 TableColumnClientStatus 由列状态集合以及表格宽度参数组成。

表格宽度参数默认为 0 当所有列宽度均有值时,表格宽度参数值为表格在客户端渲染的实际宽度;为 0 表示表格宽度自适应

使用浏览器本地存储持久化信息时,无需任何设置,表格会自动加载客户端状态

使用服务器端存储持久化信息时,需在回调中处理表格状态加载与保存逻辑,实际使用中可根据需要使用数据库或其他方式进行存储;通过 OnTableColumnClientStatusChanged 回调处理服务器端状态,通过 OnLoadTableColumnClientStatus 回调方法对表格进行持久化状态恢复操作

", - "ClearTableColumnClientStatusDesc": "通过调用表格组件实例方法 ClearTableColumnClientStatus 清除当前持久化设置恢复表格为默认设置", - "ResetButtonText": "重置", "AllowDragOrderIntro": "通过指定 AllowDragColumn 设置表格列允许拖动列标题调整表格列顺序", "AllowDragOrderTitle": "允许拖动列标题调整表格列顺序", + "ClearTableColumnClientStatusDesc": "通过调用表格组件实例方法 ClearTableColumnClientStatus 清除当前持久化设置恢复表格为默认设置", + "ResetButtonText": "重置", "TablesColumnDescription": "用于展示多条结构类似的数据,可对数据进行排序、筛选、对比或其他自定义操作。", "TablesColumnTitle": "Table 表格" }, @@ -5705,11 +5705,11 @@ "WiFiDesc": "使用 iPhone 手机相机或者扫描二维码功能扫描下方二维码后,自动加入 WiFi 网络" }, "BootstrapBlazor.Server.Components.Samples.Tutorials.Memorial": { - "ToggleButtonText": "切换哀悼模式", "Step1Title": "1. 加载 Utility 工具", "Step2Title": "2. 设置哀悼模式", + "Step3Description": "更新 App.razor 文档内容如下", "Step3Title": "3. 全站默认设置追悼模式方法", - "Step3Description": "更新 App.razor 文档内容如下" + "ToggleButtonText": "切换哀悼模式" }, "BootstrapBlazor.Server.Components.Samples.Tutorials.OnlineSheet.OnlineSheet": { "ToastOnReadyContent": "4 秒后表格更新其他写作人员更改内容",