update webfront translation strings

This commit is contained in:
RaidMax
2022-07-05 12:02:43 -05:00
parent a6c0a94f6c
commit 2fca68a7ea
38 changed files with 178 additions and 127 deletions

View File

@ -24,7 +24,7 @@ namespace WebfrontCore.Controllers
{
if (clientId == 0 || string.IsNullOrEmpty(password))
{
return Unauthorized("Invalid credentials");
return Unauthorized(Localization["WEBFRONT_ACTION_LOGIN_ERROR"]);
}
try
@ -73,16 +73,16 @@ namespace WebfrontCore.Controllers
: HttpContext.Connection.RemoteIpAddress?.ToString()
});
return Ok($"Welcome {privilegedClient.Name}. You are now logged in");
return Ok(Localization["WEBFRONT_ACTION_LOGIN_SUCCESS"].FormatExt(privilegedClient.CleanedName));
}
}
catch (Exception)
{
return Unauthorized("Could not validate credentials");
return Unauthorized(Localization["WEBFRONT_ACTION_LOGIN_ERROR"]);
}
return Unauthorized("Invalid credentials");
return Unauthorized(Localization["WEBFRONT_ACTION_LOGIN_ERROR"]);
}
[HttpGet]

View File

@ -78,7 +78,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = Localization["WEBFRONT_ACTION_BAN_NAME"],
Name = "Ban",
Name = Localization["WEBFRONT_ACTION_BAN_NAME"],
Inputs = new List<InputInfo>
{
new()
@ -152,7 +152,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = Localization["WEBFRONT_ACTION_UNBAN_NAME"],
Name = "Unban",
Name = Localization["WEBFRONT_ACTION_UNBAN_NAME"],
Inputs = new List<InputInfo>
{
new()
@ -193,7 +193,7 @@ namespace WebfrontCore.Controllers
var login = new ActionInfo
{
ActionButtonLabel = Localization["WEBFRONT_ACTION_LOGIN_NAME"],
Name = "Login",
Name = Localization["WEBFRONT_ACTION_LOGIN_NAME"],
Inputs = new List<InputInfo>
{
new()
@ -226,7 +226,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = Localization["WEBFRONT_ACTION_LABEL_EDIT"],
Name = "Edit",
Name = Localization["WEBFRONT_ACTION_LABEL_EDIT"],
Inputs = new List<InputInfo>
{
new()
@ -291,7 +291,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = Localization["WEBFRONT_ACTION_LABEL_SUBMIT_MESSAGE"],
Name = "Chat",
Name = Localization["WEBFRONT_ACTION_LABEL_SUBMIT_MESSAGE"],
Inputs = new List<InputInfo>
{
new()
@ -367,7 +367,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = Localization["WEBFRONT_ACTION_FLAG_NAME"],
Name = "Flag",
Name = Localization["WEBFRONT_ACTION_FLAG_NAME"],
Inputs = new List<InputInfo>
{
new()
@ -406,7 +406,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = Localization["WEBFRONT_ACTION_UNFLAG_NAME"],
Name = "Unflag",
Name = Localization["WEBFRONT_ACTION_UNFLAG_NAME"],
Inputs = new List<InputInfo>
{
new()
@ -438,7 +438,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = Localization["WEBFRONT_ACTION_KICK_NAME"],
Name = "Kick",
Name = Localization["WEBFRONT_ACTION_KICK_NAME"],
Inputs = new List<InputInfo>
{
new()
@ -488,7 +488,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = "Dismiss",
Name = "Dismiss Alert?",
Name = Localization["WEBFRONT_ACTION_DISMISS_ALERT_SINGLE"],
Inputs = new List<InputInfo>
{
new()
@ -512,7 +512,7 @@ namespace WebfrontCore.Controllers
{
new CommandResponseInfo
{
Response = "Alert dismissed"
Response = Localization["WEBFRONT_ACTION_DISMISS_ALERT_SINGLE_RESPONSE"]
}
});
}
@ -522,7 +522,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = "Dismiss",
Name = "Dismiss All Alerts?",
Name = Localization["WEBFRONT_ACTION_DISMISS_ALERT_MANY"],
Inputs = new List<InputInfo>
{
new()
@ -546,7 +546,7 @@ namespace WebfrontCore.Controllers
{
new CommandResponseInfo
{
Response = "Alerts dismissed"
Response = Localization["WEBFRONT_ACTION_DISMISS_ALERT_MANY_RESPONSE"]
}
});
}
@ -556,7 +556,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo
{
ActionButtonLabel = "Send",
Name = "Compose Message",
Name = Localization["WEBFRONT_ACTION_OFFLINE_MESSAGE_BUTTON_COMPOSE"],
Inputs = new List<InputInfo>
{
new()

View File

@ -56,7 +56,7 @@ namespace WebfrontCore.Controllers
ViewBag.ClientIP = request.ClientIP;
ViewBag.ClientGuid = request.ClientGuid;
ViewBag.Title = "Ban Management";
ViewBag.Title = Localization["WEBFRONT_NAV_TITLE_BAN_MANAGEMENT"];
return View(results.Results);
}

View File

@ -146,12 +146,8 @@ namespace WebfrontCore.Controllers
clientDto.Meta.AddRange(Authorized ? meta : meta.Where(m => !m.IsSensitive));
var strippedName = clientDto.Name.StripColors();
ViewBag.Title = strippedName.Substring(strippedName.Length - 1).ToLower()[0] == 's'
? strippedName + "'"
: strippedName + "'s";
ViewBag.Title += " " + Localization["WEBFRONT_CLIENT_PROFILE_TITLE"];
ViewBag.Description = $"Client information for {strippedName}";
ViewBag.Keywords = $"IW4MAdmin, client, profile, {strippedName}";
ViewBag.Title = $"{strippedName} | {Localization["WEBFRONT_CLIENT_PROFILE_TITLE"]}";
ViewBag.Description = Localization["WEBFRONT_PROFILE_DESCRIPTION"].FormatExt(strippedName);
ViewBag.UseNewStats = _config?.EnableAdvancedMetrics ?? true;
return View("Profile/Index", clientDto);

View File

@ -100,7 +100,7 @@ namespace WebfrontCore.Controllers
new CommandResponseInfo
{
ClientId = client.ClientId,
Response = Utilities.CurrentLocalization.LocalizationIndex["COMMADS_RESTART_SUCCESS"]
Response = Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_RESTART_SUCCESS"]
}
};
}