Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

DotNetNuke Marketplace
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Language Packs ...  programatic localization in DotNetNuke 4.0.1
Previous Previous
 
Next Next
New Post 2/1/2006 12:09 AM
User is offline Robert Iovan
3 posts
10th Ranked


programatic localization in DotNetNuke 4.0.1 
Hello I`m new to to his forum and I have a simple question:

I have a new module(an ascx page named "newpage.ascx")where I have a label named "lblNewLabel".

So far so good.

I want to display programatic a localizable text in that label from the "newpage.ascx.resx" in the App_LocalResources directory from that module. In the file newpage.ascx.resx I have the fields "lblNewLabel.Text" and "lblNewLabel.ToolTip"

I`ve tried with DotNetNuke.Services.Localization.Localization.GetString("lblNewLabel.Text") and with DotNetNuke.Services.Localization.Localization.GetString("lblNewLabel.Text") but it doesn`t work

Please help me. Thanks
 
New Post 2/1/2006 11:22 PM
User is offline Vicenç Masanas
1389 posts
www.disgrafic.com
6th Ranked








Re: programatic localization in DotNetNuke 4.0.1 
You have to add to that call the resource file:

GetString( key , LocalResourceFile)

LocalResourceFile is a property of PortalModuleBase that already points to the right resource file for each module.

You will get more information on this on the localization documentation.

Disgrafic.com
 
New Post 2/1/2006 11:23 PM
User is offline Peter Donker
179 posts
www.bring2mind.net
9th Ranked






Re: programatic localization in DotNetNuke 4.0.1 
It's a good idea to explicitly state where it should find the string. The GetString method is overloaded and also has signature:
GetString(Key, ResourceFile)
So use GetString("lblNewLabel", Me.LocalResourceFile) and it will retrieve "lblNewLabel.Text" from newpage.ascx.resx under App_LocalResources.

Peter

Peter Donker
bring2mind
Home of the Document Exchange, the professional document management solution for DNN
 
New Post 2/2/2006 10:25 PM
User is offline Robert Iovan
3 posts
10th Ranked


thanks  
thanks you guys, are the best
 
New Post 2/20/2006 3:45 PM
User is offline David Pugmire
10 posts
www.pugmires.com
10th Ranked


Re: programatic localization in DotNetNuke 4.0.1 

This is all good and fun, but I cannot get localization working on anything BUT a local file.   What if I want to access a global resource?

This no Worky:
myLabel.Text = Localization.GetString("MyKey", ResolveUrl("~/App_GlobalResources/MyResources"));

Any reason why I cannot pull a resource from any file like this?   The above example assumes of course that I have a file called "MyResources.resx" in the App_GlobalResources folder.  I have also even tried naming it "MyResources.ascx.resx" as an experiment, which would cause it to be compatible to the implimentation of Localization.GetString(), I think???

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Language Packs ...  programatic localization in DotNetNuke 4.0.1
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


ZLDNN.COM
We provide commercial DotNetNuke modules.
www.zldnn.com
DNNhost Scandinavia
SUPER fast QuadCore DELL servers, MSSQL servers, DotNetPanel, daily backup, Check out our customers websites
DNNhost.dk
Personify Design, Inc.
Seattle-based Personify Design has developed customized DotNetNuke websites for a wide range of customers to meet many different types of needs, including distributed authorship across thousands of pages to integrated Verisign e-commerce capabilities.
www.personifydesign.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP