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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...NavigateURL to reload page with another languageNavigateURL to reload page with another language
Previous
 
Next
New Post
11/5/2009 4:40 PM
 

Hello,

I have a DNN portal with a language select list made in flash. When I select a language, I simply change the /language/xx-XX/ in the URL to view the current page in another language.

However, recently I have had some problems with this, and I think a better idea would be to use NavigateURL() to build the proper URL to load when a language is choosed.

I have tried this:
NavigateURL(123, "language=", "es-ES"); but it doesn't work at all, what it does is adding /language/es-ES/ to the URL, after /language/en-US, so the string is:

/tabid/xxx/language/en-US/language/es-ES/Default.aspx

I would appreciate some sample code to:
- Loop through all available locales within my portal.
- Write the proper URL to the current page, one link per locale.

Thanks!

 
New Post
11/5/2009 5:59 PM
 

check out the code in the LANGUAGE skin object, it does what you need (sorry, not near code right now, so i cant paste a sample)


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
11/6/2009 5:11 AM
 

Hi, thank you for your reply.

I can find this in the language.ascx.vb:

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
            LocalTokenReplace.Language = selectCulture.SelectedItem.Value
            Response.Redirect(LocalTokenReplace.ReplaceEnvironmentTokens("[URL]"))
End Sub

I have no idea of how to implement the same thing in my case. I need an output like this:

<script type="text/javascript">
var flashvars = {
   language:"<%=CurrLang%>",
   languagecount:"4",
   language1:"English|en-US|n/a|[HERE I NEED THE CURRENT URL BUT WITH ENGLISH AS LANGUAGE]",
   language2:"Suomi|fi-FI|n/a|[HERE I NEED THE CURRENT URL BUT WITH FINNISH AS LANGUAGE]", 
   language3:"Svenska|sv-SE|n/a|[HERE I NEED THE CURRENT URL BUT WITH SWEDISH AS LANGUAGE]",
   language4:"Polski|pl-PL|n/a|[HERE I NEED THE CURRENT URL BUT WITH POLISH AS LANGUAGE]"
};
</script>

At the moment I have this as URL:

/tabid/<%=DotNetNuke.Common.Globals.GetPortalSettings().ActiveTab.TabID%>/language/pl-PL/Default.aspx

Where "pl-PL" is changed on each row to the current language.

Now I want to use NavigateURL (or a similiar method) to build the URL, my current solution is not supported by the blog (for example) where the URL looks a bit different.

Thanks!

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...NavigateURL to reload page with another languageNavigateURL to reload page with another language


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