Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Commit

Permalink
Update config with titel for #29 - Fix En-En local. bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidy committed Jan 30, 2020
1 parent 1804cd6 commit ed93422
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
21 changes: 19 additions & 2 deletions privacyIDEAADFSProvider/AdapterPresentationForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.IdentityServer.Web.Authentication.External;
using System.Diagnostics;

namespace privacyIDEAADFSProvider
{
Expand Down Expand Up @@ -27,7 +28,10 @@ public string GetFormHtml(int lcid)
{
foreach (ADFSinterface adfsui in inter)
{
if (adfsui.LICD == lcid.ToString())
#if DEBUG
Debug.WriteLine("LICD: "+adfsui.LICD+" - "+ lcid.ToString());
#endif
if ((int)adfsui.LICD == (int)lcid)
{
errormessage = adfsui.errormessage;
wellcomemassage = adfsui.wellcomemessage;
Expand Down Expand Up @@ -64,7 +68,20 @@ public string GetFormPreRenderHtml(int lcid)
//returns the title string for the web page which presents the HTML form content to the end user
public string GetPageTitle(int lcid)
{
return "privacyIDEA OTP Adapter";
foreach (ADFSinterface adfsui in inter)
{
if ((int)adfsui.LICD == (int)lcid)
{
return adfsui.titel;
}
// fallback to EN-US if nothing is defined
else
{
return "privacyIDEA OTP Adapter";
}
}
// in case of failure
return "privacyIDEA OTP Adapter E";
}

}
Expand Down
18 changes: 16 additions & 2 deletions privacyIDEAADFSProvider/config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public partial class ADFSinterface

private string errormessageField;
private string wellcomemessageField;
private string lICDField;
private int lICDField;
private string titelField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
Expand Down Expand Up @@ -171,10 +172,23 @@ public string wellcomemessage
this.wellcomemessageField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string titel
{
get
{
return this.titelField;
}
set
{
this.titelField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string LICD
public int LICD
{
get
{
Expand Down
5 changes: 5 additions & 0 deletions privacyIDEAADFSProvider/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@
<adminuser></adminuser>
<adminpw></adminpw>

<!-- UI SECTION -->

<!--
For localization, please use the LCID see https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms912047(v=winembedded.10)
Example: EN-US = 1033, DE-DE = 1031, FR-FR = 1036, SP-SP = 1034
-->

<interface LICD="1033">
<errormessage>Login failed! Please try again!</errormessage>
<wellcomemessage>Please provide the one-time-password:</wellcomemessage>
<titel>privacyIDEA OTP Adapter - EN</titel>
</interface>
<interface LICD="1031">
<errormessage>Login fehlgeschlagen. Bitte versuchen Sie es erneut!</errormessage>
<wellcomemessage>Bitte geben Sie ihren PIN und OTP Token ein:</wellcomemessage>
<titel>privacyIDEA OTP Adapter - DE</titel>
</interface>
</server>

0 comments on commit ed93422

Please sign in to comment.