diff --git a/src/Microsoft.AspNet.Mvc.Localization/DependencyInjection/MvcLocalizationMvcBuilderExtensions.cs b/src/Microsoft.AspNet.Mvc.Localization/DependencyInjection/MvcLocalizationMvcBuilderExtensions.cs
new file mode 100644
index 0000000000..c51255ca26
--- /dev/null
+++ b/src/Microsoft.AspNet.Mvc.Localization/DependencyInjection/MvcLocalizationMvcBuilderExtensions.cs
@@ -0,0 +1,52 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.AspNet.Mvc.Razor;
+using Microsoft.Framework.Internal;
+
+namespace Microsoft.Framework.DependencyInjection
+{
+ ///
+ /// Extension methods for configuring MVC view localization.
+ ///
+ public static class MvcLocalizationMvcBuilderExtensions
+ {
+ ///
+ /// Adds MVC localization to the application.
+ ///
+ /// The .
+ /// The .
+ ///
+ /// Adding localization also adds support for views via
+ /// and the Razor view engine
+ /// via .
+ ///
+ public static IMvcBuilder AddLocalization([NotNull] this IMvcBuilder builder)
+ {
+ return AddLocalization(builder, LanguageViewLocationExpanderFormat.Suffix);
+ }
+
+ ///
+ /// Adds MVC localization to the application.
+ ///
+ /// The .
+ /// The view format for localized views.
+ /// The .
+ ///
+ /// Adding localization also adds support for views via
+ /// and the Razor view engine
+ /// via .
+ ///
+ public static IMvcBuilder AddLocalization(
+ [NotNull] this IMvcBuilder builder,
+ LanguageViewLocationExpanderFormat format)
+ {
+
+ builder.AddViews();
+ builder.AddRazorViewEngine();
+
+ MvcLocalizationServiceCollectionExtensions.AddMvcLocalization(builder.Services, format);
+ return builder;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Mvc.Localization/MvcLocalizationServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Mvc.Localization/DependencyInjection/MvcLocalizationServiceCollectionExtensions.cs
similarity index 86%
rename from src/Microsoft.AspNet.Mvc.Localization/MvcLocalizationServiceCollectionExtensions.cs
rename to src/Microsoft.AspNet.Mvc.Localization/DependencyInjection/MvcLocalizationServiceCollectionExtensions.cs
index 0583e09188..b65047a8b4 100644
--- a/src/Microsoft.AspNet.Mvc.Localization/MvcLocalizationServiceCollectionExtensions.cs
+++ b/src/Microsoft.AspNet.Mvc.Localization/DependencyInjection/MvcLocalizationServiceCollectionExtensions.cs
@@ -10,10 +10,13 @@ using Microsoft.Framework.WebEncoders;
namespace Microsoft.Framework.DependencyInjection
{
+ ///
+ /// Extension methods for configuring MVC view localization.
+ ///
public static class MvcLocalizationServiceCollectionExtensions
{
///
- /// Adds Mvc localization to the application.
+ /// Adds MVC localization to the application.
///
/// The .
/// The .
@@ -23,10 +26,10 @@ namespace Microsoft.Framework.DependencyInjection
}
///
- /// Adds Mvc localization to the application.
+ /// Adds MVC localization to the application.
///
/// The .
- /// The view format for localized views.
+ /// The view format for localized views.
/// The .
public static IServiceCollection AddMvcLocalization(
[NotNull] this IServiceCollection services,
@@ -40,7 +43,7 @@ namespace Microsoft.Framework.DependencyInjection
DefaultOrder.DefaultFrameworkSortOrder);
services.TryAdd(ServiceDescriptor.Singleton());
- services.TryAdd(ServiceDescriptor.Transient(typeof(IHtmlLocalizer<>), typeof(HtmlLocalizer<>)));
+ services.TryAdd(ServiceDescriptor.Transient(typeof(IHtmlLocalizer<>), typeof(HtmlLocalizer<>)));
services.TryAdd(ServiceDescriptor.Transient());
if (!services.Any(sd => sd.ServiceType == typeof(IHtmlEncoder)))
{
diff --git a/test/Microsoft.AspNet.Mvc.Localization.Test/MvcLocalizationServiceCollectionExtensionsTest.cs b/test/Microsoft.AspNet.Mvc.Localization.Test/DependencyInjection/MvcLocalizationServiceCollectionExtensionsTest.cs
similarity index 99%
rename from test/Microsoft.AspNet.Mvc.Localization.Test/MvcLocalizationServiceCollectionExtensionsTest.cs
rename to test/Microsoft.AspNet.Mvc.Localization.Test/DependencyInjection/MvcLocalizationServiceCollectionExtensionsTest.cs
index a91d1bf770..6add903e3b 100644
--- a/test/Microsoft.AspNet.Mvc.Localization.Test/MvcLocalizationServiceCollectionExtensionsTest.cs
+++ b/test/Microsoft.AspNet.Mvc.Localization.Test/DependencyInjection/MvcLocalizationServiceCollectionExtensionsTest.cs
@@ -5,15 +5,15 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
+using Microsoft.AspNet.Mvc.Localization;
using Microsoft.AspNet.Mvc.Razor;
-using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.Localization;
using Microsoft.Framework.OptionsModel;
using Microsoft.Framework.WebEncoders;
using Microsoft.Framework.WebEncoders.Testing;
using Xunit;
-namespace Microsoft.AspNet.Mvc.Localization.Test
+namespace Microsoft.Framework.DependencyInjection
{
public class MvcLocalizationServiceCollectionExtensionsTest
{