Skip to content

Commit

Permalink
Reorganize Localisation namespaces closes Humanizr#206
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzik committed Apr 17, 2014
1 parent 39a9b44 commit d084f3f
Show file tree
Hide file tree
Showing 31 changed files with 82 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class CasingExtensions
public class Configurator
{
public Humanizer.DateTimeHumanizeStrategy.IDateTimeHumanizeStrategy DateTimeHumanizeStrategy { get; set; }
public Humanizer.Localisation.Formatters.IFormatter Formatter { get; }
public Humanizer.Localisation.IFormatter Formatter { get; }
}

public class DateHumanizeExtensions
Expand Down
7 changes: 6 additions & 1 deletion src/Humanizer/Configuration/Configurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
using System.Collections.Generic;
using System.Globalization;
using Humanizer.DateTimeHumanizeStrategy;
using Humanizer.Localisation.Formatters;
using Humanizer.Localisation;
using Humanizer.Localisation.Arabic;
using Humanizer.Localisation.CzechSlovakPolish;
using Humanizer.Localisation.Hebrew;
using Humanizer.Localisation.Romanian;
using Humanizer.Localisation.Russian;

namespace Humanizer.Configuration
{
Expand Down
50 changes: 25 additions & 25 deletions src/Humanizer/Humanizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,37 +64,37 @@
<AssemblyOriginatorKeyFile>Humanizer.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="Localisation\NumberToWords\BrazilianPortugueseNumberToWordsConverter.cs" />
<Compile Include="Localisation\BrazilianPortuguese\BrazilianPortugueseNumberToWordsConverter.cs" />
<Compile Include="GrammaticalCase.cs" />
<Compile Include="GrammaticalGender.cs" />
<Compile Include="Localisation\GrammaticalNumber\RussianGrammaticalNumber.cs" />
<Compile Include="Localisation\GrammaticalNumber\RussianGrammaticalNumberDetector.cs" />
<Compile Include="Localisation\NumberToWords\DutchNumberToWordsConverter.cs" />
<Compile Include="Localisation\NumberToWords\DefaultNumberToWordsConverter.cs" />
<Compile Include="Localisation\NumberToWords\FarsiNumberToWordsConverter.cs" />
<Compile Include="Localisation\NumberToWords\ArabicNumberToWordsConverter.cs" />
<Compile Include="Localisation\Russian\RussianGrammaticalNumber.cs" />
<Compile Include="Localisation\Russian\RussianGrammaticalNumberDetector.cs" />
<Compile Include="Localisation\Dutch\DutchNumberToWordsConverter.cs" />
<Compile Include="Localisation\DefaultNumberToWordsConverter.cs" />
<Compile Include="Localisation\Farsi\FarsiNumberToWordsConverter.cs" />
<Compile Include="Localisation\Arabic\ArabicNumberToWordsConverter.cs" />
<Compile Include="Bytes\ByteSize.cs" />
<Compile Include="Bytes\ByteSizeExtensions.cs" />
<Compile Include="CasingExtensions.cs" />
<Compile Include="Configuration\Configurator.cs" />
<Compile Include="DateHumanizeExtensions.cs" />
<Compile Include="Localisation\NumberToWords\EnglishNumberToWordsConverter.cs" />
<Compile Include="Localisation\NumberToWords\FrenchNumberToWordsConverter.cs" />
<Compile Include="Localisation\NumberToWords\HebrewNumberToWordsConverter.cs" />
<Compile Include="Localisation\Formatters\CzechSlovakPolishFormatter.cs" />
<Compile Include="Localisation\English\EnglishNumberToWordsConverter.cs" />
<Compile Include="Localisation\French\FrenchNumberToWordsConverter.cs" />
<Compile Include="Localisation\Hebrew\HebrewNumberToWordsConverter.cs" />
<Compile Include="Localisation\CzechSlovakPolish\CzechSlovakPolishFormatter.cs" />
<Compile Include="DateTimeHumanizeStrategy\DefaultDateTimeHumanizeStrategy.cs" />
<Compile Include="DateTimeHumanizeStrategy\IDateTimeHumanizeStrategy.cs" />
<Compile Include="DateTimeHumanizeStrategy\PrecisionDateTimeHumanizeStrategy.cs" />
<Compile Include="Localisation\NumberToWords\PolishNumberToWordsConverter.cs" />
<Compile Include="Localisation\NumberToWords\RussianNumberToWordsConverter.cs" />
<Compile Include="Localisation\Formatters\HebrewFormatter.cs" />
<Compile Include="Localisation\Ordinalizers\RussianOrdinalizer.cs" />
<Compile Include="Localisation\Ordinalizers\SpanishOrdinalizer.cs" />
<Compile Include="Localisation\Ordinalizers\DefaultOrdinalizer.cs" />
<Compile Include="Localisation\Ordinalizers\EnglishOrdinalizer.cs" />
<Compile Include="Localisation\Ordinalizers\BrazilianPortugueseOrdinalizer.cs" />
<Compile Include="Localisation\Russian\RussianOrdinalizer.cs" />
<Compile Include="Localisation\Spanish\SpanishOrdinalizer.cs" />
<Compile Include="Localisation\DefaultOrdinalizer.cs" />
<Compile Include="Localisation\English\EnglishOrdinalizer.cs" />
<Compile Include="Localisation\BrazilianPortuguese\BrazilianPortugueseOrdinalizer.cs" />
<Compile Include="Localisation\CzechSlovakPolish\PolishNumberToWordsConverter.cs" />
<Compile Include="Localisation\Russian\RussianNumberToWordsConverter.cs" />
<Compile Include="Localisation\Hebrew\HebrewFormatter.cs" />
<Compile Include="Localisation\Tense.cs" />
<Compile Include="Localisation\NumberToWords\SpanishNumberToWordsConverter.cs" />
<Compile Include="Localisation\Spanish\SpanishNumberToWordsConverter.cs" />
<Compile Include="TimeSpanHumanizeExtensions.cs" />
<Compile Include="FluentDate\In.SomeTimeFrom.cs">
<AutoGen>True</AutoGen>
Expand All @@ -106,9 +106,9 @@
<DesignTime>True</DesignTime>
<DependentUpon>On.Days.tt</DependentUpon>
</Compile>
<Compile Include="Localisation\Formatters\ArabicFormatter.cs" />
<Compile Include="Localisation\Formatters\DefaultFormatter.cs" />
<Compile Include="Localisation\Formatters\IFormatter.cs" />
<Compile Include="Localisation\Arabic\ArabicFormatter.cs" />
<Compile Include="Localisation\DefaultFormatter.cs" />
<Compile Include="Localisation\IFormatter.cs" />
<Compile Include="Localisation\ResourceKeys.Common.cs" />
<Compile Include="Localisation\ResourceKeys.DateHumanize.cs" />
<Compile Include="Localisation\ResourceKeys.TimeSpanHumanize.cs" />
Expand All @@ -130,8 +130,8 @@
<DependentUpon>In.Months.tt</DependentUpon>
</Compile>
<Compile Include="Localisation\Resources.cs" />
<Compile Include="Localisation\Formatters\RomanianFormatter.cs" />
<Compile Include="Localisation\Formatters\RussianFormatter.cs" />
<Compile Include="Localisation\Romanian\RomanianFormatter.cs" />
<Compile Include="Localisation\Russian\RussianFormatter.cs" />
<Compile Include="NumberToTimeSpanExtensions.cs" />
<Compile Include="InflectorExtensions.cs" />
<Compile Include="LetterCasing.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Formatters
namespace Humanizer.Localisation.Arabic
{
internal class ArabicFormatter : DefaultFormatter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.Arabic
{
internal class ArabicNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.BrazilianPortuguese
{
internal class BrazilianPortugueseNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Ordinalizers
namespace Humanizer.Localisation.BrazilianPortuguese
{
internal class BrazilianPortugueseOrdinalizer : DefaultOrdinalizer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Formatters
namespace Humanizer.Localisation.CzechSlovakPolish
{
internal class CzechSlovakPolishFormatter : DefaultFormatter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.CzechSlovakPolish
{
internal class PolishNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Formatters
namespace Humanizer.Localisation
{
/// <summary>
/// Default implementation of IFormatter interface.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation
{
internal class DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Ordinalizers
namespace Humanizer.Localisation
{
internal class DefaultOrdinalizer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.Dutch
{
/// <summary>
/// Dutch spelling of numbers is not really officially regulated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.English
{
internal class EnglishNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Ordinalizers
namespace Humanizer.Localisation.English
{
internal class EnglishOrdinalizer : DefaultOrdinalizer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.Farsi
{
internal class FarsiNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.French
{
internal class FrenchNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Formatters
namespace Humanizer.Localisation.Hebrew
{
internal class HebrewFormatter : DefaultFormatter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.Hebrew
{
internal class HebrewNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Formatters
namespace Humanizer.Localisation
{
/// <summary>
/// Implement this interface if your language has complex rules around dealing with numbers.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Formatters
namespace Humanizer.Localisation.Romanian
{
internal class RomanianFormatter : DefaultFormatter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Humanizer.Localisation.GrammaticalNumber;

namespace Humanizer.Localisation.Formatters
namespace Humanizer.Localisation.Russian
{
internal class RussianFormatter : DefaultFormatter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Humanizer.Localisation.Russian
{
internal enum RussianGrammaticalNumber
{
Singular,
Paucal,
Plural
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.GrammaticalNumber
namespace Humanizer.Localisation.Russian
{
internal static class RussianGrammaticalNumberDetector
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using Humanizer.Localisation.GrammaticalNumber;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.Russian
{
internal class RussianNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Ordinalizers
namespace Humanizer.Localisation.Russian
{
internal class RussianOrdinalizer : DefaultOrdinalizer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace Humanizer.Localisation.NumberToWords
namespace Humanizer.Localisation.Spanish
{
internal class SpanishNumberToWordsConverter : DefaultNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Humanizer.Localisation.Ordinalizers
namespace Humanizer.Localisation.Spanish
{
internal class SpanishOrdinalizer : DefaultOrdinalizer
{
Expand Down
14 changes: 12 additions & 2 deletions src/Humanizer/NumberToWordsExtension.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using Humanizer.Localisation.NumberToWords;
using Humanizer.Localisation;
using Humanizer.Localisation.Arabic;
using Humanizer.Localisation.BrazilianPortuguese;
using Humanizer.Localisation.CzechSlovakPolish;
using Humanizer.Localisation.Dutch;
using Humanizer.Localisation.English;
using Humanizer.Localisation.Farsi;
using Humanizer.Localisation.French;
using Humanizer.Localisation.Hebrew;
using Humanizer.Localisation.Russian;
using Humanizer.Localisation.Spanish;

namespace Humanizer
{
Expand Down
6 changes: 5 additions & 1 deletion src/Humanizer/OrdinalizeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using Humanizer.Localisation.Ordinalizers;
using Humanizer.Localisation;
using Humanizer.Localisation.BrazilianPortuguese;
using Humanizer.Localisation.English;
using Humanizer.Localisation.Russian;
using Humanizer.Localisation.Spanish;

namespace Humanizer
{
Expand Down

0 comments on commit d084f3f

Please sign in to comment.