From bfa8a360d9e2759e385182bbecf09a3d07cb832d Mon Sep 17 00:00:00 2001 From: ekblom Date: Wed, 9 Apr 2014 10:36:14 +0200 Subject: [PATCH 1/5] Swedish translation --- src/Humanizer/Properties/Resources.sv.resx | 234 +++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 src/Humanizer/Properties/Resources.sv.resx diff --git a/src/Humanizer/Properties/Resources.sv.resx b/src/Humanizer/Properties/Resources.sv.resx new file mode 100644 index 000000000..40bdc7250 --- /dev/null +++ b/src/Humanizer/Properties/Resources.sv.resx @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + för en sekund sedan + + + {0} sekunder sedan + + + en minut sedan + + + för {0} minuter sedan + + + en timme sedan + + + {0} timmar sedan + + + igår + + + {0} dagar sedan + + + för en månad sedan + + + {0} månader sedan + + + ett år sedan + + + {0} år sedan + + + {0} dagar + + + {0} timmar + + + {0} millisekunder + + + {0} minuter + + + {0} sekunder + + + 1 dag + + + 1 timma + + + 1 millisekund + + + 1 minut + + + 1 sekund + + + ingen tid + + + {0} veckor + + + 1 vecka + + + om {0} dagar + + + om {0} timmar + + + om {0} minuter + + + om {0} månader + + + om {0} sekunder + + + om {0} år + + + nu + + + i morgon + + + om en timme + + + om en minut + + + om en månad + + + om en sekund + + + om ett år + + \ No newline at end of file From ff6f181b948c370ca4892282f62c915059266192 Mon Sep 17 00:00:00 2001 From: ekblom Date: Wed, 9 Apr 2014 11:27:52 +0200 Subject: [PATCH 2/5] Tests for swedish localization --- src/Humanizer.Tests/Humanizer.Tests.csproj | 2 + .../Localisation/sv/DateHumanizeTests.cs | 167 ++++++++++++++++++ .../Localisation/sv/TimeSpanHumanizeTests.cs | 90 ++++++++++ src/Humanizer/Humanizer.csproj | 1 + src/Humanizer/Properties/Resources.sv.resx | 14 +- 5 files changed, 267 insertions(+), 7 deletions(-) create mode 100644 src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs create mode 100644 src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs diff --git a/src/Humanizer.Tests/Humanizer.Tests.csproj b/src/Humanizer.Tests/Humanizer.Tests.csproj index 444ac46d6..05addc363 100644 --- a/src/Humanizer.Tests/Humanizer.Tests.csproj +++ b/src/Humanizer.Tests/Humanizer.Tests.csproj @@ -95,6 +95,8 @@ + + diff --git a/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs b/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs new file mode 100644 index 000000000..f79f54987 --- /dev/null +++ b/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs @@ -0,0 +1,167 @@ +using Humanizer.Localisation; +using Xunit.Extensions; + +namespace Humanizer.Tests.Localisation.sv +{ + public class DateHumanizeTests : AmbientCulture + { + public DateHumanizeTests() + : base("sv-SE") + { + } + + [Theory] + [InlineData(1, "om en sekund")] + [InlineData(2, "om 2 sekunder")] + [InlineData(3, "om 3 sekunder")] + [InlineData(4, "om 4 sekunder")] + [InlineData(5, "om 5 sekunder")] + [InlineData(6, "om 6 sekunder")] + [InlineData(10, "om 10 sekunder")] + public void SecondsFromNow(int seconds, string expected) + { + DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future); + } + + [Theory] + [InlineData(1, "om en minut")] + [InlineData(2, "om 2 minuter")] + [InlineData(3, "om 3 minuter")] + [InlineData(4, "om 4 minuter")] + [InlineData(5, "om 5 minuter")] + [InlineData(6, "om 6 minuter")] + [InlineData(10, "om 10 minuter")] + public void MinutesFromNow(int minutes, string expected) + { + DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future); + } + + [Theory] + [InlineData(1, "om en timme")] + [InlineData(2, "om 2 timmar")] + [InlineData(3, "om 3 timmar")] + [InlineData(4, "om 4 timmar")] + [InlineData(5, "om 5 timmar")] + [InlineData(6, "om 6 timmar")] + [InlineData(10, "om 10 timmar")] + public void HoursFromNow(int hours, string expected) + { + DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future); + } + + [Theory] + [InlineData(1, "i morgon")] + [InlineData(2, "om 2 dagar")] + [InlineData(3, "om 3 dagar")] + [InlineData(4, "om 4 dagar")] + [InlineData(9, "om 9 dagar")] + [InlineData(10, "om 10 dagar")] + public void DayFromNow(int days, string expected) + { + DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future); + } + + [Theory] + [InlineData(1, "om en månad")] + [InlineData(2, "om 2 månader")] + [InlineData(3, "om 3 månader")] + [InlineData(4, "om 4 månader")] + [InlineData(5, "om 5 månader")] + [InlineData(6, "om 6 månader")] + [InlineData(10, "om 10 månader")] + public void MonthsFromNow(int months, string expected) + { + DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future); + } + + [Theory] + [InlineData(1, "om ett år")] + [InlineData(2, "om 2 år")] + [InlineData(3, "om 3 år")] + [InlineData(4, "om 4 år")] + [InlineData(5, "om 5 år")] + [InlineData(6, "om 6 år")] + [InlineData(10, "om 10 år")] + public void YearsFromNow(int years, string expected) + { + DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future); + } + + [Theory] + [InlineData(1, "en sekund sedan")] + [InlineData(2, "för 2 sekunder sedan")] + [InlineData(3, "för 3 sekunder sedan")] + [InlineData(4, "för 4 sekunder sedan")] + [InlineData(5, "för 5 sekunder sedan")] + [InlineData(6, "för 6 sekunder sedan")] + [InlineData(10, "för 10 sekunder sedan")] + public void SecondsAgo(int seconds, string expected) + { + DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past); + } + + [Theory] + [InlineData(1, "en minut sedan")] + [InlineData(2, "för 2 minuter sedan")] + [InlineData(3, "för 3 minuter sedan")] + [InlineData(4, "för 4 minuter sedan")] + [InlineData(5, "för 5 minuter sedan")] + [InlineData(6, "för 6 minuter sedan")] + [InlineData(10, "för 10 minuter sedan")] + public void MinutesAgo(int minutes, string expected) + { + DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past); + } + + [Theory] + [InlineData(1, "en timme sedan")] + [InlineData(2, "för 2 timmar sedan")] + [InlineData(3, "för 3 timmar sedan")] + [InlineData(4, "för 4 timmar sedan")] + [InlineData(5, "för 5 timmar sedan")] + [InlineData(6, "för 6 timmar sedan")] + [InlineData(10, "för 10 timmar sedan")] + public void HoursAgo(int hours, string expected) + { + DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past); + } + + [Theory] + [InlineData(1, "igår")] + [InlineData(2, "för 2 dagar sedan")] + [InlineData(3, "för 3 dagar sedan")] + [InlineData(4, "för 4 dagar sedan")] + [InlineData(9, "för 9 dagar sedan")] + [InlineData(10, "för 10 dagar sedan")] + public void DayAgo(int days, string expected) + { + DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past); + } + + [Theory] + [InlineData(1, "en månad sedan")] + [InlineData(2, "för 2 månader sedan")] + [InlineData(3, "för 3 månader sedan")] + [InlineData(4, "för 4 månader sedan")] + [InlineData(5, "för 5 månader sedan")] + [InlineData(6, "för 6 månader sedan")] + [InlineData(10, "för 10 månader sedan")] + public void MonthsAgo(int months, string expected) + { + DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past); + } + + [Theory] + [InlineData(1, "ett år sedan")] + [InlineData(2, "för 2 år sedan")] + [InlineData(3, "för 3 år sedan")] + [InlineData(4, "för 4 år sedan")] + [InlineData(5, "för 5 år sedan")] + [InlineData(6, "för 6 år sedan")] + [InlineData(10, "för 10 år sedan")] + public void YearsAgo(int years, string expected) + { + DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past); + } + } +} diff --git a/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs new file mode 100644 index 000000000..98dda413c --- /dev/null +++ b/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs @@ -0,0 +1,90 @@ +using System; +using Xunit; +using Xunit.Extensions; + +namespace Humanizer.Tests.Localisation.sv +{ + public class TimeSpanHumanizeTests : AmbientCulture + { + public TimeSpanHumanizeTests() + : base("sv-SE") + { + } + + [Theory] + [InlineData(1, "1 millisekund")] + [InlineData(2, "2 millisekunder")] + [InlineData(3, "3 millisekunder")] + [InlineData(4, "4 millisekunder")] + [InlineData(5, "5 millisekunder")] + [InlineData(6, "6 millisekunder")] + [InlineData(10, "10 millisekunder")] + public void Milliseconds(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromMilliseconds(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 sekund")] + [InlineData(2, "2 sekunder")] + [InlineData(3, "3 sekunder")] + [InlineData(4, "4 sekunder")] + [InlineData(5, "5 sekunder")] + [InlineData(6, "6 sekunder")] + [InlineData(10, "10 sekunder")] + public void Seconds(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromSeconds(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 minut")] + [InlineData(2, "2 minuter")] + [InlineData(3, "3 minuter")] + [InlineData(4, "4 minuter")] + [InlineData(5, "5 minuter")] + [InlineData(6, "6 minuter")] + [InlineData(10, "10 minuter")] + public void Minutes(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromMinutes(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 timma")] + [InlineData(2, "2 timmar")] + [InlineData(3, "3 timmar")] + [InlineData(4, "4 timmar")] + [InlineData(5, "5 timmar")] + [InlineData(6, "6 timmar")] + [InlineData(10, "10 timmar")] + public void Hours(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromHours(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 dag")] + [InlineData(2, "2 dagar")] + [InlineData(3, "3 dagar")] + [InlineData(4, "4 dagar")] + [InlineData(5, "5 dagar")] + [InlineData(6, "6 dagar")] + public void Days(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromDays(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 vecka")] + [InlineData(2, "2 veckor")] + [InlineData(3, "3 veckor")] + [InlineData(4, "4 veckor")] + [InlineData(5, "5 veckor")] + [InlineData(6, "6 veckor")] + public void Weeks(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromDays(number*7).Humanize()); + } + } +} diff --git a/src/Humanizer/Humanizer.csproj b/src/Humanizer/Humanizer.csproj index d9f49bf8b..eeebc22c6 100644 --- a/src/Humanizer/Humanizer.csproj +++ b/src/Humanizer/Humanizer.csproj @@ -164,6 +164,7 @@ + diff --git a/src/Humanizer/Properties/Resources.sv.resx b/src/Humanizer/Properties/Resources.sv.resx index 40bdc7250..5a1fa791c 100644 --- a/src/Humanizer/Properties/Resources.sv.resx +++ b/src/Humanizer/Properties/Resources.sv.resx @@ -118,10 +118,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - för en sekund sedan + en sekund sedan - {0} sekunder sedan + för {0} sekunder sedan en minut sedan @@ -133,25 +133,25 @@ en timme sedan - {0} timmar sedan + för {0} timmar sedan igår - {0} dagar sedan + för {0} dagar sedan - för en månad sedan + en månad sedan - {0} månader sedan + för {0} månader sedan ett år sedan - {0} år sedan + för {0} år sedan {0} dagar From e175a7f089ad24012957b636201a1299805e53f1 Mon Sep 17 00:00:00 2001 From: ekblom Date: Wed, 9 Apr 2014 11:41:41 +0200 Subject: [PATCH 3/5] Clean up for uneccesary tests --- .../Localisation/sv/DateHumanizeTests.cs | 58 ------------------- .../Localisation/sv/TimeSpanHumanizeTests.cs | 28 --------- 2 files changed, 86 deletions(-) diff --git a/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs b/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs index f79f54987..743b56708 100644 --- a/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs @@ -13,11 +13,6 @@ public DateHumanizeTests() [Theory] [InlineData(1, "om en sekund")] [InlineData(2, "om 2 sekunder")] - [InlineData(3, "om 3 sekunder")] - [InlineData(4, "om 4 sekunder")] - [InlineData(5, "om 5 sekunder")] - [InlineData(6, "om 6 sekunder")] - [InlineData(10, "om 10 sekunder")] public void SecondsFromNow(int seconds, string expected) { DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future); @@ -26,11 +21,6 @@ public void SecondsFromNow(int seconds, string expected) [Theory] [InlineData(1, "om en minut")] [InlineData(2, "om 2 minuter")] - [InlineData(3, "om 3 minuter")] - [InlineData(4, "om 4 minuter")] - [InlineData(5, "om 5 minuter")] - [InlineData(6, "om 6 minuter")] - [InlineData(10, "om 10 minuter")] public void MinutesFromNow(int minutes, string expected) { DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future); @@ -39,11 +29,6 @@ public void MinutesFromNow(int minutes, string expected) [Theory] [InlineData(1, "om en timme")] [InlineData(2, "om 2 timmar")] - [InlineData(3, "om 3 timmar")] - [InlineData(4, "om 4 timmar")] - [InlineData(5, "om 5 timmar")] - [InlineData(6, "om 6 timmar")] - [InlineData(10, "om 10 timmar")] public void HoursFromNow(int hours, string expected) { DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future); @@ -52,10 +37,6 @@ public void HoursFromNow(int hours, string expected) [Theory] [InlineData(1, "i morgon")] [InlineData(2, "om 2 dagar")] - [InlineData(3, "om 3 dagar")] - [InlineData(4, "om 4 dagar")] - [InlineData(9, "om 9 dagar")] - [InlineData(10, "om 10 dagar")] public void DayFromNow(int days, string expected) { DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future); @@ -64,11 +45,6 @@ public void DayFromNow(int days, string expected) [Theory] [InlineData(1, "om en månad")] [InlineData(2, "om 2 månader")] - [InlineData(3, "om 3 månader")] - [InlineData(4, "om 4 månader")] - [InlineData(5, "om 5 månader")] - [InlineData(6, "om 6 månader")] - [InlineData(10, "om 10 månader")] public void MonthsFromNow(int months, string expected) { DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future); @@ -77,11 +53,6 @@ public void MonthsFromNow(int months, string expected) [Theory] [InlineData(1, "om ett år")] [InlineData(2, "om 2 år")] - [InlineData(3, "om 3 år")] - [InlineData(4, "om 4 år")] - [InlineData(5, "om 5 år")] - [InlineData(6, "om 6 år")] - [InlineData(10, "om 10 år")] public void YearsFromNow(int years, string expected) { DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future); @@ -90,11 +61,6 @@ public void YearsFromNow(int years, string expected) [Theory] [InlineData(1, "en sekund sedan")] [InlineData(2, "för 2 sekunder sedan")] - [InlineData(3, "för 3 sekunder sedan")] - [InlineData(4, "för 4 sekunder sedan")] - [InlineData(5, "för 5 sekunder sedan")] - [InlineData(6, "för 6 sekunder sedan")] - [InlineData(10, "för 10 sekunder sedan")] public void SecondsAgo(int seconds, string expected) { DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past); @@ -103,11 +69,6 @@ public void SecondsAgo(int seconds, string expected) [Theory] [InlineData(1, "en minut sedan")] [InlineData(2, "för 2 minuter sedan")] - [InlineData(3, "för 3 minuter sedan")] - [InlineData(4, "för 4 minuter sedan")] - [InlineData(5, "för 5 minuter sedan")] - [InlineData(6, "för 6 minuter sedan")] - [InlineData(10, "för 10 minuter sedan")] public void MinutesAgo(int minutes, string expected) { DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past); @@ -116,11 +77,6 @@ public void MinutesAgo(int minutes, string expected) [Theory] [InlineData(1, "en timme sedan")] [InlineData(2, "för 2 timmar sedan")] - [InlineData(3, "för 3 timmar sedan")] - [InlineData(4, "för 4 timmar sedan")] - [InlineData(5, "för 5 timmar sedan")] - [InlineData(6, "för 6 timmar sedan")] - [InlineData(10, "för 10 timmar sedan")] public void HoursAgo(int hours, string expected) { DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past); @@ -129,10 +85,6 @@ public void HoursAgo(int hours, string expected) [Theory] [InlineData(1, "igår")] [InlineData(2, "för 2 dagar sedan")] - [InlineData(3, "för 3 dagar sedan")] - [InlineData(4, "för 4 dagar sedan")] - [InlineData(9, "för 9 dagar sedan")] - [InlineData(10, "för 10 dagar sedan")] public void DayAgo(int days, string expected) { DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past); @@ -141,11 +93,6 @@ public void DayAgo(int days, string expected) [Theory] [InlineData(1, "en månad sedan")] [InlineData(2, "för 2 månader sedan")] - [InlineData(3, "för 3 månader sedan")] - [InlineData(4, "för 4 månader sedan")] - [InlineData(5, "för 5 månader sedan")] - [InlineData(6, "för 6 månader sedan")] - [InlineData(10, "för 10 månader sedan")] public void MonthsAgo(int months, string expected) { DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past); @@ -154,11 +101,6 @@ public void MonthsAgo(int months, string expected) [Theory] [InlineData(1, "ett år sedan")] [InlineData(2, "för 2 år sedan")] - [InlineData(3, "för 3 år sedan")] - [InlineData(4, "för 4 år sedan")] - [InlineData(5, "för 5 år sedan")] - [InlineData(6, "för 6 år sedan")] - [InlineData(10, "för 10 år sedan")] public void YearsAgo(int years, string expected) { DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past); diff --git a/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs index 98dda413c..21067ec36 100644 --- a/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs @@ -14,11 +14,6 @@ public TimeSpanHumanizeTests() [Theory] [InlineData(1, "1 millisekund")] [InlineData(2, "2 millisekunder")] - [InlineData(3, "3 millisekunder")] - [InlineData(4, "4 millisekunder")] - [InlineData(5, "5 millisekunder")] - [InlineData(6, "6 millisekunder")] - [InlineData(10, "10 millisekunder")] public void Milliseconds(int number, string expected) { Assert.Equal(expected, TimeSpan.FromMilliseconds(number).Humanize()); @@ -27,11 +22,6 @@ public void Milliseconds(int number, string expected) [Theory] [InlineData(1, "1 sekund")] [InlineData(2, "2 sekunder")] - [InlineData(3, "3 sekunder")] - [InlineData(4, "4 sekunder")] - [InlineData(5, "5 sekunder")] - [InlineData(6, "6 sekunder")] - [InlineData(10, "10 sekunder")] public void Seconds(int number, string expected) { Assert.Equal(expected, TimeSpan.FromSeconds(number).Humanize()); @@ -40,11 +30,6 @@ public void Seconds(int number, string expected) [Theory] [InlineData(1, "1 minut")] [InlineData(2, "2 minuter")] - [InlineData(3, "3 minuter")] - [InlineData(4, "4 minuter")] - [InlineData(5, "5 minuter")] - [InlineData(6, "6 minuter")] - [InlineData(10, "10 minuter")] public void Minutes(int number, string expected) { Assert.Equal(expected, TimeSpan.FromMinutes(number).Humanize()); @@ -53,11 +38,6 @@ public void Minutes(int number, string expected) [Theory] [InlineData(1, "1 timma")] [InlineData(2, "2 timmar")] - [InlineData(3, "3 timmar")] - [InlineData(4, "4 timmar")] - [InlineData(5, "5 timmar")] - [InlineData(6, "6 timmar")] - [InlineData(10, "10 timmar")] public void Hours(int number, string expected) { Assert.Equal(expected, TimeSpan.FromHours(number).Humanize()); @@ -66,10 +46,6 @@ public void Hours(int number, string expected) [Theory] [InlineData(1, "1 dag")] [InlineData(2, "2 dagar")] - [InlineData(3, "3 dagar")] - [InlineData(4, "4 dagar")] - [InlineData(5, "5 dagar")] - [InlineData(6, "6 dagar")] public void Days(int number, string expected) { Assert.Equal(expected, TimeSpan.FromDays(number).Humanize()); @@ -78,10 +54,6 @@ public void Days(int number, string expected) [Theory] [InlineData(1, "1 vecka")] [InlineData(2, "2 veckor")] - [InlineData(3, "3 veckor")] - [InlineData(4, "4 veckor")] - [InlineData(5, "5 veckor")] - [InlineData(6, "6 veckor")] public void Weeks(int number, string expected) { Assert.Equal(expected, TimeSpan.FromDays(number*7).Humanize()); From f804b4278c4228bdef37d359df030391073f1561 Mon Sep 17 00:00:00 2001 From: ekblom Date: Wed, 9 Apr 2014 11:54:11 +0200 Subject: [PATCH 4/5] Added pull request in release notes --- release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release_notes.md b/release_notes.md index 3bc2f4b6d..dc7bc35e6 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,7 @@ ###In Development +- [#135](https://github.com/MehdiK/Humanizer/pull/135): Swedish localization (strings, tests) + [Commits](https://github.com/MehdiK/Humanizer/compare/v1.17.1...master) ###v1.17.1 - 2014-04-06 From 6914efdae8269a580905ca2779f426199ae0ef6a Mon Sep 17 00:00:00 2001 From: MehdiK Date: Wed, 9 Apr 2014 15:00:28 +0430 Subject: [PATCH 5/5] minor cleanup --- .../Localisation/sv/DateHumanizeTests.cs | 12 ++++++------ .../Localisation/sv/TimeSpanHumanizeTests.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs b/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs index 743b56708..19215ab04 100644 --- a/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/sv/DateHumanizeTests.cs @@ -20,7 +20,7 @@ public void SecondsFromNow(int seconds, string expected) [Theory] [InlineData(1, "om en minut")] - [InlineData(2, "om 2 minuter")] + [InlineData(2, "om 2 minuter")] public void MinutesFromNow(int minutes, string expected) { DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future); @@ -68,7 +68,7 @@ public void SecondsAgo(int seconds, string expected) [Theory] [InlineData(1, "en minut sedan")] - [InlineData(2, "för 2 minuter sedan")] + [InlineData(2, "för 2 minuter sedan")] public void MinutesAgo(int minutes, string expected) { DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past); @@ -76,7 +76,7 @@ public void MinutesAgo(int minutes, string expected) [Theory] [InlineData(1, "en timme sedan")] - [InlineData(2, "för 2 timmar sedan")] + [InlineData(2, "för 2 timmar sedan")] public void HoursAgo(int hours, string expected) { DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past); @@ -84,7 +84,7 @@ public void HoursAgo(int hours, string expected) [Theory] [InlineData(1, "igår")] - [InlineData(2, "för 2 dagar sedan")] + [InlineData(2, "för 2 dagar sedan")] public void DayAgo(int days, string expected) { DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past); @@ -92,7 +92,7 @@ public void DayAgo(int days, string expected) [Theory] [InlineData(1, "en månad sedan")] - [InlineData(2, "för 2 månader sedan")] + [InlineData(2, "för 2 månader sedan")] public void MonthsAgo(int months, string expected) { DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past); @@ -100,7 +100,7 @@ public void MonthsAgo(int months, string expected) [Theory] [InlineData(1, "ett år sedan")] - [InlineData(2, "för 2 år sedan")] + [InlineData(2, "för 2 år sedan")] public void YearsAgo(int years, string expected) { DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past); diff --git a/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs index 21067ec36..841efd21b 100644 --- a/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/sv/TimeSpanHumanizeTests.cs @@ -56,7 +56,7 @@ public void Days(int number, string expected) [InlineData(2, "2 veckor")] public void Weeks(int number, string expected) { - Assert.Equal(expected, TimeSpan.FromDays(number*7).Humanize()); + Assert.Equal(expected, TimeSpan.FromDays(number * 7).Humanize()); } } }