Skip to content
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

FEAT: Add missing values for nl #350

Closed
Closed
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
80 changes: 68 additions & 12 deletions src/Humanizer.Tests/Localisation/nl/DateHumanizeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,108 @@ public class DateHumanizeTests : AmbientCulture
public DateHumanizeTests() : base("nl-NL") { }

[Theory]
[InlineData(-2, "2 dagen geleden")]
[InlineData(-1, "gisteren")]
[InlineData(2, "2 dagen geleden")]
[InlineData(1, "gisteren")]
public void DaysAgo(int days, string expected)
{
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past);
}

[Theory]
[InlineData(-2, "2 uur geleden")]
[InlineData(-1, "1 uur geleden")]
[InlineData(2, "2 uur geleden")]
[InlineData(1, "1 uur geleden")]
public void HoursAgo(int hours, string expected)
{
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past);
}

[Theory]
[InlineData(-2, "2 minuten geleden")]
[InlineData(-1, "1 minuut geleden")]
[InlineData(2, "2 minuten geleden")]
[InlineData(1, "1 minuut geleden")]
[InlineData(60, "1 uur geleden")]
public void MinutesAgo(int minutes, string expected)
{
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past);
}

[Theory]
[InlineData(-2, "2 maanden geleden")]
[InlineData(-1, "1 maand geleden")]
[InlineData(2, "2 maanden geleden")]
[InlineData(1, "1 maand geleden")]
public void MonthsAgo(int months, string expected)
{
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past);
}

[Theory]
[InlineData(-2, "2 seconden geleden")]
[InlineData(-1, "1 seconde geleden")]
[InlineData(2, "2 seconden geleden")]
[InlineData(1, "1 seconde geleden")]
public void SecondsAgo(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past);
}

[Theory]
[InlineData(-2, "2 jaar geleden")]
[InlineData(-1, "1 jaar geleden")]
[InlineData(2, "2 jaar geleden")]
[InlineData(1, "1 jaar geleden")]
public void YearsAgo(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past);
}

[Theory]
[InlineData(2, "over 2 dagen")]
[InlineData(1, "morgen")]
public void DaysFromNow(int days, string expected)
{
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 uur")]
[InlineData(1, "over 1 uur")]
public void HoursFromNow(int hours, string expected)
{
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 minuten")]
[InlineData(1, "over 1 minuut")]
[InlineData(60, "over 1 uur")]
public void MinutesFromNow(int minutes, string expected)
{
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 maanden")]
[InlineData(1, "over 1 maand")]
public void MonthsFromNow(int months, string expected)
{
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 seconden")]
[InlineData(1, "over 1 seconde")]
public void SecondsFromNow(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 jaar")]
[InlineData(1, "over 1 jaar")]
public void YearsFromNow(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future);
}

[Theory]
[InlineData(0, "nu")]
public void RightNow(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future);
}
}
}
39 changes: 39 additions & 0 deletions src/Humanizer/Properties/Resources.nl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,43 @@
<data name="TimeSpanHumanize_Zero" xml:space="preserve">
<value>geen tijd</value>
</data>
<data name="DateHumanize_MultipleDaysFromNow">
<value>over {0} dagen</value>
</data>
<data name="DateHumanize_MultipleHoursFromNow">
<value>over {0} uur</value>
</data>
<data name="DateHumanize_MultipleMinutesFromNow">
<value>over {0} minuten</value>
</data>
<data name="DateHumanize_MultipleMonthsFromNow">
<value>over {0} maanden</value>
</data>
<data name="DateHumanize_MultipleSecondsFromNow">
<value>over {0} seconden</value>
</data>
<data name="DateHumanize_MultipleYearsFromNow">
<value>over {0} jaar</value>
</data>
<data name="DateHumanize_Now">
<value>nu</value>
</data>
<data name="DateHumanize_SingleDayFromNow">
<value>morgen</value>
</data>
<data name="DateHumanize_SingleHourFromNow">
<value>over 1 uur</value>
</data>
<data name="DateHumanize_SingleMinuteFromNow">
<value>over 1 minuut</value>
</data>
<data name="DateHumanize_SingleMonthFromNow">
<value>over 1 maand</value>
</data>
<data name="DateHumanize_SingleSecondFromNow">
<value>over 1 seconde</value>
</data>
<data name="DateHumanize_SingleYearFromNow">
<value>over 1 jaar</value>
</data>
</root>