Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...localizing ListItem, CheckBoxList, ETClocalizing ListItem, CheckBoxList, ETC
Previous
 
Next
New Post
1/11/2008 9:57 AM
 

Hey everyone new to DNN and I'm attempting to convert some of my controls to DNN.

I read through all the documentation and I can't seem to find why my ListBox and CheckBoxList ListItem's are not localizing correctly in DNN4. The DropDownList and RadioButtonList localize correctly but not the ListBox and CheckBoxList.

I can't find anything in the forums through searching and nothing directly references to it in any of the documentation. Alas even my google search yeild no findings so it must be something easy that I am just doing incorrectly.

<asp:ListBox ID="ListBox1" runat="server" Rows="1">
<asp:ListItem resourcekey="TestResults" Value="1">Text</asp:ListItem> (Doesn't Work)
</asp:ListBox>


<asp:DropDownList ID="DropDownList1" runat="server">
 <asp:ListItem resourcekey="TestResults" Value="1">Text</asp:ListItem> (Works)
</asp:DropDownList>

 <data name="TestResults.Text">
  <value>Localized Text</value>
 </data>

Any help and direction would be appreciated

-Josh

 

 
New Post
1/11/2008 11:03 AM
 

Hi Josh,

Oddly enough, there is no DNN routine to do this.  Here is code I use:

public void LocalizeCheckListBox( CheckBoxList ctl, string resourceFile )
{
    foreach (ListItem item in ctl.Items)
    {
        string key = item.Attributes["resourcekey"];
        if (key != null)
        {
            item.Text = Localization.GetString(key, resourceFile);
        }
    }
}

 
New Post
1/11/2008 11:16 AM
 

It appears that the ProcessControl method of the DotNetNuke.Framework.PageBase which is where localization of controls on the page occurs specifically targets DropDownList and RadioButtonList as it iterates through their collection of ListItem objects but does not provide similar processing for other types of list controls such as ListBox and CheckBoxList.  The ProcessControl method also tries to localize any child controls, but since the ListItem class derives from System.Object rather than from System.Web.UI.WebControls.WebControl, this fails also.

I did not follow the code through completely and may be missing something, but based on a quick look suggest that you add this to Gemini as either a bug or feature request. In the meantime, you would have to provide your own localization by iterating through each ListItem of your ListBox or CheckBoxList and using the DotNetNuke.Services.Localization.Localization.GetString method to obtain the localized strings. When I've used ListBox and CheckBoxList controls, I've always pulled the values from the database so had not run into this problem before.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/13/2008 7:32 AM
 

Thanks for the information guys. I will have to find another way to do my checkboxlists as I have far too may to us your suggestion digMike. The control that I am attempting to convert has over 100 CheckBoxLists spanning 6 different panels some hidden and some not based on the viewers progress.

I really appreciate you guy responding so quickly I didn't expect I would get an answer this quickly. Thanks Again

-Josh

 
New Post
1/13/2008 8:21 AM
 

please log this as enhancement request into the public issue tracker at support.dotnetnuke.com. Thank you.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...localizing ListItem, CheckBoxList, ETClocalizing ListItem, CheckBoxList, ETC


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out