Added languages #243

pull/383/head
tidusjar 8 years ago
parent 2ec27dce90
commit bcdb612faa

@ -41,24 +41,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UI.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>UI.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="UI.da.resx" />
<EmbeddedResource Include="UI.de.resx" />
<EmbeddedResource Include="UI.es.resx" />
<EmbeddedResource Include="UI.fr.resx" />
<EmbeddedResource Include="UI.it.resx" />
<EmbeddedResource Include="UI.pt.resx" />
<EmbeddedResource Include="UI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>UI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="UI.sv.resx" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

@ -27,12 +27,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Nancy;
using PlexRequests.Core;
using PlexRequests.Core.SettingModels;
using PlexRequests.Helpers;
using PlexRequests.UI.Helpers;
using PlexRequests.UI.Models;
namespace PlexRequests.UI.Modules
@ -41,8 +43,10 @@ namespace PlexRequests.UI.Modules
{
protected string BaseUrl { get; set; }
protected BaseModule(ISettingsService<PlexRequestSettings> settingsService)
{
var settings = settingsService.GetSettings();
var baseUrl = settings.BaseUrl;
BaseUrl = baseUrl;
@ -50,10 +54,13 @@ namespace PlexRequests.UI.Modules
var modulePath = string.IsNullOrEmpty(baseUrl) ? string.Empty : baseUrl;
ModulePath = modulePath;
Before += (ctx) => SetCookie();
}
protected BaseModule(string modulePath, ISettingsService<PlexRequestSettings> settingsService)
{
var settings = settingsService.GetSettings();
var baseUrl = settings.BaseUrl;
BaseUrl = baseUrl;
@ -61,6 +68,8 @@ namespace PlexRequests.UI.Modules
var settingModulePath = string.IsNullOrEmpty(baseUrl) ? modulePath : $"{baseUrl}/{modulePath}";
ModulePath = settingModulePath;
Before += (ctx) => SetCookie();
}
private int _dateTimeOffset = -1;
@ -96,7 +105,7 @@ namespace PlexRequests.UI.Modules
}
}
protected IDictionary<string, string> Cookies => Request.Cookies;
protected IDictionary<string, string> Cookies => Request?.Cookies;
protected bool IsAdmin
{
@ -110,6 +119,41 @@ namespace PlexRequests.UI.Modules
return claims.Contains(UserClaims.Admin) || claims.Contains(UserClaims.PowerUser);
}
}
protected string Culture { get; set; }
protected const string CultureCookieName = "_culture";
protected Response SetCookie()
{
try
{
string cultureName;
// Attempt to read the culture cookie from Request
var outCookie = string.Empty;
if (Cookies.TryGetValue(CultureCookieName, out outCookie))
{
cultureName = outCookie;
}
else
{
cultureName = Request.Headers?.AcceptLanguage?.FirstOrDefault()?.Item1;
}
// Validate culture name
cultureName = CultureHelper.GetImplementedCulture(cultureName); // This is safe
// Modify current thread's cultures
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(cultureName);
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
Culture = Thread.CurrentThread.CurrentCulture.Name;
}
catch (Exception)
{
// Couldn't Set the culture
}
return null;
}
}
}

@ -41,18 +41,27 @@ namespace PlexRequests.UI.Modules
private const string CookieName = "_culture";
public CultureModule(ISettingsService<PlexRequestSettings> pr) : base("culture",pr)
{
Get["/culture"] = x => SetCulture();
Get["/"] = x => SetCulture();
}
public RedirectResponse SetCulture()
{
var culture = (string)Request.Query["culture"];
var returnUrl = (string)Request.Query["returnUrl"];
var culture = (string)Request.Query["l"];
var returnUrl = (string)Request.Query["u"];
// Validate
culture = CultureHelper.GetImplementedCulture(culture);
var cookie = Request.Cookies["_culture"];
var outCookie = string.Empty;
if (Cookies.TryGetValue(CookieName, out outCookie))
{
Cookies[CookieName] = culture;
}
else
{
Cookies.Add(CookieName, culture);
}
var cookie = Cookies["_culture"];
var response = Context.GetRedirect(returnUrl);
response.WithCookie(CookieName, cookie ?? culture, DateTime.Now.AddYears(1));

@ -201,6 +201,11 @@
<Compile Include="Modules\IssuesModule.cs" />
<Compile Include="Modules\LandingPageModule.cs" />
<Compile Include="Modules\UpdateCheckerModule.cs" />
<Compile Include="Resources\UI.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>UI.resx</DependentUpon>
</Compile>
<Compile Include="Start\StartupOptions.cs" />
<Compile Include="Start\UpdateValue.cs" />
<Compile Include="Validators\SlackSettingsValidator.cs" />
@ -571,7 +576,19 @@
<DependentUpon>web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="Resources\UI.da.resx" />
<EmbeddedResource Include="Resources\UI.de.resx" />
<EmbeddedResource Include="Resources\UI.es.resx" />
<EmbeddedResource Include="Resources\UI.fr.resx" />
<EmbeddedResource Include="Resources\UI.it.resx" />
<EmbeddedResource Include="Resources\UI.pt.resx" />
<EmbeddedResource Include="Resources\UI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>UI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\UI.sv.resx" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PlexRequests.Api.Interfaces\PlexRequests.Api.Interfaces.csproj">
<Project>{95834072-A675-415D-AA8F-877C91623810}</Project>
@ -593,10 +610,6 @@
<Project>{1252336D-42A3-482A-804C-836E60173DFA}</Project>
<Name>PlexRequests.Helpers</Name>
</ProjectReference>
<ProjectReference Include="..\PlexRequests.Resources\PlexRequests.Resources.csproj">
<Project>{9c266462-be82-461a-87a2-9edcfb95d732}</Project>
<Name>PlexRequests.Resources</Name>
</ProjectReference>
<ProjectReference Include="..\PlexRequests.Services\PlexRequests.Services.csproj">
<Project>{566EFA49-68F8-4716-9693-A6B3F2624DEA}</Project>
<Name>PlexRequests.Services</Name>

@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace PlexRequests.Resources {
namespace PlexRequests.UI.Resources {
using System;
@ -39,7 +39,7 @@ namespace PlexRequests.Resources {
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PlexRequests.Resources.UI", typeof(UI).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PlexRequests.UI.Resources.UI", typeof(UI).Assembly);
resourceMan = temp;
}
return resourceMan;
@ -78,6 +78,168 @@ namespace PlexRequests.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Admin.
/// </summary>
public static string Layout_Admin {
get {
return ResourceManager.GetString("Layout_Admin", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Change Password.
/// </summary>
public static string Layout_ChangePassword {
get {
return ResourceManager.GetString("Layout_ChangePassword", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Danish.
/// </summary>
public static string Layout_Danish {
get {
return ResourceManager.GetString("Layout_Danish", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Donate.
/// </summary>
public static string Layout_Donate {
get {
return ResourceManager.GetString("Layout_Donate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to English.
/// </summary>
public static string Layout_English {
get {
return ResourceManager.GetString("Layout_English", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to German.
/// </summary>
public static string Layout_German {
get {
return ResourceManager.GetString("Layout_German", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Issues.
/// </summary>
public static string Layout_Issues {
get {
return ResourceManager.GetString("Layout_Issues", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Italian.
/// </summary>
public static string Layout_Italian {
get {
return ResourceManager.GetString("Layout_Italian", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Logout.
/// </summary>
public static string Layout_Logout {
get {
return ResourceManager.GetString("Layout_Logout", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Portuguese.
/// </summary>
public static string Layout_Portuguese {
get {
return ResourceManager.GetString("Layout_Portuguese", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Requests.
/// </summary>
public static string Layout_Requests {
get {
return ResourceManager.GetString("Layout_Requests", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Search.
/// </summary>
public static string Layout_Search {
get {
return ResourceManager.GetString("Layout_Search", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Settings.
/// </summary>
public static string Layout_Settings {
get {
return ResourceManager.GetString("Layout_Settings", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Spanish.
/// </summary>
public static string Layout_Spanish {
get {
return ResourceManager.GetString("Layout_Spanish", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Swedish.
/// </summary>
public static string Layout_Swedish {
get {
return ResourceManager.GetString("Layout_Swedish", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Plex Requests.
/// </summary>
public static string Layout_Title {
get {
return ResourceManager.GetString("Layout_Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to There is a new update available! Click.
/// </summary>
public static string Layout_UpdateAvailablePart1 {
get {
return ResourceManager.GetString("Layout_UpdateAvailablePart1", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Here!.
/// </summary>
public static string Layout_UpdateAvailablePart2 {
get {
return ResourceManager.GetString("Layout_UpdateAvailablePart2", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Want to watch a movie or tv show but it&apos;s not currently on Plex?
/// Login below with your Plex.tv username and password!.

@ -144,4 +144,58 @@
<data name="Javascript_Success" xml:space="preserve">
<value>Fuldført</value>
</data>
<data name="Layout_Title" xml:space="preserve">
<value>Plex Requests</value>
</data>
<data name="Layout_Search" xml:space="preserve">
<value>Søg</value>
</data>
<data name="Layout_Requests" xml:space="preserve">
<value>Anmodninger</value>
</data>
<data name="Layout_Issues" xml:space="preserve">
<value>Issues</value>
</data>
<data name="Layout_Donate" xml:space="preserve">
<value>STØT</value>
</data>
<data name="Layout_Admin" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Layout_Settings" xml:space="preserve">
<value>Indstillinger</value>
</data>
<data name="Layout_ChangePassword" xml:space="preserve">
<value>Skift adgangskode</value>
</data>
<data name="Layout_Logout" xml:space="preserve">
<value>Log ud</value>
</data>
<data name="Layout_UpdateAvailablePart1" xml:space="preserve">
<value>Der er en ny opdatering tilgængelig! Klik!</value>
</data>
<data name="Layout_English" xml:space="preserve">
<value>Dansk</value>
</data>
<data name="Layout_Spanish" xml:space="preserve">
<value>Spansk</value>
</data>
<data name="Layout_German" xml:space="preserve">
<value>Tysk</value>
</data>
<data name="Layout_Danish" xml:space="preserve">
<value>Dansk</value>
</data>
<data name="Layout_Portuguese" xml:space="preserve">
<value>Portugisisk</value>
</data>
<data name="Layout_Swedish" xml:space="preserve">
<value>Swedish</value>
</data>
<data name="Layout_Italian" xml:space="preserve">
<value>Italiensk</value>
</data>
<data name="Layout_UpdateAvailablePart2" xml:space="preserve">
<value>her</value>
</data>
</root>

@ -144,4 +144,58 @@
<data name="Javascript_Success" xml:space="preserve">
<value>Erfolg</value>
</data>
<data name="Layout_Title" xml:space="preserve">
<value>Plex Requests</value>
</data>
<data name="Layout_Search" xml:space="preserve">
<value>Suche!</value>
</data>
<data name="Layout_Requests" xml:space="preserve">
<value>Anfragen</value>
</data>
<data name="Layout_Issues" xml:space="preserve">
<value>Probleme</value>
</data>
<data name="Layout_Donate" xml:space="preserve">
<value>Spenden</value>
</data>
<data name="Layout_Admin" xml:space="preserve">
<value>Verwaltung</value>
</data>
<data name="Layout_Settings" xml:space="preserve">
<value>Einstellungen</value>
</data>
<data name="Layout_ChangePassword" xml:space="preserve">
<value>Passwort ändern</value>
</data>
<data name="Layout_Logout" xml:space="preserve">
<value>Ausloggen</value>
</data>
<data name="Layout_UpdateAvailablePart1" xml:space="preserve">
<value>Es gibt ein neues Update verfügbar! Klicken!</value>
</data>
<data name="Layout_English" xml:space="preserve">
<value>Englisch</value>
</data>
<data name="Layout_Spanish" xml:space="preserve">
<value>Spanisch</value>
</data>
<data name="Layout_German" xml:space="preserve">
<value>Deutsch</value>
</data>
<data name="Layout_Danish" xml:space="preserve">
<value>Dänisch</value>
</data>
<data name="Layout_Portuguese" xml:space="preserve">
<value>Portugiesisch</value>
</data>
<data name="Layout_Swedish" xml:space="preserve">
<value>Schwedisch</value>
</data>
<data name="Layout_Italian" xml:space="preserve">
<value>ITALIENISCH</value>
</data>
<data name="Layout_UpdateAvailablePart2" xml:space="preserve">
<value>hier</value>
</data>
</root>

@ -144,4 +144,58 @@
<data name="Javascript_Success" xml:space="preserve">
<value>CRÍTICOS</value>
</data>
<data name="Layout_Title" xml:space="preserve">
<value>Plex Requests</value>
</data>
<data name="Layout_Search" xml:space="preserve">
<value>¡Buscar!</value>
</data>
<data name="Layout_Requests" xml:space="preserve">
<value>Peticiones</value>
</data>
<data name="Layout_Issues" xml:space="preserve">
<value>Problemas</value>
</data>
<data name="Layout_Donate" xml:space="preserve">
<value>«¡Dona!»</value>
</data>
<data name="Layout_Admin" xml:space="preserve">
<value>Administración</value>
</data>
<data name="Layout_Settings" xml:space="preserve">
<value>Ajustes</value>
</data>
<data name="Layout_ChangePassword" xml:space="preserve">
<value>Cambiar contraseña</value>
</data>
<data name="Layout_Logout" xml:space="preserve">
<value>Desconectarse</value>
</data>
<data name="Layout_UpdateAvailablePart1" xml:space="preserve">
<value>Hay una nueva actualización disponible! ¡Hacer clic!</value>
</data>
<data name="Layout_English" xml:space="preserve">
<value>Inglés</value>
</data>
<data name="Layout_Spanish" xml:space="preserve">
<value>Spanish</value>
</data>
<data name="Layout_German" xml:space="preserve">
<value>German</value>
</data>
<data name="Layout_Danish" xml:space="preserve">
<value>Danés</value>
</data>
<data name="Layout_Portuguese" xml:space="preserve">
<value>Portugués</value>
</data>
<data name="Layout_Swedish" xml:space="preserve">
<value>Sueco</value>
</data>
<data name="Layout_Italian" xml:space="preserve">
<value>Italiano</value>
</data>
<data name="Layout_UpdateAvailablePart2" xml:space="preserve">
<value>aquí</value>
</data>
</root>

@ -144,4 +144,58 @@
<data name="Javascript_Success" xml:space="preserve">
<value>Succès</value>
</data>
<data name="Layout_Title" xml:space="preserve">
<value>Plex Requests</value>
</data>
<data name="Layout_Search" xml:space="preserve">
<value>Chercher</value>
</data>
<data name="Layout_Requests" xml:space="preserve">
<value>Requêtes</value>
</data>
<data name="Layout_Issues" xml:space="preserve">
<value>Sortie</value>
</data>
<data name="Layout_Donate" xml:space="preserve">
<value>FAIRE UN DON</value>
</data>
<data name="Layout_Admin" xml:space="preserve">
<value>d'Administration</value>
</data>
<data name="Layout_Settings" xml:space="preserve">
<value>Paramètres</value>
</data>
<data name="Layout_ChangePassword" xml:space="preserve">
<value>Modifier le mot de passe</value>
</data>
<data name="Layout_Logout" xml:space="preserve">
<value>Déconnexion</value>
</data>
<data name="Layout_UpdateAvailablePart1" xml:space="preserve">
<value>Il y a une nouvelle mise à jour disponible! Cliquez!</value>
</data>
<data name="Layout_English" xml:space="preserve">
<value>Anglais</value>
</data>
<data name="Layout_Spanish" xml:space="preserve">
<value>Espagnol</value>
</data>
<data name="Layout_German" xml:space="preserve">
<value>Allemand</value>
</data>
<data name="Layout_Danish" xml:space="preserve">
<value>Danois</value>
</data>
<data name="Layout_Portuguese" xml:space="preserve">
<value>Portugais</value>
</data>
<data name="Layout_Swedish" xml:space="preserve">
<value>Suédois (homonymie)</value>
</data>
<data name="Layout_Italian" xml:space="preserve">
<value>Italien</value>
</data>
<data name="Layout_UpdateAvailablePart2" xml:space="preserve">
<value>ici</value>
</data>
</root>

@ -144,4 +144,58 @@
<data name="Javascript_Success" xml:space="preserve">
<value>Successo</value>
</data>
<data name="Layout_Title" xml:space="preserve">
<value>Plex Requests</value>
</data>
<data name="Layout_UpdateAvailablePart1" xml:space="preserve">
<value>C'è un nuovo aggiornamento disponibile! Clic!</value>
</data>
<data name="Layout_Search" xml:space="preserve">
<value>Cerca!</value>
</data>
<data name="Layout_Requests" xml:space="preserve">
<value>Requests</value>
</data>
<data name="Layout_Issues" xml:space="preserve">
<value>problemi quantificati</value>
</data>
<data name="Layout_Donate" xml:space="preserve">
<value>Donazione</value>
</data>
<data name="Layout_Admin" xml:space="preserve">
<value>admin</value>
</data>
<data name="Layout_Settings" xml:space="preserve">
<value>Impostazioni</value>
</data>
<data name="Layout_ChangePassword" xml:space="preserve">
<value>Modifica password</value>
</data>
<data name="Layout_Logout" xml:space="preserve">
<value>LOGOUT</value>
</data>
<data name="Layout_English" xml:space="preserve">
<value>Inglese!</value>
</data>
<data name="Layout_Spanish" xml:space="preserve">
<value>Spagnolo</value>
</data>
<data name="Layout_German" xml:space="preserve">
<value>Tedesco</value>
</data>
<data name="Layout_Danish" xml:space="preserve">
<value>Danese</value>
</data>
<data name="Layout_Portuguese" xml:space="preserve">
<value>Portoghese</value>
</data>
<data name="Layout_Swedish" xml:space="preserve">
<value>Svedese</value>
</data>
<data name="Layout_Italian" xml:space="preserve">
<value>Italiano</value>
</data>
<data name="Layout_UpdateAvailablePart2" xml:space="preserve">
<value>Here</value>
</data>
</root>

@ -144,4 +144,58 @@
<data name="Javascript_Success" xml:space="preserve">
<value>Sucesso</value>
</data>
<data name="Layout_Title" xml:space="preserve">
<value>Plex Requests</value>
</data>
<data name="Layout_Search" xml:space="preserve">
<value>Buscar</value>
</data>
<data name="Layout_Requests" xml:space="preserve">
<value>DOS PEDIDOS</value>
</data>
<data name="Layout_Issues" xml:space="preserve">
<value>Issues</value>
</data>
<data name="Layout_Donate" xml:space="preserve">
<value>Doar!</value>
</data>
<data name="Layout_Admin" xml:space="preserve">
<value>Administrativo</value>
</data>
<data name="Layout_Settings" xml:space="preserve">
<value>Configurações</value>
</data>
<data name="Layout_ChangePassword" xml:space="preserve">
<value>Alterar Senha</value>
</data>
<data name="Layout_Logout" xml:space="preserve">
<value>SAIR</value>
</data>
<data name="Layout_UpdateAvailablePart1" xml:space="preserve">
<value>Há uma nova atualização disponível! Clique!</value>
</data>
<data name="Layout_English" xml:space="preserve">
<value>Inglês</value>
</data>
<data name="Layout_Spanish" xml:space="preserve">
<value>Espanhol</value>
</data>
<data name="Layout_German" xml:space="preserve">
<value>Alemão</value>
</data>
<data name="Layout_Danish" xml:space="preserve">
<value>Dinamarquês</value>
</data>
<data name="Layout_Portuguese" xml:space="preserve">
<value>Português</value>
</data>
<data name="Layout_Swedish" xml:space="preserve">
<value>SUECO</value>
</data>
<data name="Layout_Italian" xml:space="preserve">
<value>Italiano</value>
</data>
<data name="Layout_UpdateAvailablePart2" xml:space="preserve">
<value>aqui</value>
</data>
</root>

@ -125,4 +125,58 @@
<data name="Javascript_Success" xml:space="preserve">
<value>Success!</value>
</data>
<data name="Layout_Title" xml:space="preserve">
<value>Plex Requests</value>
</data>
<data name="Layout_Search" xml:space="preserve">
<value>Search</value>
</data>
<data name="Layout_Requests" xml:space="preserve">
<value>Requests</value>
</data>
<data name="Layout_Issues" xml:space="preserve">
<value>Issues</value>
</data>
<data name="Layout_Donate" xml:space="preserve">
<value>Donate</value>
</data>
<data name="Layout_Admin" xml:space="preserve">
<value>Admin</value>
</data>
<data name="Layout_Settings" xml:space="preserve">
<value>Settings</value>
</data>
<data name="Layout_ChangePassword" xml:space="preserve">
<value>Change Password</value>
</data>
<data name="Layout_Logout" xml:space="preserve">
<value>Logout</value>
</data>
<data name="Layout_UpdateAvailablePart1" xml:space="preserve">
<value>There is a new update available! Click</value>
</data>
<data name="Layout_English" xml:space="preserve">
<value>English</value>
</data>
<data name="Layout_Spanish" xml:space="preserve">
<value>Spanish</value>
</data>
<data name="Layout_German" xml:space="preserve">
<value>German</value>
</data>
<data name="Layout_Danish" xml:space="preserve">
<value>Danish</value>
</data>
<data name="Layout_Portuguese" xml:space="preserve">
<value>Portuguese</value>
</data>
<data name="Layout_Swedish" xml:space="preserve">
<value>Swedish</value>
</data>
<data name="Layout_Italian" xml:space="preserve">
<value>Italian</value>
</data>
<data name="Layout_UpdateAvailablePart2" xml:space="preserve">
<value>Here!</value>
</data>
</root>

@ -144,4 +144,58 @@
<data name="Javascript_Success" xml:space="preserve">
<value>Lyckades</value>
</data>
<data name="Layout_Title" xml:space="preserve">
<value>Plex Requests</value>
</data>
<data name="Layout_Search" xml:space="preserve">
<value>Sök!</value>
</data>
<data name="Layout_Requests" xml:space="preserve">
<value>Begäran</value>
</data>
<data name="Layout_Issues" xml:space="preserve">
<value>Frågor!</value>
</data>
<data name="Layout_Donate" xml:space="preserve">
<value>Donera</value>
</data>
<data name="Layout_Admin" xml:space="preserve">
<value>admin</value>
</data>
<data name="Layout_Settings" xml:space="preserve">
<value>Inställningar</value>
</data>
<data name="Layout_ChangePassword" xml:space="preserve">
<value>Byt lösenord</value>
</data>
<data name="Layout_Logout" xml:space="preserve">
<value>Logga ut</value>
</data>
<data name="Layout_UpdateAvailablePart1" xml:space="preserve">
<value>Det finns en ny uppdatering tillgänglig! Klick!</value>
</data>
<data name="Layout_English" xml:space="preserve">
<value>Svenska</value>
</data>
<data name="Layout_Spanish" xml:space="preserve">
<value>Spanska</value>
</data>
<data name="Layout_German" xml:space="preserve">
<value>Tyska</value>
</data>
<data name="Layout_Danish" xml:space="preserve">
<value>Danska</value>
</data>
<data name="Layout_Portuguese" xml:space="preserve">
<value>Portugisiska</value>
</data>
<data name="Layout_Swedish" xml:space="preserve">
<value>Svenska</value>
</data>
<data name="Layout_Italian" xml:space="preserve">
<value>Italienska</value>
</data>
<data name="Layout_UpdateAvailablePart2" xml:space="preserve">
<value>Här.”</value>
</data>
</root>

@ -2,6 +2,7 @@
@using Nancy.Session
@using PlexRequests.UI.Helpers
@using PlexRequests.UI.Models
@using PlexRequests.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase
@{
var baseUrl = Html.GetBaseUrl();
@ -14,7 +15,7 @@
<html>
<div hidden="hidden" id="baseUrl">@baseUrl.ToHtmlString()</div>
<head>
<title>Plex Requests</title>
<title>@UI.Layout_Title</title>
<!-- Styles -->
<meta name="viewport" content="width=device-width, initial-scale=1">
@Html.LoadAnalytics()
@ -32,17 +33,17 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="@url/search">Plex Requests</a>
<a class="navbar-brand" href="@url/search">@UI.Layout_Title</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
@Html.GetNavbarUrl(Context, "/search", "Search", "search")
@Html.GetNavbarUrl(Context, "/requests", "Requests", "plus-circle")
@Html.GetNavbarUrl(Context, "/issues", "Issues", "exclamation", "<span id=\"issueCount\"></span>")
@Html.GetNavbarUrl(Context, "/search", UI.Layout_Search, "search")
@Html.GetNavbarUrl(Context, "/requests", UI.Layout_Requests, "plus-circle")
@Html.GetNavbarUrl(Context, "/issues", UI.Layout_Issues, "exclamation", "<span id=\"issueCount\"></span>")
@if (Context.CurrentUser.IsAuthenticated()) // TODO replace with IsAdmin
{
<li><a href="https://www.paypal.me/PlexRequestsNet" target="_blank"><i class="fa fa-heart" style="color: red"></i> Donate</a></li>
<li><a href="https://www.paypal.me/PlexRequestsNet" target="_blank"><i class="fa fa-heart" style="color: red"></i> @UI.Layout_Donate</a></li>
}
</ul>
<ul class="nav navbar-nav navbar-right">
@ -56,20 +57,33 @@
else
{
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> Admin <span class="caret"></span></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> @UI.Layout_Admin <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="@url/admin"><i class="fa fa-cog"></i> Settings</a></li>
<li><a href="@url/changepassword"><i class="fa fa-key"></i> Change password</a></li>
<li><a href="@url/admin"><i class="fa fa-cog"></i> @UI.Layout_Settings</a></li>
<li><a href="@url/changepassword"><i class="fa fa-key"></i> @UI.Layout_ChangePassword</a></li>
<li class="divider"></li>
<li><a href="@url/logout"><i class="fa fa-sign-out"></i> Logout</a></li>
<li><a href="@url/logout"><i class="fa fa-sign-out"></i> @UI.Layout_Logout</a></li>
</ul>
</li>
}
@if (Context.Request.Session[SessionKeys.UsernameKey] != null)
{
<li><a href="@url/userlogin/logout"><i class="fa fa-sign-out"></i> Logout</a></li>
<li><a href="@url/userlogin/logout"><i class="fa fa-sign-out"></i> @UI.Layout_Logout</a></li>
}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-language" aria-hidden="true"></i></a>
<ul class="dropdown-menu" role="menu">
<li><a href="@url/culture?l=en&u=@Context.Request.Path">@UI.Layout_English</a></li>
<li><a href="@url/culture?l=es&u=@Context.Request.Path">@UI.Layout_Spanish</a></li>
<li><a href="@url/culture?l=de&u=@Context.Request.Path">@UI.Layout_German</a></li>
<li><a href="@url/culture?l=da&u=@Context.Request.Path">@UI.Layout_Danish</a></li>
<li><a href="@url/culture?l=pt&u=@Context.Request.Path">@UI.Layout_Portuguese</a></li>
<li><a href="@url/culture?l=sv&u=@Context.Request.Path">@UI.Layout_Swedish</a></li>
<li><a href="@url/culture?l=it&u=@Context.Request.Path">@UI.Layout_Italian</a></li>
</ul>
<li />
</ul>
</div>
</div>
@ -101,7 +115,7 @@
success: function (response) {
if (response.updateAvailable) {
var status = createBaseUrl(urlBase, '/admin/status');
$('#updateAvailable').html("<i class='fa fa-cloud-download' aria-hidden='true'></i> There is a new update available! Click <a style='color: white' href='" + status + "'>Here!</a>");
$('#updateAvailable').html("<i class='fa fa-cloud-download' aria-hidden='true'></i> @UI.Layout_UpdateAvailablePart1 <a style='color: white' href='" + status + "'>@UI.Layout_UpdateAvailablePart2</a>");
$('#updateAvailable').removeAttr("hidden");
$('body').addClass('update-available');
}

@ -1,5 +1,5 @@
@using PlexRequests.Resources
@using PlexRequests.UI.Helpers
@using PlexRequests.UI.Helpers
@using PlexRequests.UI.Resources
<div class="home">
<h1>@UI.UserLogin_Title</h1>
<div>

@ -37,8 +37,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequests.Updater", "Ple
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequests.Helpers.Tests", "PlexRequests.Helpers.Tests\PlexRequests.Helpers.Tests.csproj", "{0E6395D3-B074-49E8-898D-0EB99E507E0E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequests.Resources", "PlexRequests.Resources\PlexRequests.Resources.csproj", "{9C266462-BE82-461A-87A2-9EDCFB95D732}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -97,10 +95,6 @@ Global
{0E6395D3-B074-49E8-898D-0EB99E507E0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E6395D3-B074-49E8-898D-0EB99E507E0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E6395D3-B074-49E8-898D-0EB99E507E0E}.Release|Any CPU.Build.0 = Release|Any CPU
{9C266462-BE82-461A-87A2-9EDCFB95D732}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C266462-BE82-461A-87A2-9EDCFB95D732}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C266462-BE82-461A-87A2-9EDCFB95D732}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C266462-BE82-461A-87A2-9EDCFB95D732}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Loading…
Cancel
Save