Skip to content

Commit

Permalink
Merge pull request #598 from hangy/issue597
Browse files Browse the repository at this point in the history
Workaround for Croatian TimeSpan localization bug
  • Loading branch information
Oren Novotny authored Dec 2, 2016
2 parents ea5c0b5 + 4d6a015 commit 3399341
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Localisation\he\NumberToWordsTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\he\TimeSpanHumanizeTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\hr\DateHumanizeTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\hr\TimeSpanHumanizeTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\hu\DateHumanizeTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\hu\TimeSpanHumanizeTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\id\DateHumanizeTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using Xunit;

namespace Humanizer.Tests.Localisation.hr
{
[UseCulture("hr-HR")]
public class TimeSpanHumanizeTests
{
[Theory]
[InlineData(1, "1 dan")]
[InlineData(2, "2 dana")]
[InlineData(3, "3 dana")]
[InlineData(4, "4 dana")]
[InlineData(5, "5 dana")]
[InlineData(7, "1 tjedan")]
[InlineData(14, "2 tjedna")]
public void Days(int days, string expected)
{
Assert.Equal(expected, TimeSpan.FromDays(days).Humanize());
}
}
}
5 changes: 4 additions & 1 deletion src/Humanizer/Properties/Resources.hr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@
<data name="TimeSpanHumanize_MultipleDays" xml:space="preserve">
<value>{0} dana</value>
</data>
<data name="TimeSpanHumanize_MultipleDays_DualTrialQuadral" xml:space="preserve">
<value>{0} dana</value>
</data>
<data name="TimeSpanHumanize_MultipleHours" xml:space="preserve">
<value>{0} sati</value>
</data>
Expand Down Expand Up @@ -276,4 +279,4 @@
<data name="DateHumanize_SingleYearFromNow" xml:space="preserve">
<value>za godinu dana</value>
</data>
</root>
</root>

0 comments on commit 3399341

Please sign in to comment.