From 13a4ec947e5a91f8e19c79ef9609d2e71a514bbe Mon Sep 17 00:00:00 2001 From: Igor Kulman Date: Fri, 4 Apr 2014 11:31:19 +0200 Subject: [PATCH 1/7] * tests for Czech --- .../Localisation/cs/DateHumanizeTests.cs | 168 ++++++++++++++++++ .../Localisation/cs/TimeSpanHumanizeTests.cs | 92 ++++++++++ 2 files changed, 260 insertions(+) create mode 100644 src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs create mode 100644 src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs diff --git a/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs b/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs new file mode 100644 index 000000000..14c723d78 --- /dev/null +++ b/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs @@ -0,0 +1,168 @@ +using System; +using Xunit; +using Xunit.Extensions; + +namespace Humanizer.Tests.Localisation.cs +{ + public class DateTimeHumanizeTests : AmbientCulture + { + public DateTimeHumanizeTests() + : base("cs-CZ") + { + } + + [Theory] + [InlineData(1, "o sekundu")] + [InlineData(2, "o 2 sekundy")] + [InlineData(3, "o 3 sekundy")] + [InlineData(4, "o 4 sekundy")] + [InlineData(5, "o 5 sekund")] + [InlineData(6, "o 6 sekund")] + [InlineData(10, "o 10 sekund")] + public void SecondsFromNow(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddSeconds(number).Humanize()); + } + + [Theory] + [InlineData(1, "o minutu")] + [InlineData(2, "o 2 minuty")] + [InlineData(3, "o 3 minuty")] + [InlineData(4, "o 4 minuty")] + [InlineData(5, "o 5 minut")] + [InlineData(6, "o 6 minut")] + [InlineData(10, "o 10 minut")] + public void MinutesFromNow(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddMinutes(number).Humanize()); + } + + [Theory] + [InlineData(1, "o hodinu")] + [InlineData(2, "o 2 hodiny")] + [InlineData(3, "o 3 hodiny")] + [InlineData(4, "o 4 hodiny")] + [InlineData(5, "o 5 hodin")] + [InlineData(6, "o 6 hodin")] + [InlineData(10, "o 10 hodin")] + public void HoursFromNow(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddHours(number).Humanize()); + } + + [Theory] + [InlineData(1, "zítra")] + [InlineData(2, "o 2 dny")] + [InlineData(3, "o 3 dny")] + [InlineData(4, "o 4 dny")] + [InlineData(9, "o 9 dnů")] + [InlineData(10, "o 10 dnů")] + public void DayFromNow(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddDays(number).Humanize()); + } + + [Theory] + [InlineData(1, "o měsíc")] + [InlineData(2, "o 2 měsíce")] + [InlineData(3, "o 3 měsíce")] + [InlineData(4, "o 4 měsíce")] + [InlineData(5, "o 5 měsíců")] + [InlineData(6, "o 6 měsíců")] + [InlineData(10, "o 10 měsíců")] + public void MonthsFromNow(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddMonths(number).Humanize()); + } + + [Theory] + [InlineData(1, "o rok")] + [InlineData(2, "o 2 roky")] + [InlineData(3, "o 3 roky")] + [InlineData(4, "o 4 roky")] + [InlineData(5, "o 5 roků")] + [InlineData(6, "o 6 roků")] + [InlineData(10, "o 10 roků")] + public void YearsFromNow(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddYears(number).Humanize()); + } + + [Theory] + [InlineData(1, "před sekundou")] + [InlineData(2, "před 2 sekundami")] + [InlineData(3, "před 3 sekundami")] + [InlineData(4, "před 4 sekundami")] + [InlineData(5, "před 5 sekundami")] + [InlineData(6, "před 6 sekundami")] + [InlineData(10, "před 10 sekundami")] + public void SecondsAgo(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddSeconds(-1 * number).Humanize()); + } + + [Theory] + [InlineData(1, "před minutou")] + [InlineData(2, "před 2 minutami")] + [InlineData(3, "před 3 minutami")] + [InlineData(4, "před 4 minutami")] + [InlineData(5, "před 5 minutami")] + [InlineData(6, "před 6 minutami")] + [InlineData(10, "před 10 minutami")] + public void MinutesAgo(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddMinutes(-1 * number).Humanize()); + } + + [Theory] + [InlineData(1, "před hodinou")] + [InlineData(2, "před 2 hodinami")] + [InlineData(3, "před 3 hodinami")] + [InlineData(4, "před 4 hodinami")] + [InlineData(5, "před 5 hodinami")] + [InlineData(6, "před 6 hodinami")] + [InlineData(10, "před 10 hodinami")] + public void HoursAgo(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddHours(-1 * number).Humanize()); + } + + [Theory] + [InlineData(1, "včera")] + [InlineData(2, "před 2 dny")] + [InlineData(3, "před 3 dny")] + [InlineData(4, "před 4 dny")] + [InlineData(9, "před 9 dny")] + [InlineData(10, "před 10 dny")] + public void DayAgo(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddDays(-1 * number).Humanize()); + } + + [Theory] + [InlineData(1, "před měsícem")] + [InlineData(2, "před 2 měsíci")] + [InlineData(3, "před 3 měsíci")] + [InlineData(4, "před 4 měsíci")] + [InlineData(5, "před 5 měsíci")] + [InlineData(6, "před 6 měsíci")] + [InlineData(10, "před 10 měsíci")] + public void MonthsAgo(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddMonths(-1 * number).Humanize()); + } + + [Theory] + [InlineData(1, "před rokem")] + [InlineData(2, "před 2 roky")] + [InlineData(3, "před 3 roky")] + [InlineData(4, "před 4 roky")] + [InlineData(5, "před 5 roky")] + [InlineData(6, "před 6 roky")] + [InlineData(10, "před 10 roky")] + public void YearsAgo(int number, string expected) + { + Assert.Equal(expected, DateTime.UtcNow.AddYears(-1 * number).Humanize()); + } + } +} diff --git a/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs new file mode 100644 index 000000000..979c88ba4 --- /dev/null +++ b/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs @@ -0,0 +1,92 @@ +using System; +using Xunit; +using Xunit.Extensions; + +namespace Humanizer.Tests.Localisation.cs +{ + public class TimeSpanHumanizeTests : AmbientCulture + { + public TimeSpanHumanizeTests() + : base("cs-CZ") + { + } + + [Theory] + [InlineData(1, "1 milisekunda")] + [InlineData(2, "2 milisekundy")] + [InlineData(3, "3 milisekundy")] + [InlineData(4, "4 milisekundy")] + [InlineData(5, "5 milisekund")] + [InlineData(6, "6 milisekund")] + [InlineData(10, "10 milisekund")] + public void Miliseconds(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromMilliseconds(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 sekunda")] + [InlineData(2, "2 sekundy")] + [InlineData(3, "3 sekundy")] + [InlineData(4, "4 sekundy")] + [InlineData(5, "5 sekund")] + [InlineData(6, "6 sekund")] + [InlineData(10, "10 sekund")] + public void Seconds(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromSeconds(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 minuta")] + [InlineData(2, "2 minuty")] + [InlineData(3, "3 minuty")] + [InlineData(4, "4 minuty")] + [InlineData(5, "5 minut")] + [InlineData(6, "6 minut")] + [InlineData(10, "10 minut")] + public void Minutes(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromMinutes(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 hodina")] + [InlineData(2, "2 hodiny")] + [InlineData(3, "3 hodiny")] + [InlineData(4, "4 hodiny")] + [InlineData(5, "5 hodin")] + [InlineData(6, "6 hodin")] + [InlineData(10, "10 hodin")] + public void Hours(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromHours(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 den")] + [InlineData(2, "2 dny")] + [InlineData(3, "3 dny")] + [InlineData(4, "4 dny")] + [InlineData(5, "5 dnů")] + [InlineData(6, "6 dnů")] + public void Days(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromDays(number).Humanize()); + } + + [Theory] + [InlineData(1, "1 týden")] + [InlineData(2, "2 týdny")] + [InlineData(3, "3 týdny")] + [InlineData(4, "4 týdny")] + [InlineData(5, "5 týdnů")] + [InlineData(6, "6 týdnů")] + public void Weeks(int number, string expected) + { + Assert.Equal(expected, TimeSpan.FromDays(number * 7).Humanize()); + } + + + } +} From 1111fa1f1a752424657af79f37358187be6a363b Mon Sep 17 00:00:00 2001 From: Igor Kulman Date: Fri, 4 Apr 2014 11:35:45 +0200 Subject: [PATCH 2/7] * Czech tests reviewed and fixed --- .../Localisation/cs/DateHumanizeTests.cs | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs b/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs index 14c723d78..c6e1799a8 100644 --- a/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs @@ -12,39 +12,39 @@ public DateTimeHumanizeTests() } [Theory] - [InlineData(1, "o sekundu")] - [InlineData(2, "o 2 sekundy")] - [InlineData(3, "o 3 sekundy")] - [InlineData(4, "o 4 sekundy")] - [InlineData(5, "o 5 sekund")] - [InlineData(6, "o 6 sekund")] - [InlineData(10, "o 10 sekund")] + [InlineData(1, "za sekundu")] + [InlineData(2, "za 2 sekundy")] + [InlineData(3, "za 3 sekundy")] + [InlineData(4, "za 4 sekundy")] + [InlineData(5, "za 5 sekund")] + [InlineData(6, "za 6 sekund")] + [InlineData(10, "za 10 sekund")] public void SecondsFromNow(int number, string expected) { Assert.Equal(expected, DateTime.UtcNow.AddSeconds(number).Humanize()); } [Theory] - [InlineData(1, "o minutu")] - [InlineData(2, "o 2 minuty")] - [InlineData(3, "o 3 minuty")] - [InlineData(4, "o 4 minuty")] - [InlineData(5, "o 5 minut")] - [InlineData(6, "o 6 minut")] - [InlineData(10, "o 10 minut")] + [InlineData(1, "za minutu")] + [InlineData(2, "za 2 minuty")] + [InlineData(3, "za 3 minuty")] + [InlineData(4, "za 4 minuty")] + [InlineData(5, "za 5 minut")] + [InlineData(6, "za 6 minut")] + [InlineData(10, "za 10 minut")] public void MinutesFromNow(int number, string expected) { Assert.Equal(expected, DateTime.UtcNow.AddMinutes(number).Humanize()); } [Theory] - [InlineData(1, "o hodinu")] - [InlineData(2, "o 2 hodiny")] - [InlineData(3, "o 3 hodiny")] - [InlineData(4, "o 4 hodiny")] - [InlineData(5, "o 5 hodin")] - [InlineData(6, "o 6 hodin")] - [InlineData(10, "o 10 hodin")] + [InlineData(1, "za hodinu")] + [InlineData(2, "za 2 hodiny")] + [InlineData(3, "za 3 hodiny")] + [InlineData(4, "za 4 hodiny")] + [InlineData(5, "za 5 hodin")] + [InlineData(6, "za 6 hodin")] + [InlineData(10, "za 10 hodin")] public void HoursFromNow(int number, string expected) { Assert.Equal(expected, DateTime.UtcNow.AddHours(number).Humanize()); @@ -52,37 +52,37 @@ public void HoursFromNow(int number, string expected) [Theory] [InlineData(1, "zítra")] - [InlineData(2, "o 2 dny")] - [InlineData(3, "o 3 dny")] - [InlineData(4, "o 4 dny")] - [InlineData(9, "o 9 dnů")] - [InlineData(10, "o 10 dnů")] + [InlineData(2, "za 2 dny")] + [InlineData(3, "za 3 dny")] + [InlineData(4, "za 4 dny")] + [InlineData(9, "za 9 dnů")] + [InlineData(10, "za 10 dnů")] public void DayFromNow(int number, string expected) { Assert.Equal(expected, DateTime.UtcNow.AddDays(number).Humanize()); } [Theory] - [InlineData(1, "o měsíc")] - [InlineData(2, "o 2 měsíce")] - [InlineData(3, "o 3 měsíce")] - [InlineData(4, "o 4 měsíce")] - [InlineData(5, "o 5 měsíců")] - [InlineData(6, "o 6 měsíců")] - [InlineData(10, "o 10 měsíců")] + [InlineData(1, "za měsíc")] + [InlineData(2, "za 2 měsíce")] + [InlineData(3, "za 3 měsíce")] + [InlineData(4, "za 4 měsíce")] + [InlineData(5, "za 5 měsíců")] + [InlineData(6, "za 6 měsíců")] + [InlineData(10, "za 10 měsíců")] public void MonthsFromNow(int number, string expected) { Assert.Equal(expected, DateTime.UtcNow.AddMonths(number).Humanize()); } [Theory] - [InlineData(1, "o rok")] - [InlineData(2, "o 2 roky")] - [InlineData(3, "o 3 roky")] - [InlineData(4, "o 4 roky")] - [InlineData(5, "o 5 roků")] - [InlineData(6, "o 6 roků")] - [InlineData(10, "o 10 roků")] + [InlineData(1, "za rok")] + [InlineData(2, "za 2 roky")] + [InlineData(3, "za 3 roky")] + [InlineData(4, "za 4 roky")] + [InlineData(5, "za 5 roků")] + [InlineData(6, "za 6 roků")] + [InlineData(10, "za 10 roků")] public void YearsFromNow(int number, string expected) { Assert.Equal(expected, DateTime.UtcNow.AddYears(number).Humanize()); @@ -154,12 +154,12 @@ public void MonthsAgo(int number, string expected) [Theory] [InlineData(1, "před rokem")] - [InlineData(2, "před 2 roky")] - [InlineData(3, "před 3 roky")] - [InlineData(4, "před 4 roky")] - [InlineData(5, "před 5 roky")] - [InlineData(6, "před 6 roky")] - [InlineData(10, "před 10 roky")] + [InlineData(2, "před 2 lety")] + [InlineData(3, "před 3 lety")] + [InlineData(4, "před 4 lety")] + [InlineData(5, "před 5 lety")] + [InlineData(6, "před 6 lety")] + [InlineData(10, "před 10 lety")] public void YearsAgo(int number, string expected) { Assert.Equal(expected, DateTime.UtcNow.AddYears(-1 * number).Humanize()); From 973cea0f483104fcbdb687da062ee6a61b821812 Mon Sep 17 00:00:00 2001 From: Igor Kulman Date: Fri, 4 Apr 2014 11:53:05 +0200 Subject: [PATCH 3/7] + Czech datetime and timespan localization with passing tests --- src/Humanizer.Tests/Humanizer.Tests.csproj | 2 + .../Localisation/cs/DateHumanizeTests.cs | 6 +- src/Humanizer/Configuration/Configurator.cs | 3 +- src/Humanizer/Humanizer.csproj | 4 + src/Humanizer/Localisation/CzechFormatter.cs | 15 + src/Humanizer/Properties/Resources.cs.resx | 288 ++++++++++++++++++ 6 files changed, 314 insertions(+), 4 deletions(-) create mode 100644 src/Humanizer/Localisation/CzechFormatter.cs create mode 100644 src/Humanizer/Properties/Resources.cs.resx diff --git a/src/Humanizer.Tests/Humanizer.Tests.csproj b/src/Humanizer.Tests/Humanizer.Tests.csproj index 8e51a3c18..526f32221 100644 --- a/src/Humanizer.Tests/Humanizer.Tests.csproj +++ b/src/Humanizer.Tests/Humanizer.Tests.csproj @@ -75,6 +75,8 @@ + + diff --git a/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs b/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs index c6e1799a8..12b97cc55 100644 --- a/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/cs/DateHumanizeTests.cs @@ -80,9 +80,9 @@ public void MonthsFromNow(int number, string expected) [InlineData(2, "za 2 roky")] [InlineData(3, "za 3 roky")] [InlineData(4, "za 4 roky")] - [InlineData(5, "za 5 roků")] - [InlineData(6, "za 6 roků")] - [InlineData(10, "za 10 roků")] + [InlineData(5, "za 5 let")] + [InlineData(6, "za 6 let")] + [InlineData(10, "za 10 let")] public void YearsFromNow(int number, string expected) { Assert.Equal(expected, DateTime.UtcNow.AddYears(number).Humanize()); diff --git a/src/Humanizer/Configuration/Configurator.cs b/src/Humanizer/Configuration/Configurator.cs index d6f5b670b..af48fa565 100644 --- a/src/Humanizer/Configuration/Configurator.cs +++ b/src/Humanizer/Configuration/Configurator.cs @@ -16,7 +16,8 @@ public static class Configurator { "ro", () => new RomanianFormatter() }, { "ru", () => new RussianFormatter() }, { "ar", () => new ArabicFormatter() }, - { "sk", () => new SlovakFormatter() } + { "sk", () => new SlovakFormatter() }, + { "cs", () => new CzechFormatter() } }; /// diff --git a/src/Humanizer/Humanizer.csproj b/src/Humanizer/Humanizer.csproj index 1a0a911f4..78027f62b 100644 --- a/src/Humanizer/Humanizer.csproj +++ b/src/Humanizer/Humanizer.csproj @@ -75,6 +75,7 @@ + @@ -150,6 +151,9 @@ + + Resources.cs.Designer.cs + diff --git a/src/Humanizer/Localisation/CzechFormatter.cs b/src/Humanizer/Localisation/CzechFormatter.cs new file mode 100644 index 000000000..9f000052f --- /dev/null +++ b/src/Humanizer/Localisation/CzechFormatter.cs @@ -0,0 +1,15 @@ +namespace Humanizer.Localisation +{ + internal class CzechFormatter : DefaultFormatter + { + private const string PaucalPostfix = "_Paucal"; + + protected override string GetResourceKey(string resourceKey, int number) + { + if (number > 1 && number < 5) + return resourceKey + PaucalPostfix; + + return resourceKey; + } + } +} \ No newline at end of file diff --git a/src/Humanizer/Properties/Resources.cs.resx b/src/Humanizer/Properties/Resources.cs.resx new file mode 100644 index 000000000..7d53f6432 --- /dev/null +++ b/src/Humanizer/Properties/Resources.cs.resx @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + před sekundou + + + před {0} sekundami + + + před minutou + + + před {0} minutami + + + před hodinou + + + před {0} hodinami + + + včera + + + před {0} dny + + + před měsícem + + + před {0} měsíci + + + před rokem + + + před {0} lety + + + {0} dnů + + + {0} hodin + + + {0} milisekund + + + {0} minut + + + {0} sekund + + + 1 den + + + 1 hodina + + + 1 milisekunda + + + 1 minuta + + + 1 sekunda + + + není čas + + + {0} týdnů + + + 1 týden + + + za {0} dnů + + + za {0} hodin + + + za {0} minut + + + za {0} měsíců + + + za {0} sekund + + + za {0} let + + + teď + + + zítra + + + za hodinu + + + za minutu + + + za měsíc + + + za sekundu + + + za rok + + + před {0} dny + + + za {0} dny + + + před {0} hodinami + + + za {0} hodiny + + + před {0} minutami + + + za {0} minuty + + + před {0} měsíci + + + za {0} měsíce + + + před {0} sekundami + + + za {0} sekundy + + + před {0} lety + + + za {0} roky + + + {0} dny + + + {0} hodiny + + + {0} milisekundy + + + {0} minuty + + + {0} sekundy + + + {0} týdny + + \ No newline at end of file From 0f1e5e739b93423adcf2179388d8f4969fab4825 Mon Sep 17 00:00:00 2001 From: Igor Kulman Date: Fri, 4 Apr 2014 18:51:00 +0200 Subject: [PATCH 4/7] * designer files removed --- src/Humanizer/Humanizer.csproj | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Humanizer/Humanizer.csproj b/src/Humanizer/Humanizer.csproj index 78027f62b..ffcd1e7b0 100644 --- a/src/Humanizer/Humanizer.csproj +++ b/src/Humanizer/Humanizer.csproj @@ -151,9 +151,7 @@ - - Resources.cs.Designer.cs - + @@ -162,17 +160,13 @@ - - Designer - + - - Resources.sk.Designer.cs - + From 52f8d31470c110cf3707a82a6f5d555d8ac3a16d Mon Sep 17 00:00:00 2001 From: Igor Kulman Date: Fri, 4 Apr 2014 21:17:43 +0200 Subject: [PATCH 5/7] * Slovak and Czech formatters merged --- src/Humanizer/Configuration/Configurator.cs | 4 ++-- src/Humanizer/Humanizer.csproj | 3 +-- src/Humanizer/Localisation/CzechFormatter.cs | 15 --------------- ...SlovakFormatter.cs => CzechSlovakFormatter.cs} | 2 +- 4 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 src/Humanizer/Localisation/CzechFormatter.cs rename src/Humanizer/Localisation/{SlovakFormatter.cs => CzechSlovakFormatter.cs} (85%) diff --git a/src/Humanizer/Configuration/Configurator.cs b/src/Humanizer/Configuration/Configurator.cs index af48fa565..2eae49b54 100644 --- a/src/Humanizer/Configuration/Configurator.cs +++ b/src/Humanizer/Configuration/Configurator.cs @@ -16,8 +16,8 @@ public static class Configurator { "ro", () => new RomanianFormatter() }, { "ru", () => new RussianFormatter() }, { "ar", () => new ArabicFormatter() }, - { "sk", () => new SlovakFormatter() }, - { "cs", () => new CzechFormatter() } + { "sk", () => new CzechSlovakFormatter() }, + { "cs", () => new CzechSlovakFormatter() } }; /// diff --git a/src/Humanizer/Humanizer.csproj b/src/Humanizer/Humanizer.csproj index f915e39b9..82a3cd3b0 100644 --- a/src/Humanizer/Humanizer.csproj +++ b/src/Humanizer/Humanizer.csproj @@ -70,8 +70,7 @@ - - + diff --git a/src/Humanizer/Localisation/CzechFormatter.cs b/src/Humanizer/Localisation/CzechFormatter.cs deleted file mode 100644 index 9f000052f..000000000 --- a/src/Humanizer/Localisation/CzechFormatter.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Humanizer.Localisation -{ - internal class CzechFormatter : DefaultFormatter - { - private const string PaucalPostfix = "_Paucal"; - - protected override string GetResourceKey(string resourceKey, int number) - { - if (number > 1 && number < 5) - return resourceKey + PaucalPostfix; - - return resourceKey; - } - } -} \ No newline at end of file diff --git a/src/Humanizer/Localisation/SlovakFormatter.cs b/src/Humanizer/Localisation/CzechSlovakFormatter.cs similarity index 85% rename from src/Humanizer/Localisation/SlovakFormatter.cs rename to src/Humanizer/Localisation/CzechSlovakFormatter.cs index 8b2419bbb..4e5471312 100644 --- a/src/Humanizer/Localisation/SlovakFormatter.cs +++ b/src/Humanizer/Localisation/CzechSlovakFormatter.cs @@ -1,6 +1,6 @@ namespace Humanizer.Localisation { - internal class SlovakFormatter : DefaultFormatter + internal class CzechSlovakFormatter : DefaultFormatter { private const string PaucalPostfix = "_Paucal"; From d81d7dd8aa87c7e444f206d23cba71613d6dc571 Mon Sep 17 00:00:00 2001 From: Igor Kulman Date: Fri, 4 Apr 2014 21:18:54 +0200 Subject: [PATCH 6/7] * typos fixed --- src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs | 2 +- src/Humanizer.Tests/Localisation/sk/TimeSpanHumanizeTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs index 979c88ba4..84572e516 100644 --- a/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs @@ -19,7 +19,7 @@ public TimeSpanHumanizeTests() [InlineData(5, "5 milisekund")] [InlineData(6, "6 milisekund")] [InlineData(10, "10 milisekund")] - public void Miliseconds(int number, string expected) + public void Milliseconds(int number, string expected) { Assert.Equal(expected, TimeSpan.FromMilliseconds(number).Humanize()); } diff --git a/src/Humanizer.Tests/Localisation/sk/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests/Localisation/sk/TimeSpanHumanizeTests.cs index 4789958fe..9ab57d594 100644 --- a/src/Humanizer.Tests/Localisation/sk/TimeSpanHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/sk/TimeSpanHumanizeTests.cs @@ -19,7 +19,7 @@ public TimeSpanHumanizeTests() [InlineData(5, "5 milisekúnd")] [InlineData(6, "6 milisekúnd")] [InlineData(10, "10 milisekúnd")] - public void Miliseconds(int number, string expected) + public void Milliseconds(int number, string expected) { Assert.Equal(expected, TimeSpan.FromMilliseconds(number).Humanize()); } From b96d2f3709f75af2910fd23d0aed072002deb3f8 Mon Sep 17 00:00:00 2001 From: Igor Kulman Date: Fri, 4 Apr 2014 21:21:00 +0200 Subject: [PATCH 7/7] * redundant spaces removed --- src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs index 84572e516..0ec245c3d 100644 --- a/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs +++ b/src/Humanizer.Tests/Localisation/cs/TimeSpanHumanizeTests.cs @@ -84,7 +84,7 @@ public void Days(int number, string expected) [InlineData(6, "6 týdnů")] public void Weeks(int number, string expected) { - Assert.Equal(expected, TimeSpan.FromDays(number * 7).Humanize()); + Assert.Equal(expected, TimeSpan.FromDays(number*7).Humanize()); }