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

Serbian localization #239

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1aa419b
Added Serbian localization for Date and TimeSpan
clearpath Apr 17, 2014
af1d494
Fixed the "twenties" in SpanishNumberToWordsConverter
kblok Apr 17, 2014
2a43622
Updated release_notes
kblok Apr 17, 2014
2921b4c
Disable CS1591 for ByteSize class
adamchester Apr 18, 2014
f773214
Documented IDateTimeHumanizeStrategy
adamchester Apr 18, 2014
0e98bd5
Disable CS1591 for TimeUnit,
adamchester Apr 18, 2014
d6abb89
Documented EnumDehumanizeExtensions
adamchester Apr 18, 2014
f5277fc
Documented StringDehumanizeExtensions
adamchester Apr 18, 2014
8989ea2
Documented StringHumanizeExtensions
adamchester Apr 18, 2014
3cd0ac5
minor cleanup
MehdiK Apr 18, 2014
e98621d
Japanese Translate
yhata Apr 15, 2014
e7939b7
Changed NoTime to "0 seconds".
yhata Apr 16, 2014
205f610
Changed tests of TimeSpan to use Theory instead.
yhata Apr 16, 2014
60bbbf3
shorten Minutes, Seconds and Milliseconds.
yhata Apr 16, 2014
11e60c5
add PR to release note
yhata Apr 16, 2014
1e97359
Update release_notes.md
yhata Apr 16, 2014
d390299
Fix the short forms for multiple units.
yhata Apr 18, 2014
2410e89
Update Resources.ar.resx
kikoanis Apr 18, 2014
54ca41f
Added more tests for new Arabic resource settings
kikoanis Apr 18, 2014
0787bc2
Updated release notes to include PR 231
kikoanis Apr 18, 2014
b2cf43c
added the missing xml comments to code & enabled 1591
MehdiK Apr 18, 2014
24e221d
loosening up debug build restrictions
MehdiK Apr 19, 2014
4b6b288
Fix some rare cases of Russian ordinals
hazzik Apr 17, 2014
92821a8
Updated Spanish ordinals to account for gender. Slight modification t…
thunsaker Apr 16, 2014
a51dcd0
Updated release notes.
thunsaker Apr 16, 2014
034e071
Updated Ordinalize format
thunsaker Apr 17, 2014
67c19d6
Added #220 to release-notes!!!
MehdiK Apr 19, 2014
a3a57cc
releasing v1.23.1
MehdiK Apr 19, 2014
4cd1f28
Adding code & tests to handle Arabic numbers to ordinal words
kikoanis Apr 19, 2014
4e05637
Update release_notes.md
kikoanis Apr 19, 2014
d29b7b0
Adding missing setting for DateHumanize_Now (Arabic)
kikoanis Apr 19, 2014
97a5541
Changing Aggregate code to String.Join
kikoanis Apr 19, 2014
e8b2b27
minor tidy up
MehdiK Apr 19, 2014
e937e27
Fixed "1 million" number to words in Spanish
kblok Apr 19, 2014
0548761
Updated release_notes
kblok Apr 19, 2014
f25a2f4
New command-line build and verify,
adamchester Apr 19, 2014
a5d480b
fix casing of build.config file
adamchester Apr 20, 2014
cda52c1
tests project: nowarn:CS1591 +warnAsError
adamchester Apr 20, 2014
7ec9e05
make build.cmd 'autonomous' (not reliant on the %PATH% to msbuild)
adamchester Apr 20, 2014
6e2ef13
reverse the solution file format changes
adamchester Apr 20, 2014
fc88e77
added build.cmd to release notes and readme
MehdiK Apr 20, 2014
22fae32
added logo & attribution to readme
MehdiK Apr 20, 2014
db36f61
added iconUrl to nuspec
MehdiK Apr 20, 2014
5c9fb89
put the verify config back to fix the build.cmd
MehdiK Apr 21, 2014
32d8f13
replaced the logo with the transparent one
MehdiK Apr 21, 2014
a3c5c3e
releasing v1.24.1
MehdiK Apr 21, 2014
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ obj/
src/packages/*
PackageBuild/*
Build/*
Release/*
src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.received.txt
*.tss
src/TestResults/*
Expand Down
1 change: 1 addition & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@%WINDIR%\Microsoft.Net\Framework\v4.0.30319\msbuild build.proj /m /clp:Verbosity=minimal
23 changes: 23 additions & 0 deletions build.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<XUnitPath>tools\xunit</XUnitPath>
</PropertyGroup>
<PropertyGroup>
<ReleaseFolder>Release</ReleaseFolder>
</PropertyGroup>
<ItemGroup>
<BuildOutput Include="Src\Humanizer\bin\Release\Humanizer.dll" />
<BuildOutput Include="Src\Humanizer\bin\Release\Humanizer.XML" />
</ItemGroup>
<ItemGroup>
<ProjectToBuild Include="Src\*.sln" />
</ItemGroup>
<!-- Expand build output files AFTER the build has run.
Note that the Build Task MUST BE defined by the file that includes this file. -->
<Target Name="GetTestAssemblies" DependsOnTargets="Build">
<ItemGroup>
<TestAssemblies Include="**\bin\Release\*.Tests.dll" />
</ItemGroup>
</Target>
</Project>
42 changes: 42 additions & 0 deletions build.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build;CopyToReleaseFolder" ToolsVersion="4.0">
<!--Project configuration-->
<Import Project="Build.config" />

<UsingTask TaskName="xunit" AssemblyFile="$(XUnitPath)\xunit.runner.msbuild.dll" />

<!--Clean-->
<Target Name="CleanAll" DependsOnTargets="CleanDebug;CleanVerify;CleanRelease" />
<Target Name="CleanDebug">
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Debug" />
</Target>
<Target Name="CleanVerify">
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Verify" />
</Target>
<Target Name="CleanRelease">
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Release" />
</Target>

<!--Compile-->
<Target Name="Build" DependsOnTargets="CleanAll">
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Verify" />
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Release" />
</Target>

<!--Test. Note that the GetTestAssemblies Task MUST BE defined in the Build.config file. -->
<Target Name="Test" DependsOnTargets="GetTestAssemblies">
<xunit Assemblies="@(TestAssemblies)" />
</Target>

<!--Release-->
<Target Name="DeleteReleaseFolder">
<RemoveDir Directories="$(ReleaseFolder)" />
</Target>
<Target Name="MakeReleaseFolder" DependsOnTargets="DeleteReleaseFolder">
<MakeDir Directories="$(ReleaseFolder)" Condition="!Exists($(ReleaseFolder))" />
</Target>
<Target Name="CopyToReleaseFolder" DependsOnTargets="Test">
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(ReleaseFolder)" />
</Target>

</Project>
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<p><img src="https://raw.github.com/MehdiK/Humanizer/master/logo.png" alt="Logo" style="max-width:100%;" /></p>

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities.

###Table of contents
Expand Down Expand Up @@ -32,6 +34,7 @@ Humanizer meets all your .NET needs for manipulating and displaying strings, enu
- [Author](#author)
- [Main contributors](#main-contributors)
- [License](#license)
- [Icon](#icon)

##<a id="install">Install</a>
You can install Humanizer as [a nuget package](https://nuget.org/packages/Humanizer): `Install-Package Humanizer`
Expand Down Expand Up @@ -784,7 +787,7 @@ I have also flagged some of the easier issues as 'jump in' so you can start with

###<a id="contribution-guideline">Contribution guideline</a>
I use [GitHub flow](http://scottchacon.com/2011/08/31/github-flow.html) for pull requests.
So if you want to contribute, fork the repo, preferrably create a local branch to avoid conflicts with other activities, fix an issue and send a PR.
So if you want to contribute, fork the repo, preferrably create a local branch to avoid conflicts with other activities, fix an issue, run build.cmd from the root of the project, and send a PR if all is green.

Pull requests are code reviewed. Here is a checklist you should tick through before submitting a pull request:

Expand Down Expand Up @@ -844,3 +847,5 @@ Alexander I. Zaytsev ([@hazzik](https://github.com/hazzik))
##<a id="license">License</a>
Humanizer is released under the MIT License. See the [bundled LICENSE](https://github.com/MehdiK/Humanizer/blob/master/LICENSE) file for details.

##<a id="icon">Icon</a>
Icon created by [Tyrone Rieschiek](https://twitter.com/Inkventive)
21 changes: 19 additions & 2 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
###In Development
- [#217](https://github.com/Mehdik/Humanizer/pull/217): Changed OrdinalizeExtensions to better accommodate localisations. Added pt-BR and Spanish Ordinalize localisation.

[Commits](https://github.com/MehdiK/Humanizer/compare/v1.24.1...master)

###v1.24.1 - 2014-04-21
- [#232](https://github.com/Mehdik/Humanizer/pull/232): Adding code & tests to handle Arabic numbers to ordinal
- [#235](https://github.com/Mehdik/Humanizer/pull/235): Fixed the conversion for "1 millon" in SpanishNumberToWordsConverter
- [#233](https://github.com/Mehdik/Humanizer/pull/233): Added build.cmd and Verify build configuration for strict project build and analysis

[Commits](https://github.com/MehdiK/Humanizer/compare/v1.23.1...v1.24.1)

###v1.23.1 - 2014-04-19
- [#217](https://github.com/Mehdik/Humanizer/pull/217): Added pt-BR and Spanish Ordinalize localisation.
- [#220](https://github.com/Mehdik/Humanizer/pull/220): Added string formatting options to ToQuantity
- [#219](https://github.com/Mehdik/Humanizer/pull/219): Added Japanese translation for date and timespan
- [#221](https://github.com/Mehdik/Humanizer/pull/221): Added Russian ordinalizer
- [#228](https://github.com/Mehdik/Humanizer/pull/228): Fixed the "twenties" in SpanishNumberToWordsConverter
- [#231](https://github.com/Mehdik/Humanizer/pull/231): Added more settings for FromNow, Dual and Plural (Arabic)
- [#222](https://github.com/Mehdik/Humanizer/pull/222): Updated Ordinalize and ToOrdinalWords to account for special exceptions with 1 and 3.


[Commits](https://github.com/MehdiK/Humanizer/compare/v1.22.1...master)
[Commits](https://github.com/MehdiK/Humanizer/compare/v1.22.1...v1.23.1)

###v1.22.1 - 2014-04-14
- [#188](https://github.com/Mehdik/Humanizer/pull/188): Added Spanish ToOrdinalWords translations
Expand Down
4 changes: 4 additions & 0 deletions src/Humanizer.Tests/AmbientCulture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Humanizer.Tests
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly",
Justification = "This is a test only class, and doesn't need a 'proper' IDisposable implementation.")]
public class AmbientCulture : IDisposable
{
private readonly CultureInfo _culture;
Expand All @@ -20,6 +22,8 @@ public AmbientCulture(string cultureName)
{
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly",
Justification="This is a test only class, and doesn't need a 'proper' IDisposable implementation.")]
public void Dispose()
{
Thread.CurrentThread.CurrentUICulture = _culture;
Expand Down
16 changes: 16 additions & 0 deletions src/Humanizer.Tests/Humanizer.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Verify|AnyCPU'">
<OutputPath>bin\Verify\</OutputPath>
<CodeAnalysisRuleSet>..\Humanizer.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<NoWarn>1591</NoWarn>
<DocumentationFile>bin\Verify\Humanizer.Tests.XML</DocumentationFile>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="ApprovalTests">
<HintPath>..\packages\ApprovalTests.3.0.5\lib\net40\ApprovalTests.dll</HintPath>
Expand Down Expand Up @@ -98,6 +108,8 @@
<Compile Include="Localisation\id\TimeSpanHumanizeTests.cs" />
<Compile Include="Localisation\he\DateHumanizeTests.cs" />
<Compile Include="Localisation\ar\TimeSpanHumanizeTests.cs" />
<Compile Include="Localisation\ja\DateHumanizeTests.cs" />
<Compile Include="Localisation\ja\TimeSpanHumanizeTests.cs" />
<Compile Include="Localisation\nb-NO\TimeSpanHumanizeTests.cs" />
<Compile Include="Localisation\nl\NumberToWordsTests.cs" />
<Compile Include="Localisation\pl\DateHumanizeTests.cs" />
Expand Down Expand Up @@ -125,6 +137,10 @@
<Compile Include="Localisation\pt-BR\DateHumanizeTests.cs" />
<Compile Include="Localisation\pt-BR\TimeSpanHumanizeTests.cs" />
<Compile Include="Localisation\sk\TimeSpanHumanizeTests.cs" />
<Compile Include="Localisation\sr-Latn\DateHumanizeTests.cs" />
<Compile Include="Localisation\sr-Latn\TimeSpanHumanizeTests.cs" />
<Compile Include="Localisation\sr\DateHumanizeTests.cs" />
<Compile Include="Localisation\sr\TimeSpanHumanizeTests.cs" />
<Compile Include="Localisation\sv\DateHumanizeTests.cs" />
<Compile Include="Localisation\sv\TimeSpanHumanizeTests.cs" />
<Compile Include="DateTimeHumanizePrecisionStrategyTests.cs" />
Expand Down
62 changes: 61 additions & 1 deletion src/Humanizer.Tests/Localisation/ar/DateHumanizeTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Humanizer.Localisation;
using Humanizer.Localisation;
using Xunit.Extensions;

namespace Humanizer.Tests.Localisation.ar
Expand All @@ -18,6 +18,16 @@ public void DaysAgo(int days, string expected)
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past);
}

[Theory]
[InlineData(1, "في غضون يوم واحد من الآن")]
[InlineData(2, "في غضون يومين من الآن")]
[InlineData(10, "في غضون 10 أيام من الآن")]
[InlineData(17, "في غضون 17 يوم من الآن")]
public void DaysFromNow(int days, string expected)
{
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future);
}

[Theory]
[InlineData(-2, "منذ ساعتين")]
[InlineData(-1, "منذ ساعة واحدة")]
Expand All @@ -28,6 +38,16 @@ public void HoursAgo(int hours, string expected)
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past);
}

[Theory]
[InlineData(1, "في غضون ساعة واحدة من الآن")]
[InlineData(2, "في غضون ساعتين من الآن")]
[InlineData(10, "في غضون 10 ساعات من الآن")]
[InlineData(23, "في غضون 23 ساعة من الآن")]
public void HoursFromNow(int hours, string expected)
{
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future);
}

[Theory]
[InlineData(-2, "منذ دقيقتين")]
[InlineData(-1, "منذ دقيقة واحدة")]
Expand All @@ -38,6 +58,16 @@ public void MinutesAgo(int minutes, string expected)
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past);
}

[Theory]
[InlineData(1, "في غضون دقيقة واحدة من الآن")]
[InlineData(2, "في غضون دقيقتين من الآن")]
[InlineData(10, "في غضون 10 دقائق من الآن")]
[InlineData(23, "في غضون 23 دقيقة من الآن")]
public void MinutesFromNow(int minutes, string expected)
{
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future);
}

[Theory]
[InlineData(-2, "منذ شهرين")]
[InlineData(-1, "منذ شهر واحد")]
Expand All @@ -48,6 +78,15 @@ public void MonthsAgo(int months, string expected)
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past);
}

[Theory]
[InlineData(1, "في غضون شهر واحد من الآن")]
[InlineData(2, "في غضون شهرين من الآن")]
[InlineData(10, "في غضون 10 أشهر من الآن")]
public void MonthsFromNow(int months, string expected)
{
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future);
}

[Theory]
[InlineData(-2, "منذ ثانيتين")]
[InlineData(-1, "منذ ثانية واحدة")]
Expand All @@ -58,6 +97,17 @@ public void SecondsAgo(int seconds, string expected)
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past);
}

[Theory]
[InlineData(0, "الآن")]
[InlineData(1, "في غضون ثانية واحدة من الآن")]
[InlineData(2, "في غضون ثانيتين من الآن")]
[InlineData(10, "في غضون 10 ثوان من الآن")]
[InlineData(24, "في غضون 24 ثانية من الآن")]
public void SecondsFromNow(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future);
}

[Theory]
[InlineData(-2, "منذ عامين")]
[InlineData(-1, "العام السابق")]
Expand All @@ -67,5 +117,15 @@ public void YearsAgo(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past);
}

[Theory]
[InlineData(1, "في غضون سنة واحدة من الآن")]
[InlineData(2, "في غضون سنتين من الآن")]
[InlineData(7, "في غضون 7 سنوات من الآن")]
[InlineData(55, "في غضون 55 سنة من الآن")]
public void YearsFromNow(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future);
}
}
}
54 changes: 54 additions & 0 deletions src/Humanizer.Tests/Localisation/ar/NumberToWordsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,59 @@ public void ToWordsArabic(string expected, int number)
{
Assert.Equal(expected, number.ToWords());
}

[Theory]
[InlineData(0, "الصفر")]
[InlineData(1, "الأول")]
[InlineData(2, "الثاني")]
[InlineData(3, "الثالث")]
[InlineData(4, "الرابع")]
[InlineData(5, "الخامس")]
[InlineData(6, "السادس")]
[InlineData(7, "السابع")]
[InlineData(8, "الثامن")]
[InlineData(9, "التاسع")]
[InlineData(10, "العاشر")]
[InlineData(11, "الحادي عشر")]
[InlineData(12, "الثاني عشر")]
[InlineData(13, "الثالث عشر")]
[InlineData(14, "الرابع عشر")]
[InlineData(15, "الخامس عشر")]
[InlineData(16, "السادس عشر")]
[InlineData(17, "السابع عشر")]
[InlineData(18, "الثامن عشر")]
[InlineData(19, "التاسع عشر")]
[InlineData(20, "العشرون")]
[InlineData(21, "الحادي و العشرون")]
[InlineData(22, "الثاني و العشرون")]
[InlineData(30, "الثلاثون")]
[InlineData(40, "الأربعون")]
[InlineData(50, "الخمسون")]
[InlineData(60, "الستون")]
[InlineData(70, "السبعون")]
[InlineData(80, "الثمانون")]
[InlineData(90, "التسعون")]
[InlineData(95, "الخامس و التسعون")]
[InlineData(96, "السادس و التسعون")]
[InlineData(100, "المئة")]
[InlineData(120, "العشرون بعد المئة")]
[InlineData(121, "الحادي و العشرون بعد المئة")]
[InlineData(200, "المئتان")]
[InlineData(221, "الحادي و العشرون بعد المئتان")]
[InlineData(300, "الثلاث مئة")]
[InlineData(321, "الحادي و العشرون بعد الثلاث مئة")]
[InlineData(327, "السابع و العشرون بعد الثلاث مئة")]
[InlineData(1000, "الألف")]
[InlineData(1001, "الأول بعد الألف")]
[InlineData(1021, "الحادي و العشرون بعد الألف")]
[InlineData(10000, "العشرة آلاف")]
[InlineData(10121, "الحادي و العشرون بعد العشرة آلاف و مئة")]
[InlineData(100000, "المئة ألف")]
[InlineData(1000000, "المليون")]
[InlineData(1020135, "الخامس و الثلاثون بعد المليون و عشرون ألفاً و مئة")]
public void ToOrdinalWords(int number, string words)
{
Assert.Equal(words, number.ToOrdinalWords());
}
}
}
Loading