Commits

Clément Bourgeois  committed 67e16cc

Preparation for localization.

  • Participants
  • Parent commits e5fa47a

Comments (0)

Files changed (11)

File SQLServerBackupTool.Web/App_Start/AutoInstall.cs

 using SQLServerBackupTool.Web;
 using SQLServerBackupTool.Web.Lib;
 using SQLServerBackupTool.Web.Models;
+using System.ComponentModel;
 using System.Data.Entity;
 using System.Web.Security;
 
 
 namespace SQLServerBackupTool.Web
 {
-
+    [Localizable(false)]
     public static class AutoInstall
     {
         [UsedImplicitly]

File SQLServerBackupTool.Web/App_Start/BundleConfig.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
+using System.ComponentModel;
 using System.Web.Optimization;
 
 namespace SQLServerBackupTool.Web
 {
+    [Localizable(false)]
     public class BundleConfig
     {
         public static void RegisterBundles(BundleCollection bundles)

File SQLServerBackupTool.Web/App_Start/FilterConfig.cs

 
 namespace SQLServerBackupTool.Web
 {
-    public class FilterConfig
+    public static class FilterConfig
     {
         public static void RegisterGlobalFilters(GlobalFilterCollection filters)
         {

File SQLServerBackupTool.Web/App_Start/RouteConfig.cs

-using System.Web.Mvc;
+using System.ComponentModel;
+using System.Web.Mvc;
 using System.Web.Routing;
 
 namespace SQLServerBackupTool.Web
 {
+    [Localizable(false)]
     public static class RouteConfig
     {
         public static void RegisterRoutes(RouteCollection routes)

File SQLServerBackupTool.Web/App_Start/WebApiConfig.cs

     {
         public static void Register(HttpConfiguration config)
         {
-            config.Routes.MapHttpRoute(
-                name: "DefaultApi",
-                routeTemplate: "api/{controller}/{id}",
-                defaults: new { id = RouteParameter.Optional }
-            );
+            // config.Routes.MapHttpRoute(
+            //     name: "DefaultApi",
+            //     routeTemplate: "api/{controller}/{id}",
+            //     defaults: new { id = RouteParameter.Optional }
+            // );
         }
     }
 }

File SQLServerBackupTool.Web/Controllers/HomeController.cs

                 return HttpNotFound(string.Format("Unable to create database backup for '{0}'", id));
             }
 
-            if (format.ToLowerInvariant() == "zip")
+            if (format.ToLowerInvariant() == @"zip")
             {
                 var path = bk.Path;
                 var fileName = Path.GetFileName(path);
          * Deletion / Purge
          */
 
-        [HttpPost, ValidateAntiForgeryToken, Authorize(Roles = "Admin")]
+        [HttpPost, ValidateAntiForgeryToken, Authorize(Roles = @"Admin")]
         public ActionResult BackupsPurge()
         {
             if (BackupsManager.PurgeOldBackups(DbContext, DateTime.Now, Logger))
                     DbContext.SaveChanges();
                     if (Request.IsAjaxRequest())
                     {
-                        return Content("OK", "text/plain");
+                        return Content(@"OK", "text/plain");
                     }
 
                     AddFlashMessage("Backup successfully deleted", FlashMessageType.Success);
 
             if (Request.IsAjaxRequest())
             {
-                return Content("ERR", "text/plain");
+                return Content(@"ERR", "text/plain");
             }
 
             AddFlashMessage("An error occurred while deleting backup.", FlashMessageType.Error);

File SQLServerBackupTool.Web/Controllers/UsersController.cs

 
 namespace SQLServerBackupTool.Web.Controllers
 {
-    [Authorize(Roles = "Admin")]
+    [Authorize(Roles = @"Admin")]
     public class UsersController : ApplicationController
     {
         private const int NumberItemsPerPage = 30;
         {
             int pageIndex;
 
-            if (!int.TryParse(Request.Params["page"], out pageIndex))
+            if (!int.TryParse(Request.Params[@"page"], out pageIndex))
             {
                 pageIndex = 1;
             }

File SQLServerBackupTool.Web/Global.asax.cs

 using NLog;
 using NLog.Config;
 using NLog.Targets;
+using System.ComponentModel;
 using System.IO;
 using System.Web.Mvc;
 using System.Web.Optimization;
 {
     // Remarque : pour obtenir des instructions sur l'activation du mode classique IIS6 ou IIS7, 
     // visitez http://go.microsoft.com/?LinkId=9394801
+    [Localizable(false)]
     public class MvcApplication : System.Web.HttpApplication
     {
         protected void Application_Start()

File SQLServerBackupTool.Web/Lib/Mvc/ApplicationController.cs

 using NLog;
 using SQLServerBackupTool.Web.Models;
+using System.ComponentModel;
 using System.Diagnostics;
 using System.Linq;
 using System.Web.Mvc;
 
 namespace SQLServerBackupTool.Web.Lib.Mvc
 {
-    [Authorize]
+    [Authorize, Localizable(false)]
     public class ApplicationController : Controller, IFlashMessageProvider
     {
         protected Logger Logger

File SQLServerBackupTool.Web/Models/SSBTDbContext.cs

-using System.Data.Entity;
+using System.ComponentModel;
+using System.Data.Entity;
 
 namespace SQLServerBackupTool.Web.Models
 {
+    [Localizable(false)]
     public class SSBTDbContext : DbContext
     {
         public SSBTDbContext()

File SQLServerBackupTool/Lib/ConsoleHelper.cs

 
 namespace SQLServerBackupTool.Lib
 {
-    public class ConsoleHelper
+    public static class ConsoleHelper
     {
         /// <summary>
         /// Enable/disable all coloring while using those helpers