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...Language and In...Language and In...Using the Language Selection to use a different menu buttonUsing the Language Selection to use a different menu button
Previous
 
Next
New Post
9/10/2014 6:53 PM
 

I have a button created on my menu that says Buy Now. I have three other langauges installed on my site in which I would like to show this button but translated.

This is what I have in the header.ascx file

<div id="Buynow"><a class="tiny green-apple rox_short_button" href="/BuyNow!/tabid/602/language/en-US/Default.aspx"> Buy Now! </a></div>

So what I would like to do is create a java script within this file that uses a case statement to select the correct button for the language selected. This what I have but I am not using the correct DNN Language variable .

<script type="text/javascript"> 

                           

  switch (LANGUAGE){

  case "en-us":

<div id="Buynow"><a class="tiny green-apple rox_short_button" href="/BuyNow!/tabid/602/language/en-US/Default.aspx"> Buy Now! </a></div>

break;

case "es-mx": 

  <div id="Buynow"><a class="tiny green-apple rox_short_button" href="/BuyNow!/tabid/602/language/en-US/Default.aspx">Comprar ahora!</a></div>

  break;

  }

</script>   

 

What variable should I use to pull the language that is selected?

 
New Post
9/11/2014 8:47 PM
 

If you are actually editing an .ascx file you can avoid using the JavaScript and case statement and instead utilize the platform's localization, just have the text value in your header.ascx.resx. An Example: 

<%= Localization.GetString("UnsubscribeAll", LocalResourceFile) %>


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
9/12/2014 12:31 AM
 

Sorry, Im new to this. How do you declare the use of LocalResourceFile. 

 
New Post
9/13/2014 5:13 PM
 

Hi,

You can use the TEXT skinobject for redering lacalized texts in a skin

More info :

http://www.dnnsoftware.com/community-...

 
New Post
9/15/2014 1:26 PM
 
Thats exactly what I was looking for. I am able to show the Default text but ti isn't displaying the translated text when I switch languages.

This is what I have


And I have a resource file in the APP_LocalResources for the other languages.

Not sure why they are not displaying the translated text.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...Using the Language Selection to use a different menu buttonUsing the Language Selection to use a different menu button


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