From d2f79b660e71964dd7433c042b77b6503e82db4d Mon Sep 17 00:00:00 2001 From: Justin Edwards Date: Thu, 17 Apr 2014 00:07:43 -0400 Subject: [PATCH] made formatter factories public per #150 --- .../PublicApiApprovalTest.approve_public_api.approved.txt | 1 + src/Humanizer/Configuration/Configurator.cs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt index 4682973c1..e9fe4ecc5 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt @@ -67,6 +67,7 @@ public class Configurator { public Humanizer.DateTimeHumanizeStrategy.IDateTimeHumanizeStrategy DateTimeHumanizeStrategy { get; set; } public Humanizer.Localisation.Formatters.IFormatter Formatter { get; } + public System.Collections.Generic.IDictionary> FormatterFactories { get; } } public class DateHumanizeExtensions diff --git a/src/Humanizer/Configuration/Configurator.cs b/src/Humanizer/Configuration/Configurator.cs index ec80c2d51..4460ffb70 100644 --- a/src/Humanizer/Configuration/Configurator.cs +++ b/src/Humanizer/Configuration/Configurator.cs @@ -11,7 +11,7 @@ namespace Humanizer.Configuration /// public static class Configurator { - private static readonly IDictionary> FormatterFactories = + private static readonly IDictionary> _formatterFactories = new Dictionary>(StringComparer.OrdinalIgnoreCase) { { "ro", () => new RomanianFormatter() }, @@ -25,6 +25,11 @@ public static class Configurator { "sl", () => new SlovenianFormatter() } }; + public static IDictionary> FormatterFactories + { + get { return _formatterFactories; } + } + private static IDateTimeHumanizeStrategy _dateTimeHumanizeStrategy = new DefaultDateTimeHumanizeStrategy(); ///