add translation for webfront

discord link has been genericized to social link
This commit is contained in:
RaidMax
2018-05-05 17:52:04 -05:00
parent e8dff01c41
commit a54ea3913d
22 changed files with 259 additions and 84 deletions

View File

@ -83,12 +83,12 @@ namespace WebfrontCore.Controllers
new InputInfo()
{
Name = "clientId",
Label = "Client ID"
Label = Localization["WEBFRONT_ACTION_LABEL_ID"]
},
new InputInfo()
{
Name = "Password",
Label ="Password",
Label = Localization["WEBFRONT_ACTION_LABEL_PASSWORD"],
Type = "password",
}
},

View File

@ -20,18 +20,21 @@ namespace WebfrontCore.Controllers
protected SharedLibraryCore.Localization.Index Localization { get; private set; }
protected EFClient Client { get; private set; }
private static byte[] LocalHost = { 127, 0, 0, 1 };
private static string DiscordLink;
private static string SocialLink;
private static string SocialTitle;
public BaseController()
{
Manager = Program.Manager;
if (Manager.GetApplicationSettings().Configuration().EnableDiscordLink)
if (Manager == null)
Manager = Program.Manager;
if (Localization == null)
Localization = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
if (Manager.GetApplicationSettings().Configuration().EnableDiscordLink && SocialLink == null)
{
string inviteLink = Manager.GetApplicationSettings().Configuration().DiscordInviteCode;
if (inviteLink != null)
DiscordLink = inviteLink.Contains("https") ? inviteLink : $"https://discordapp.com/invite/{inviteLink}";
else
DiscordLink = "";
SocialLink = Manager.GetApplicationSettings().Configuration().DiscordInviteCode;
SocialTitle = Manager.GetApplicationSettings().Configuration().SocialLinkTitle;
}
}
@ -83,7 +86,8 @@ namespace WebfrontCore.Controllers
ViewBag.Authorized = Authorized;
ViewBag.Url = Manager.GetApplicationSettings().Configuration().WebfrontBindUrl;
ViewBag.User = Client;
ViewBag.DiscordLink = DiscordLink ?? "";
ViewBag.SocialLink = SocialLink ?? "";
ViewBag.SocialTitle = SocialTitle;
base.OnActionExecuting(context);
}

View File

@ -53,8 +53,8 @@ namespace WebfrontCore.Controllers
if (Authorized && client.Level > SharedLibraryCore.Objects.Player.Permission.Trusted)
clientDto.Meta.Add(new ProfileMeta()
{
Key = "Masked",
Value = client.Masked ? "Is" : "Is not",
Key = Localization["WEBFRONT_CLIENT_META_MASKED"],
Value = client.Masked ? Localization["WEBFRONT_CLIENT_META_TRUE"]: Localization["WEBFRONT_CLIENT_META_FALSE"],
Sensitive = true,
When = DateTime.MinValue
});
@ -67,7 +67,7 @@ namespace WebfrontCore.Controllers
.Select(a => new ProfileMeta()
{
Key = "AliasEvent",
Value = $"Joined with alias {a.Name}",
Value = $"{Localization["WEBFRONT_CLIENT_META_JOINED"]} {a.Name}",
Sensitive = true,
When = a.DateAdded
}));
@ -83,7 +83,7 @@ namespace WebfrontCore.Controllers
ViewBag.Title = clientDto.Name.Substring(clientDto.Name.Length - 1).ToLower()[0] == 's' ?
clientDto.Name + "'" :
clientDto.Name + "'s";
ViewBag.Title += " Profile";
ViewBag.Title += " " + Localization["WEBFRONT_CLIENT_PROFILE_TITLE"];
ViewBag.Description = $"Client information for {clientDto.Name}";
ViewBag.Keywords = $"IW4MAdmin, client, profile, {clientDto.Name}";
@ -109,7 +109,7 @@ namespace WebfrontCore.Controllers
});
}
ViewBag.Title = "Privileged Clients";
ViewBag.Title = Localization["WEBFRONT_CLIENT_PRIVILEGED_TITLE"];
ViewBag.Description = "List of all privileged clients on IW4MAdmin";
ViewBag.Keywords = "IW4MAdmin, privileged, admins, clients, administrators";
@ -131,7 +131,7 @@ namespace WebfrontCore.Controllers
})
.ToList();
ViewBag.Title = $"{clientsDto.Count} Clients Matching \"{clientName}\"";
ViewBag.Title = $"{clientsDto.Count} {Localization["WEBFRONT_CLIENT_SEARCH_MATCHING"]} \"{clientName}\"";
return View("Find/Index", clientsDto);
}
}

View File

@ -20,7 +20,7 @@ namespace WebfrontCore.Controllers
});
ViewBag.Description = "Use the IW4MAdmin web console to execute commands";
ViewBag.Title = "Web Console";
ViewBag.Title = Localization["WEBFRONT_CONSOLE_TITLE"];
ViewBag.Keywords = "IW4MAdmin, console, execute, commands";
return View(activeServers);

View File

@ -13,7 +13,7 @@ namespace WebfrontCore.Controllers
public IActionResult Index()
{
ViewBag.Description = "IW4MAdmin is a complete server administration tool for IW4x.";
ViewBag.Title = "Server Overview";
ViewBag.Title = Localization["WEBFRONT_HOME_TITLE"];
ViewBag.Keywords = "IW4MAdmin, server, administration, IW4x, MW2, Modern Warfare 2";
return View();
@ -21,8 +21,8 @@ namespace WebfrontCore.Controllers
public IActionResult Error()
{
ViewBag.Description = "IW4MAdmin encountered an error";
ViewBag.Title = "Error!";
ViewBag.Description = Localization["WEBFRONT_ERROR_DESC"];
ViewBag.Title = Localization["WEBFRONT_ERROR_TITLE"];
return View();
}
}

View File

@ -16,7 +16,7 @@ namespace WebfrontCore.Controllers
public IActionResult List(int showOnly = (int)SharedLibraryCore.Objects.Penalty.PenaltyType.Any)
{
ViewBag.Description = "List of all the recent penalties (bans, kicks, warnings) on IW4MAdmin";
ViewBag.Title = "Client Penalties";
ViewBag.Title = Localization["WEBFRONT_PENALTY_TITLE"];
ViewBag.Keywords = "IW4MAdmin, penalties, ban, kick, warns";
return View((SharedLibraryCore.Objects.Penalty.PenaltyType)showOnly);