Skip to content

Commit 283835a

Browse files
committed
Added pluralization
1 parent 5f56643 commit 283835a

3 files changed

Lines changed: 47 additions & 2 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
SmartFormat
2+
https://github.com/axuno/SmartFormat/blob/main/LICENSE.md
3+
MIT
4+
https://github.com/axuno/SmartFormat
5+
6+
The MIT License (MIT)
7+
=====================
8+
9+
Copyright � 2011-2022 SmartFormat Project maintainers and contributors.
10+
11+
All rights reserved.
12+
13+
* Project founder: Scott Rippey
14+
* Project owner: axuno gGmbH
15+
16+
Permission is hereby granted, free of charge, to any person
17+
obtaining a copy of this software and associated documentation
18+
files (the �Software�), to deal in the Software without
19+
restriction, including without limitation the rights to use,
20+
copy, modify, merge, publish, distribute, sublicense, and/or sell
21+
copies of the Software, and to permit persons to whom the
22+
Software is furnished to do so, subject to the following
23+
conditions:
24+
25+
The above copyright notice and this permission notice shall be
26+
included in all copies or substantial portions of the Software.
27+
28+
THE SOFTWARE IS PROVIDED �AS IS�, WITHOUT WARRANTY OF ANY KIND,
29+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
30+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
32+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
33+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
34+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
35+
OTHER DEALINGS IN THE SOFTWARE.
36+
37+
---
38+
39+
The bundled project *SmartFormat.ZString* is Copyright � Cysharp, Inc. [Their software](https://github.com/Cysharp/ZString)
40+
is licensed under [The MIT License (MIT)](src/SmartFormat.ZString/repo/LICENSE).
41+
Their conversion methods under the `ZString/Number` directory
42+
is Copyright � .NET Foundation and Contributors und is licensed
43+
under [The MIT License (MIT)](https://github.com/dotnet/runtime/blob/master/LICENSE.TXT).

src/Sdk/SecureFolderFS.Sdk/Extensions/LocalizationExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using SecureFolderFS.Sdk.Services;
44
using SecureFolderFS.Shared;
55
using SecureFolderFS.Shared.Helpers;
6+
using SmartFormat;
67

78
namespace SecureFolderFS.Sdk.Extensions
89
{
@@ -43,7 +44,7 @@ public static string ToLocalized(this string resourceKey, ILocalizationService?
4344
public static string ToLocalized(this string resourceKey, params object?[] interpolate)
4445
{
4546
var localized = ToLocalized(resourceKey);
46-
return SafetyHelpers.NoFailureResult(() => string.Format(localized, interpolate)) ?? localized;
47+
return SafetyHelpers.NoFailureResult(() => Smart.Format(localized, interpolate)) ?? localized;
4748
}
4849

4950
/// <summary>
@@ -57,7 +58,7 @@ public static string ToLocalized(this string resourceKey, params object?[] inter
5758
public static string ToLocalized(this string resourceKey, ILocalizationService localizationService, params object?[] interpolate)
5859
{
5960
var localized = ToLocalized(resourceKey, localizationService);
60-
return SafetyHelpers.NoFailureResult(() => string.Format(localized, interpolate)) ?? localized;
61+
return SafetyHelpers.NoFailureResult(() => Smart.Format(localized, interpolate)) ?? localized;
6162
}
6263
}
6364
}

src/Sdk/SecureFolderFS.Sdk/SecureFolderFS.Sdk.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<ItemGroup>
1111
<PackageReference Include="ByteSize" Version="2.1.2" />
1212
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
13+
<PackageReference Include="SmartFormat" Version="3.6.1" />
1314
</ItemGroup>
1415

1516
<ItemGroup>

0 commit comments

Comments
 (0)