Skip to content

Commit 4c3f50e

Browse files
authored
[dev-v5] Add DateTimeProvider and DateTimeExtensions (#3714)
1 parent 986ab59 commit 4c3f50e

15 files changed

+1321
-7
lines changed

Directory.Packages.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.13.61" />
3232
<PackageVersion Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0" />
3333
<PackageVersion Include="Microsoft.TypeScript.MSBuild" Version="5.8.1" />
34-
<PackageVersion Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.11.0-beta1.24527.2" />
34+
<PackageVersion Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.12.0-beta1.25155.1" />
3535
</ItemGroup>
3636
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
3737
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="$(RuntimeVersion9)" />

examples/Demo/FluentUI.Demo.Client/Documentation/GetStarted/Localization.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ Here's a step-by-step guide:
3434
return key switch
3535
{
3636
"SomeKey" => "Your Custom Translation",
37-
"AnotherKey" => String.Format("Another Custom Translation {0}",
37+
"AnotherKey" => String.Format("Another Custom Translation {0}"),
3838

3939
// Fallback to the Default/English if no translation is found
40-
_ => IFluentLocalizer.GetDefault(key, arguments)
40+
_ => IFluentLocalizer.GetDefault(key, arguments),
4141
};
4242
}
4343
}
@@ -46,7 +46,9 @@ Here's a step-by-step guide:
4646

4747
> **Note:**
4848
>
49-
> The list of keys can be found in the `Core\Microsoft.FluentUI.AspNetCore.Components\Localization\LanguageResource.resx` file.
49+
> The list of keys can be found in the `Core\Microsoft.FluentUI.AspNetCore.Components\Localization\LanguageResource.resx` file.
50+
> Or you can use a constant from the `Microsoft.FluentUI.AspNetCore.Components.Localization.LanguageResource` class.
51+
> Example: `Localization.LanguageResource.MessageBox_ButtonOk`.
5052

5153
2. **Register the Custom Localizer**
5254

spelling.dic

+6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ datalist
1515
elementreference
1616
evenodd
1717
gzip
18+
heure
19+
heures
1820
javascript
21+
jours
22+
maintenant
1923
menuchecked
2024
menuclicked
2125
menuitem
@@ -26,6 +30,7 @@ menuitemradio
2630
menuitemradioobsolete
2731
menuitems
2832
microsoft
33+
mois
2934
myid
3035
noattribute
3136
nonfile
@@ -45,6 +50,7 @@ demopanel
4550
dialogtoggle
4651
rightclick
4752
rrggbb
53+
secondes
4854
sourcecode
4955
summarydata
5056
tabindex

src/Core/Components/Base/FluentInputBase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ protected virtual async Task ChangeHandlerAsync(ChangeEventArgs e)
211211
protected virtual string? GetAriaLabelWithRequired()
212212
{
213213
return (AriaLabel ?? Label ?? string.Empty) +
214-
(Required == true ? $", {Localizer["FluentInputBase_Required"]}" : string.Empty);
214+
(Required == true ? $", {Localizer[Localization.LanguageResource.FluentInputBase_Required]}" : string.Empty);
215215
}
216216

217217
/// <summary>

src/Core/Components/Layout/FluentLayoutHamburger.razor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public partial class FluentLayoutHamburger
7878
/// <summary />
7979
protected override void OnInitialized()
8080
{
81-
Title = Localizer["FluentLayoutHamburger_Title"];
81+
Title = Localizer[Localization.LanguageResource.FluentLayoutHamburger_Title];
8282

8383
var layout = Layout ?? LayoutContainer;
8484
layout?.AddHamburger(this);

0 commit comments

Comments
 (0)