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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesLocalize a Custom Profile PropertyLocalize a Custom Profile Property
Previous
 
Next
New Post
8/11/2010 3:01 PM
 
I am attempting to get the localized, "Custom User Property" in a module that I am developing.

The background is that I created a Category named "Discipline" and within those categories I created five different Custom User Properties for example, Property_1, Property_2, Property_3…  I then localized them in DNN to My Custom Property 1, My Custom Property 2, My Custom Property 3…

This is my futile attempt to get the localized text (please ignore what you will it is composed for snippits around the internet so I don't know if I am on the right track or not).


Dim
myProps As DotNetNuke.Entities.Profile.ProfilePropertyDefinitionCollection = DotNetNuke.Entities.Profile.ProfileController.GetPropertyDefinitionsByCategory(PortalId, "Discipline")
dim ResourceFile As String = "~/DesktopModules/Admin/Security/App_LocalResources/Profile.ascx"
For Each x As DotNetNuke.Entities.Profile.ProfilePropertyDefinition In myProps
    Dim k = Localization.GetString(x.PropertyName, ResourceFile, System.Threading.Thread.CurrentThread.CurrentCulture.Name)
Next




 
New Post
8/11/2010 7:05 PM
 
Hello,
as it's a profile property you only have to add it to the relevant resource file i.e desktopModules/Admin/Security/App_localresources/profile.ascx.resx (please note that the file is the resx one - resx files store resources for their associated control). If you place the text in the right file the localization code in the core will do the localization automatically for you. You typically only use the GetString methods when you want to load something in an arbitrary fashion (note: in many cases it's better to see the resourcepath in the constructor)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/15/2010 4:05 PM
 

Cathal,
Thanks for your reply but the problem was that I had to get the Resource File from the Profile control because that is where the Property Definitions were. Anyway, I may not have explained myself well enough, however, I THINK that I found the solution inside DotNetNuke its self. All I had to do was change the line that read:
Dim k = Localization.GetString(x.PropertyName, ResourceFile, System.Threading.Thread.CurrentThread.CurrentCulture.Name)
to
Dim k = Localization.GetString("ProfileProperties_" +  x.PropertyName, ResourceFile, System.Threading.Thread.CurrentThread.CurrentCulture.Name)

Again, Thanks for your reply.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesLocalize a Custom Profile PropertyLocalize a Custom Profile Property


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