Skip to content

[dev-v5] Add DateTimeProvider and DateTimeExtensions #3714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.13.61" />
<PackageVersion Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0" />
<PackageVersion Include="Microsoft.TypeScript.MSBuild" Version="5.8.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.11.0-beta1.24527.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.12.0-beta1.25155.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="$(RuntimeVersion9)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Here's a step-by-step guide:
return key switch
{
"SomeKey" => "Your Custom Translation",
"AnotherKey" => String.Format("Another Custom Translation {0}",
"AnotherKey" => String.Format("Another Custom Translation {0}"),

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

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

2. **Register the Custom Localizer**

Expand Down
6 changes: 6 additions & 0 deletions spelling.dic
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ datalist
elementreference
evenodd
gzip
heure
heures
javascript
jours
maintenant
menuchecked
menuclicked
menuitem
Expand All @@ -26,6 +30,7 @@ menuitemradio
menuitemradioobsolete
menuitems
microsoft
mois
myid
noattribute
nonfile
Expand All @@ -45,6 +50,7 @@ demopanel
dialogtoggle
rightclick
rrggbb
secondes
sourcecode
summarydata
tabindex
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Components/Base/FluentInputBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected virtual async Task ChangeHandlerAsync(ChangeEventArgs e)
protected virtual string? GetAriaLabelWithRequired()
{
return (AriaLabel ?? Label ?? string.Empty) +
(Required == true ? $", {Localizer["FluentInputBase_Required"]}" : string.Empty);
(Required == true ? $", {Localizer[Localization.LanguageResource.FluentInputBase_Required]}" : string.Empty);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public partial class FluentLayoutHamburger
/// <summary />
protected override void OnInitialized()
{
Title = Localizer["FluentLayoutHamburger_Title"];
Title = Localizer[Localization.LanguageResource.FluentLayoutHamburger_Title];

var layout = Layout ?? LayoutContainer;
layout?.AddHamburger(this);
Expand Down
Loading