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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsLanguage PacksLanguage PacksA simple solution for module localizationA simple solution for module localization
Previous
 
Next
New Post
5/18/2006 5:50 PM
 

Hello localizers,

I've developed a solution for dynamic module localization that's easy to implement. It should work on any installation of DNN, although I've tested it only on dnn v. 4.03.

It involves dropping two files into your App_Code folder and making one call in default.aspx.vb. There is no recompilation of the core involved, no changes to the database. The asp.net engine will compile the added files on the fly.

The way it works:

You supply several localized versions of your text module on the page you're creating and write the title of the module and page in a specific way as described below. The modules are hidden if the user language doesn't match the custom-localized title in the module.

Details:

(This text is taken from one of the included files)

----------------------------------------------------

     To localize your portal, just make a few changes to your module settings,
     then call "LocalizePage(Page, PortalSettings, Title)" in Page_Load() of Default.aspx.vb.
     Remember to include "Imports Bitpals" at the top of Default.aspx.vb.
     Also drop this file and Tools.vb into your App_Code folder.

     Pages are made language-aware by writing the title in this format:
     -------------------------------------------
     en:title-in-english;de:title-in-german ...
     -------------------------------------------
     "en", "de", etc. are the standard ISO language identifiers.
     The code in this class picks out the title according to the currently selected
     user language of the page.

     Pages also have a name, which is used in the page menu (the tab name).
     Write the page name in the same way to localize the menu as well.

     If your page has a language-independent title, just omit any language identifiers.

     To localize the contents of the page, this code will hide any module
     whose title is not explicitly localized to the current user language.

     If your module title has no language prefix, the module will still be visible.

     If your module title includes a language prefix, but none of the languages
     in the title matches the current user language, the module will be hidden.

     If a language in your module title matches the user language, the module is visible.

-------------------------------------------------------

P.S. I'm just starting out with DNN, so please bear with me if there's something I've overlooked. As I implement this on my site (and get it live) I'll most likely come across these issues and find a way to work around. I've altered the page title slightly if it is served from localhost. This helps me tell the pages apart as I'm running both local and online versions at the same time. You can comment out the offending line in the GetPageTitle() function.

You can download the source code here:

http://www.bitpals.com/download/bitpals_dnn_localization.zip

I'm interested in hearing what you make of it!

Timm

www.bitpals.com (STILL under construction - sigh)

 
New Post
5/18/2006 6:43 PM
 

Thanks for posting this, it's an interesting idea. Bit bussy right now, so i cannot check out your code.

A few observations:

* I think you will have a problem with the search option, that will return results that might be invisible in a certain language
* For simple modules this will work, but for more advance modules you might run into manageability problems
* making core changes generally is a bad idea, as you will get in trouble when upgrading your site

cheers,

erik


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

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

 
New Post
5/18/2006 7:11 PM
 

Erik,

I'm aware of the search results issue. In my blue-eyed way, I'm assuming if someone searches for a German term they won't get to an English result. As I said, the more issues I come across, the more flexible the code will get as I change things around.

On the core changes comment: I don't think it's such a big deal. The core itself isn't changed. There are only two add-on files and one extra line in default.aspx.vb. An upgrade should involve only re-inserting that line.

I came up with this no-brainer solution, because I saw a lot of thought being put into localization on the forum, but no concrete let's-just-get-by-with-something approach.

The hack mentioned in my post refers to the way I identify the control ID for the modules on the page. I.e. module 366 has control ID "ctr366." If this naming convention will change in future versions, of course my code will break. But, as I said, it works NOW. And that's better than waiting for the dnn gurus to come to grips with localizing the core.

You mentioned advanced modules that may need more extended treatment. Which modules would those be?

Another thought: I learned about manipulating the PortalSettings properties just by looking at Intellisense in VWD. Is there some white paper on how namespaces and objects are handled in DNN?

Thanks for your input.

Timm

 
New Post
7/19/2007 3:44 PM
 

Thanks trebitzki ! Great idea. I am not sure if it will do what I want it to, but thanks for posting... There never seems to be enough of this type of sharing on this site.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsLanguage PacksLanguage PacksA simple solution for module localizationA simple solution for module localization


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