Improved loc

This commit is contained in:
Rick Falkvinge
2017-10-17 16:55:19 +02:00
parent a3302dd411
commit d784c9e65e
2 changed files with 70 additions and 28 deletions
+12 -12
View File
@@ -298,17 +298,17 @@
if (msg.d != true) {
isValid = false;
$('#<%= TextDateOfBirth.ClientID %>').addClass("entryError");
alertify.error("<asp:Literal runat="server" ID="LiteralErrorDate" />");
alertify.error(SwarmopsJS.unescape("<%=Localize_ErrorDate%>");
$('#<%=this.TextDateOfBirth.ClientID %>').focus();
}
}
});
}
isValid = ValidateTextField('#<%= TextCity.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorCity" />") && isValid;
isValid = ValidateTextField('#<%= TextStreet1.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorStreet" />") && isValid;
isValid = ValidateTextField('#<%= TextMail.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorMail" />") && isValid;
isValid = ValidateTextField('#<%= TextName.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorName" />") && isValid; // TODO: Actually validate geography?
isValid = ValidateTextField('#<%= TextCity.ClientID %>', SwarmopsJS.unescape("<%=Localize_ErrorCity%>") && isValid;
isValid = ValidateTextField('#<%= TextStreet1.ClientID %>', SwarmopsJS.unescape("<%=Localize_ErrorStreet%>") && isValid;
isValid = ValidateTextField('#<%= TextMail.ClientID %>', SwarmopsJS.unescape("<%=Localize_ErrorMail%>") && isValid;
isValid = ValidateTextField('#<%= TextName.ClientID %>', SwarmopsJS.unescape("<%=Localize_ErrorName%>") && isValid; // TODO: Actually validate geography?
if (isValid) {
@@ -326,7 +326,7 @@
if (msg.d.Success != true) {
isValid = false;
$('#<%= this.TextMail.ClientID %>').addClass("entryError");
alertify.error("<asp:Literal runat="server" ID="LiteralErrorMailExists" />");
alertify.error(SwarmopsJS.unescape("<%=Localize_ErrorMailExists%>");
$('#<%=this.TextMail.ClientID %>').focus();
}
}
@@ -373,8 +373,8 @@
$('#wizard').smartWizard({
transitionEffect: 'fade',
labelNext: "<asp:Literal ID='LiteralWizardNextButton' runat='server' />",
labelFinish: "<asp:Literal ID='LiteralWizardFinishButton' runat='server' />",
labelNext: SwarmopsJS.unescape("<%=Localize_WizardNext%>"),
labelFinish: SwarmopsJS.unescape("<%=Localize_WizardFinish%>"),
keyNavigation: false,
onLeaveStep: leaveAStepCallback,
onFinish: onFinishCallback
@@ -444,12 +444,12 @@
}
} else if (stepNumber == 3) {
isValid = ValidateTextField('#<%= TextPassword1.ClientID %>', "<asp:Literal runat='server' ID='LiteralErrorNeedPassword' />");
isValid = ValidateTextField('#<%= TextPassword1.ClientID %>', SwarmopsJS.unescape("<%=Localize_ErrorNeedPassword%>");
if (isValid) {
if ($('#<%=TextPassword1.ClientID%>').val() != $('#<%=TextPassword2.ClientID%>').val()) {
isValid = false;
alertify.error("<asp:Literal runat='server' ID='LiteralErrorPasswordMismatch' />");
alertify.error(SwarmopsJS.unescape("<%=Localize_ErrorPasswordMismatch%>"));
$('#<%=TextPassword1.ClientID%>,#<%=TextPassword2.ClientID%>').addClass("entryError");
$('#<%=TextPassword1.ClientID%>').focus();
}
@@ -466,7 +466,7 @@
var selectedOption = $('input:radio[name="ActivationLevel"]:checked').val();
if (selectedOption === undefined) {
isValid = false;
alertify.error("<asp:Literal runat='server' ID='LiteralErrorSelectActivationLevel' />");
alertify.error(SwarmopsJS.unescape("<%=Localize_ErrorSelectActivationLevel%>"));
}
if (selectedOption == "RadioActivationVolunteer" && isValid) {
@@ -503,7 +503,7 @@
selectedPositions = $('#tableVolunteerPositions').datagrid('getChecked');
if (selectedPositions.length == 0) {
isValid = false;
alertify.error("<asp:Literal runat='server' ID='LiteralErrorSelectVolunteerPosition' />");
alertify.error(SwarmopsJS.unescape("<%=Localize_ErrorSelectVolunteerPosition%>"));
}
} else {
// If we should just skip step 5
+58 -16
View File
@@ -130,19 +130,7 @@ namespace Swarmops.Frontend.Pages.Public
private void Localize()
{
this.LabelSidebarActionsHeader.Text =
this.LiteralErrorCity.Text = Resources.Pages.Swarm.AddPerson_ErrorCity;
this.LiteralErrorMail.Text = Resources.Pages.Swarm.AddPerson_ErrorMail;
this.LiteralErrorName.Text = Resources.Pages.Swarm.AddPerson_ErrorName;
this.LiteralErrorStreet.Text = Resources.Pages.Swarm.AddPerson_ErrorStreet;
this.LiteralErrorDate.Text = Resources.Pages.Swarm.AddPerson_ErrorDate;
this.LiteralErrorNeedPassword.Text = Resources.Pages.Public.Signup_Error_NeedPassword;
this.LiteralErrorPasswordMismatch.Text = Resources.Pages.Public.Signup_Error_PasswordMismatch;
this.LiteralErrorSelectActivationLevel.Text = Resources.Pages.Public.Signup_Error_SelectActivationLevel;
this.LiteralErrorSelectVolunteerPosition.Text = Resources.Pages.Public.Signup_Error_SelectPosition;
this.LiteralErrorMailExists.Text = Resources.Pages.Public.Signup_Error_MailExists;
this.LabelSidebarActionsHeader.Text = Resources.Global.Sidebar_Actions;
this.LabelWelcomeHeader.Text = String.Format (Resources.Pages.Public.Signup_Welcome, Organization.Name);
this.LabelHeader.Text = String.Format(Resources.Pages.Public.Signup_SigningUp, Organization.Name).ToUpperInvariant();
@@ -208,9 +196,6 @@ namespace Swarmops.Frontend.Pages.Public
this.LiteralBodyAttributes.Text = @"dir='rtl' class='rtl'";
}
this.LiteralWizardNextButton.Text = Resources.Global.Global_WizardNext;
this.LiteralWizardFinishButton.Text = Resources.Global.Global_WizardFinish;
this.LabelSidebarActionsHeader.Text = Resources.Pages.Public.Signup_FeeHeader;
// if (this.Organization.MembershipFee == 0 && this.Organization.MembershipRenewalFee == 0)
this.LabelSidebarActionsContent.Text = String.Format (Resources.Pages.Public.Signup_NoFeeText,
@@ -355,5 +340,62 @@ namespace Swarmops.Frontend.Pages.Public
return new AjaxCallResult { Success = false };
}
// ---- LOCALIZATION SUPPORT BELOW ----
public string Localize_ErrorCity
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorCity); }
}
public string Localize_ErrorMail
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorMail); }
}
public string Localize_ErrorName
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorName); }
}
public string Localize_ErrorStreet
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorStreet); }
}
public string Localize_ErrorDate
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorDate); }
}
public string Localize_ErrorNeedPassword
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Public.Signup_Error_NeedPassword); }
}
public string Localize_ErrorPasswordMismatch
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Public.Signup_Error_PasswordMismatch); }
}
public string Localize_ErrorSelectActivationLevel
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Public.Signup_Error_SelectActivationLevel); }
}
public string Localize_ErrorSelectVolunteerPosition
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Public.Signup_Error_SelectPosition); }
}
public string Localize_ErrorMailExists
{
get { return CommonV5.JavascriptEscape(Resources.Pages.Public.Signup_Error_MailExists); }
}
public string Localize_WizardNext
{
get { return CommonV5.JavascriptEscape(Resources.Global.Global_WizardNext); }
}
public string Localize_WizardFinish
{
get { return CommonV5.JavascriptEscape(Resources.Global.Global_WizardFinish); }
}
}
}