localisation
This commit is contained in:
parent
6091e8a3c1
commit
aa2ad71cc6
50 changed files with 1614 additions and 2211 deletions
|
|
@ -46,7 +46,6 @@ namespace Yavsc.Controllers
|
|||
readonly TwilioSettings _twilioSettings;
|
||||
|
||||
readonly IStringLocalizer _localizer;
|
||||
private readonly IStringLocalizer _localizer2;
|
||||
|
||||
// TwilioSettings _twilioSettings;
|
||||
|
||||
|
|
@ -83,13 +82,11 @@ namespace Yavsc.Controllers
|
|||
_siteSettings = siteSettings.Value;
|
||||
_twilioSettings = twilioSettings.Value;
|
||||
_logger = loggerFactory.CreateLogger<AccountController>();
|
||||
|
||||
|
||||
_dbContext = dbContext;
|
||||
var type = typeof(Yavsc.YavscLocalization);
|
||||
var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName);
|
||||
_localizer = localizerFactory.Create(type);
|
||||
_localizer2 = localizerFactory.Create("SharedResource", assemblyName.Name);
|
||||
|
||||
var type = typeof(AccountController);
|
||||
var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName);
|
||||
_localizer = localizerFactory.Create(type);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -898,6 +895,7 @@ namespace Yavsc.Controllers
|
|||
var callbackUrl = _siteSettings.Audience + "/Account/ResetPassword/" +
|
||||
HttpUtility.UrlEncode(user.Id) + "/" + HttpUtility.UrlEncode(code);
|
||||
|
||||
|
||||
var sent = await _emailSender.SendEmailAsync(user.UserName, user.Email, _localizer["Reset Password"],
|
||||
_localizer["Please reset your password by "] + " <a href=\"" +
|
||||
callbackUrl + "\" >following this link</a>");
|
||||
|
|
@ -1091,11 +1089,23 @@ namespace Yavsc.Controllers
|
|||
}
|
||||
|
||||
[HttpGet, Authorize("AdministratorOnly")]
|
||||
public IActionResult AdminDelete(string id)
|
||||
public IActionResult AdminDelete(string id, string? returnUrl=null)
|
||||
{
|
||||
return View(new UnregisterViewModel { UserId = id });
|
||||
return View(new UnregisterViewModel { UserId = id, ReturnUrl = returnUrl });
|
||||
}
|
||||
|
||||
[HttpPost, Authorize("AdministratorOnly")]
|
||||
public async Task<IActionResult> AdminDelete(UnregisterViewModel model)
|
||||
{
|
||||
var result = await DeleteUser(model.UserId);
|
||||
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
AddErrors(result);
|
||||
return new BadRequestObjectResult(ModelState);
|
||||
}
|
||||
return View();
|
||||
}
|
||||
[HttpPost, Authorize]
|
||||
public async Task<IActionResult> Delete(UnregisterViewModel model)
|
||||
{
|
||||
|
|
@ -1123,18 +1133,7 @@ namespace Yavsc.Controllers
|
|||
return await _userManager.DeleteAsync(user);
|
||||
}
|
||||
|
||||
[HttpPost, Authorize("AdministratorOnly")]
|
||||
public async Task<IActionResult> AdminDelete(UnregisterViewModel model)
|
||||
{
|
||||
var result = await DeleteUser(model.UserId);
|
||||
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
AddErrors(result);
|
||||
return new BadRequestObjectResult(ModelState);
|
||||
}
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
#region Helpers
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace Yavsc.Controllers
|
|||
IOptions<GoogleAuthSettings> googleSettings,
|
||||
IOptions<PayPalSettings> paypalSettings,
|
||||
IOptions<CompanyInfoSettings> cinfoSettings,
|
||||
IStringLocalizer<Yavsc.YavscLocalization> SR,
|
||||
IStringLocalizer<ManageController> SR,
|
||||
ICalendarManager calendarManager,
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ namespace Yavsc.Controllers
|
|||
public class ActivityController : Controller
|
||||
{
|
||||
private readonly ApplicationDbContext _context;
|
||||
readonly IStringLocalizer<Yavsc.YavscLocalization> SR;
|
||||
readonly IStringLocalizer<ActivityController> SR;
|
||||
readonly ILogger logger;
|
||||
|
||||
public ActivityController(ApplicationDbContext context,
|
||||
IStringLocalizer<Yavsc.YavscLocalization> SR,
|
||||
IStringLocalizer<ActivityController> SR,
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
_context = context;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ namespace Yavsc.Controllers
|
|||
using Models.Workflow;
|
||||
using Services;
|
||||
using Yavsc.Interface;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Server.Helpers;
|
||||
using Yavsc.Settings;
|
||||
|
||||
|
|
@ -26,7 +28,7 @@ namespace Yavsc.Controllers
|
|||
protected GoogleAuthSettings _googleSettings;
|
||||
protected IYavscMessageSender _MessageSender;
|
||||
protected ITrueEmailSender _emailSender;
|
||||
protected IStringLocalizer _localizer;
|
||||
protected IStringLocalizer<CommandController> _localizer;
|
||||
protected SiteSettings _siteSettings;
|
||||
protected SmtpSettings _smtpSettings;
|
||||
protected ICalendarManager _calendarManager;
|
||||
|
|
@ -36,7 +38,7 @@ namespace Yavsc.Controllers
|
|||
IYavscMessageSender messageSender,
|
||||
UserManager<ApplicationUser> userManager,
|
||||
ICalendarManager calendarManager,
|
||||
IStringLocalizer<YavscLocalization> localizer,
|
||||
IStringLocalizer<CommandController> localizer,
|
||||
ITrueEmailSender emailSender,
|
||||
IOptions<SmtpSettings> smtpSettings,
|
||||
IOptions<SiteSettings> siteSettings,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Yavsc.Controllers
|
|||
UserManager<ApplicationUser> userManager,
|
||||
IBillingService billing,
|
||||
ILoggerFactory loggerFactory,
|
||||
IStringLocalizer<Yavsc.YavscLocalization> SR)
|
||||
IStringLocalizer<FrontOfficeController> SR)
|
||||
{
|
||||
_context = context;
|
||||
_userManager = userManager;
|
||||
|
|
|
|||
|
|
@ -18,11 +18,9 @@ namespace Yavsc.Controllers
|
|||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Models.Messaging;
|
||||
using PayPal.PayPalAPIInterfaceService.Model;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Yavsc.Interface;
|
||||
using Yavsc.Settings;
|
||||
using Yavsc.Abstract.Models.Messaging;
|
||||
|
|
@ -31,12 +29,15 @@ namespace Yavsc.Controllers
|
|||
public class HairCutCommandController : CommandController
|
||||
{
|
||||
readonly PayPalSettings payPalSettings;
|
||||
private readonly IStringLocalizer<HairCutQuery> haircutLocalizer;
|
||||
|
||||
public HairCutCommandController(ApplicationDbContext context,
|
||||
IOptions<PayPalSettings> payPalSettings,
|
||||
IOptions<GoogleAuthSettings> googleSettings,
|
||||
IYavscMessageSender GCMSender,
|
||||
UserManager<ApplicationUser> userManager,
|
||||
IStringLocalizer<Yavsc.YavscLocalization> localizer,
|
||||
IStringLocalizer<HairCutQuery> haircutLocalizer,
|
||||
IStringLocalizer<CommandController> localizer,
|
||||
ITrueEmailSender emailSender,
|
||||
IOptions<SmtpSettings> smtpSettings,
|
||||
IOptions<SiteSettings> siteSettings,
|
||||
|
|
@ -45,6 +46,7 @@ namespace Yavsc.Controllers
|
|||
calManager, localizer, emailSender, smtpSettings, siteSettings, loggerFactory)
|
||||
{
|
||||
this.payPalSettings = payPalSettings.Value;
|
||||
this.haircutLocalizer = haircutLocalizer;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -263,7 +265,7 @@ namespace Yavsc.Controllers
|
|||
model.SelectedProfile = brusherProfile;
|
||||
model.Client = await _userManager.FindByIdAsync(uid);
|
||||
_logger.LogInformation(JsonConvert.SerializeObject(model));
|
||||
var yaev = model.CreateNewHairCutQueryEvent(_localizer);
|
||||
var yaev = model.CreateNewHairCutQueryEvent(this.haircutLocalizer);
|
||||
|
||||
if (pro.AcceptPublicContact)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ namespace Yavsc.Controllers
|
|||
public class ProjectController : Controller
|
||||
{
|
||||
private readonly ApplicationDbContext _context;
|
||||
readonly IStringLocalizer<Yavsc.YavscLocalization> _localizer;
|
||||
readonly IStringLocalizer<ProjectController> _localizer;
|
||||
readonly IStringLocalizer<BugController> _bugLocalizer;
|
||||
|
||||
public ProjectController(ApplicationDbContext context,
|
||||
IStringLocalizer<Yavsc.YavscLocalization> localizer,
|
||||
IStringLocalizer<ProjectController> localizer,
|
||||
IStringLocalizer<BugController> bugLocalizer
|
||||
)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue