File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
Components/NetworkMonitor Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 55
6+ using Microsoft . Extensions . Localization ;
7+
68namespace BootstrapBlazor . Components ;
79
810/// <summary>
@@ -32,8 +34,11 @@ public partial class NetworkMonitorIndicator
3234 [ NotNull ]
3335 public string ? Trigger { get ; set ; }
3436
37+ [ Inject , NotNull ]
38+ private IStringLocalizer < NetworkMonitorIndicator > ? Localizer { get ; set ; }
39+
3540 private NetworkMonitorState _state = new ( ) ;
36- private List < string > _indicators = [ ] ;
41+ private readonly List < string > _indicators = [ ] ;
3742
3843 private string ? ClassString => CssBuilder . Default ( "bb-nt-indicator" )
3944 . AddClass ( "bb-nt-indicator-4g" , _state . NetworkType == "4g" )
@@ -60,7 +65,7 @@ protected override void OnParametersSet()
6065 base . OnParametersSet ( ) ;
6166
6267 Trigger ??= "hover focus" ;
63- Title ??= "网络状态" ;
68+ Title ??= Localizer [ "NetworkMonitorIndicatorTitle" ] ;
6469 }
6570
6671 private Task OnNetworkStateChanged ( NetworkMonitorState state )
Original file line number Diff line number Diff line change 389389 },
390390 "BootstrapBlazor.Components.ValidateBase" : {
391391 "DefaultRequiredErrorMessage" : " {0} is required."
392+ },
393+ "BootstrapBlazor.Components.NetworkMonitorIndicator" : {
394+ "NetworkMonitorIndicatorTitle" : " Network"
392395 }
393396}
Original file line number Diff line number Diff line change 389389 },
390390 "BootstrapBlazor.Components.ValidateBase" : {
391391 "DefaultRequiredErrorMessage" : " {0}是必填项"
392+ },
393+ "BootstrapBlazor.Components.NetworkMonitorIndicator" : {
394+ "NetworkMonitorIndicatorTitle" : " 网络状态"
392395 }
393396}
You can’t perform that action at this time.
0 commit comments