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...Skins, Themes, ...Skins, Themes, ...Localizing Skin Localizing Skin
Previous
 
Next
New Post
2/11/2014 2:04 PM
 

Hi everybody,

i have a little problem localizing a skin for a website.

On the bottom of the skin there is an image that allow to go back to top of the page.

<a href="<%= SkinPath %>#" id="slide_top" rel="tooltip" title="Scroll back to Top" ResourceKey="Testo"></a>


i need to localize the text "Scroll Back to Top" in various language.

I already try using "<DNN:TEXT>" tokem but it injects some HTML and not only localized text.

I already look into text.ascx.cs to search for that HTML code and create a custom DNN:TEXT token but with no luck.

Any idea on how to localize that string ?

Thanks 

Alessandro.

 
New Post
2/11/2014 6:49 PM
 
Hello,

I've never really tried doing this, but, if you reference DotNetNuke's localization namespace, you can probably do an inline expression to get the string. So, if you did something like:

title="<%= Localization.GetString("Testo","(path to resource file)") %>" That might work...

Mike
 
New Post
2/11/2014 8:14 PM
 

Hi Mike,

i have added 

<%@ Import Namespace="DotNetNuke.Service.Localization" %>


in the top of the skin and

<a href="<%= SkinPath %>#" id="slide_top" rel="tooltip" title="<%= Localization.getstring("Testo.Text",SkinPath) %>"></a>

but no value is returned.

The resource file is present in SkinPath/app_LocalResources and his name is the name of the skin.it-IT.resx

It works with DNN.TEXT because the resource TESTO i've already used with DNN.TEXT in the same skin.

Any idea?

Thanks

Alessandro.

 
New Post
2/13/2014 1:03 PM
 

The easiest way to do this is to create a function that returns the correct text.

Something like

 

<script runat="Server">

     Private Function GetLocString() as String

        Select Case CultureInfo.CurrentUICulture.Name.ToString.ToLower
            Case "en-us"
                Return "Hello World"
            Case "nl-nl"
                Return "Hallo Wereld"
            Case Else
                Return "Nothing"
        End Select

    End Function
    

</script>

 

and this in the skin:  <%=GetLocString()%>

 
New Post
2/13/2014 1:12 PM
 

I cannot edit my post or I loose the code I posted.

You should to put the script above the HTML in your skin's ascx file (I guess you know, but just to be sure)

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Localizing Skin Localizing Skin


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.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out