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  |  

Affordable ASP.NET Hosting Service
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


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
189 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 http://www.bring2mind.net
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.

 


IHostASP.NET Provides the Ideal DNN Hosting
We will help you with the installation, configuration, and troubleshooting of your DNN portal, no task is too big or small for us. Unlike other companies we are not just providing a reliable hosting service, but we are also focused on providing the best DotNetNuke hosting service on the internet.
www.ihostasp.net
$7.16/mo - Powerful DotNetNuke Hosting
Powerful DotNetNuke Hosting starting at under $8/mo with FREE SQL 2005, FREE Installation and expert support.
www.re-invent.com
ASP.NET Web Hosting for $3.95
3 Month FREE ASP.NET Hosting! FREE Setup! DNN Support! FREE Domain Name! FREE Components! Host multiple websites on 1 plan! 30 Days Money Back Guarantee!
www.dailyrazor.com

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