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  |  

The best choice for your web site host, email hosting, and domain registration.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
 


  Sponsors  

Meet Our Sponsors

FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Language Packs ...  Switching languages manually
Previous Previous
 
Next Next
New Post 1/2/2007 5:03 AM
User is offline homam
3 posts
10th Ranked


Switching languages manually 

Is it possible to manually switch between languages in a module I am developing? I need somthing like System.Threading.Thread.CurrentThread.CurrentCulture (wich is normally set in InitializeCulture method of a ASP.Net page). I tried Localization.SetLanguage method but it doesnt seem to work.

I need my module have its own mean to switch languages

Any help is appreciated.

 
New Post 1/4/2007 12:41 AM
User is offline Vicenç Masanas
1389 posts
www.disgrafic.com
6th Ranked








Re: Switching languages manually 

Looking at the DNN code is always a good idea since it does the same you need. In this case this is the code we use in the language selector to change the current language:

        Private Sub selectCulture_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles selectCulture.SelectedIndexChanged

            ' Store selected language in cookie
            Localization.SetLanguage(selectCulture.SelectedItem.Value)

            'Redirect to same page to update all controls for newly selected culture
            Response.Redirect(Request.RawUrl, True)

        End Sub

Notice that you have to reload the page (redirect) in order for the language to take effect. Hope this helps.


Disgrafic.com
 
New Post 1/5/2007 3:35 AM
User is offline homam
3 posts
10th Ranked


Re: Switching languages manually 
Thanks for the reply.
Here is another question:
Using DNN documents I tried to create some localized labels:
<asp:label runat="server" ResourceKey="MyLabel"/>
The label looks fine when viewed by a super user (when I logged in as host for example), but nothing is displayed for an anonymous user. The DNN just renders a empty <span> tag.

Any help is appreciated.
 
New Post 1/8/2007 7:59 AM
User is offline Vicenç Masanas
1389 posts
www.disgrafic.com
6th Ranked








Re: Switching languages manually 
Depending on the version you are using this is a problem with cached modules. If you have a module that needs to render different content while in the view presentation you should disable caching on it (you'll find this option under module settings, set the cache time to 0).
In latest version I think this has already been solved.

Disgrafic.com
 
New Post 1/8/2007 8:03 AM
User is offline ErikVB
2610 posts
www.apollo-software.nl
5th Ranked










Re: Switching languages manually 

locale specific content caching was fixed in 3.3.x / 4.3.x i think

(although i use it on my own site as well and that seems to work fine in 3.2.2....)


Erik van Ballegoij, Apollo Software
If what i am saying is wrong: blame Google
MLSkinHelper: the easy way to put editable text in your skin!
Nederlandse DotNetNuke Gebruikersgroep Apollo Software
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Language Packs ...  Switching languages manually
 


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.

 


Bring2mind
Document Centric DNN Module Solutions
www.bring2mind.net
WEBPC™ DotNetNuke® sites for Small Business
WEBPC™ are internet consultants and web hosters catering to the small business market.
www.webpc.biz
Perpetual Motion Interactive Systems Inc.
A solutions company specializing in Microsoft enterprise technologies.
www.perpetualmotion.ca

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