Skip to content

Commit 707f55a

Browse files
committed
feat: 增加 Lang 自动设置
1 parent 168e19d commit 707f55a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

55
using Microsoft.AspNetCore.Components;
6+
using System.Globalization;
67

78
namespace BootstrapBlazor.Components;
89

@@ -47,6 +48,16 @@ public partial class UniverSheet
4748

4849
private UniverSheetData? _lastData;
4950

51+
/// <summary>
52+
/// <inheritdoc/>
53+
/// </summary>
54+
protected override void OnParametersSet()
55+
{
56+
base.OnParametersSet();
57+
58+
Lang ??= CultureInfo.CurrentUICulture.Name;
59+
}
60+
5061
/// <summary>
5162
/// <inheritdoc/>
5263
/// </summary>

0 commit comments

Comments
 (0)