Skip to content

Commit 42295d4

Browse files
author
Jani Giannoudis
committed
added CultureTool.cs
1 parent ed59c25 commit 42295d4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Client.Test/CultureTool.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Globalization;
2+
using PayrollEngine.Client.Model;
3+
4+
namespace PayrollEngine.Client.Test
5+
{
6+
internal static class CultureTool
7+
{
8+
internal static CultureInfo GetTenantCulture(Tenant tenant)
9+
{
10+
var culture = CultureInfo.DefaultThreadCurrentCulture ?? CultureInfo.InvariantCulture;
11+
if (!string.IsNullOrWhiteSpace(tenant.Culture) &&
12+
!string.Equals(culture.Name, tenant.Culture))
13+
{
14+
culture = new CultureInfo(tenant.Culture);
15+
}
16+
return culture;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)