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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesLocalizing Javascript StringsLocalizing Javascript Strings
Previous
 
Next
New Post
5/8/2014 12:30 PM
 

I am working on a module which uses MVVM javascript.  The entire UI is HTML5 and JavaScript.

I want to make use of the localization pattern in DNN.  (i.e. I want to use .resx files for localized messages/strings).

1.)  Is there a built in part of the service framework that provides a way to retrieve localized messages in JS?
2.)  If not a built in, is there a known "best practice" for how to do this?

(I've searched the forums and Google'd pretty far and didn't find anything really).

 
New Post
5/8/2014 7:59 PM
 

typically we expose any localized text as optional properties and then inline the references - if you take a look at a file such as DesktopModules\CoreMessaging\view.ascx you'll see this with the plugin definition towards the bottom of the file.

Alternatively some modules do use ajax request's to pull localized value (I believe a few of the evoq modules do this),but care has to be taken to not end up with an extremely "chatty" application e.g. one that had dozens of localized text might work well with making multiple service requests in some areas (such as the US), but others such as Australia could perform badly because of network latency issues.

 


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
5/9/2014 2:16 AM
 
Will,

I would create the script in code behind filling the localized values from the resx files and then register the script block, e.g.

string s = " \"" + Localzation.GetString("MyAlert.Text", LocalResourceFile) + "\");";
if (!(Page.ClientScript.[IsStartupScriptRegistered|IsClientScriptBlockRegistered]))
Page.[RegisterStartupScript|RegisterClientScriptBlock]([|this.GetType(),] "MyAlertScript", [|[true|false]]);

(just to give you an idea)

Best wishes
Michael

Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesLocalizing Javascript StringsLocalizing Javascript Strings


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