Survey Forums

HomeHomeSurvey Project ...Survey Project ...DevelopmentDevelopmentVery tiny localization bugVery tiny localization bug
Previous
 
Next
New Post
6/29/2010 12:39 AM
 

I've found very minor bug when using language xml file,

in page \trunk\NSurveyAdmin\UserControls\SecurityAddInOptionsControl.ascx
regarding the link button DisableAddInLinkButton

 

the following function is called from Page_Load function:

 

private void LocalizePage()
{
     DeleteButton.Text = ((
PageBase)Page).GetPageResource("DeleteButton");
     InsertAddInHyperLink.Text = ((
PageBase)Page).GetPageResource("InsertAddInHyperLink");
     if (SecurityAddIn != null)
     {
           if (SecurityAddIn.Disabled)
           {
                AddInDisabledLabel.Text = ((
PageBase)Page).GetPageResource("AddInDisabledLabel");
                DisableAddInLinkButton.Text = ((
PageBase)Page).GetPageResource("EnableAddInLinkButton");
           }
           else
           {
                DisableAddInLinkButton.Text = ((
PageBase)Page).GetPageResource("DisableAddInLinkButton");
           }
     }
}


When the SecurityAddIn is null the function never get trough the first if condition,
therefor never getting to DisableAddInLinkButton.Text = ((PageBase)Page).GetPageResource("DisableAddInLinkButton");
which translate the DisableAddInLinkButton text so the text remain always "Disable".
I think you should add another line before first if so the function will look like this:
 
private void LocalizePage()
{
     DeleteButton.Text = ((
PageBase)Page).GetPageResource("DeleteButton");
     InsertAddInHyperLink.Text = ((
PageBase)Page).GetPageResource("InsertAddInHyperLink");
     DisableAddInLinkButton.Text = ((PageBase)Page).GetPageResource("DisableAddInLinkButton");
     if (SecurityAddIn != null)
     {
           if (SecurityAddIn.Disabled)
           {
                AddInDisabledLabel.Text = ((
PageBase)Page).GetPageResource("AddInDisabledLabel");
                DisableAddInLinkButton.Text = ((
PageBase)Page).GetPageResource("EnableAddInLinkButton");
           }
           //else
           //{
           //     DisableAddInLinkButton.Text = ((
PageBase)Page).GetPageResource("DisableAddInLinkButton");
           //}
     }
}
 
And then you can remove the else option in the function because it is redundant...
Please let me know what you think...
Eran.

 
New Post
7/5/2010 11:50 PM
 

Hello,

Thank you for sharing this, you're right about the bug and your proposed solution works correct. We've added it to the 1.2.2 release which we're testing right now. Hope to get it out a.s.a.p.
 

 
Previous
 
Next
HomeHomeSurvey Project ...Survey Project ...DevelopmentDevelopmentVery tiny localization bugVery tiny localization bug