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  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Language Packs ...  Switching languages manually
Previous Previous
 
Next Next
New Post 1/2/2007 6: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 1:41 AM
User is offline Vicenç Masanas
1402 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 4: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 8:59 AM
User is offline Vicenç Masanas
1402 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 9:03 AM
User is offline ErikVB
3004 posts
www.apollo-software.nl
4th 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,
a view from my attic, my personal blog

The personal blog of Erik van Ballegoij

 
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.

 


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