Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Affordable ASP.NET Hosting Service
  Ads  
 


  Sponsors  

Meet Our Sponsors

SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Language Packs ...  A simple solution for module localization
Previous Previous
 
Next Next
New Post 5/18/2006 3:50 PM
User is offline Timm Rebitzki
4 posts
10th Ranked


A simple solution for module localization 

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 4:43 PM
User is offline ErikVB
3004 posts
www.apollo-software.nl
4th Ranked










Re: A simple solution for module localization 

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,
a view from my attic, my personal blog

The personal blog of Erik van Ballegoij

 
New Post 5/18/2006 5:11 PM
User is offline Timm Rebitzki
4 posts
10th Ranked


Re: A simple solution for module localization 

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 1:44 PM
User is offline none
30 posts
www.a.com
10th Ranked


Re: A simple solution for module localization 

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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Language Packs ...  A simple solution for module localization
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Gearworx Web Hosting
As a premier provider of Web Hosting, Private/White Label hosting, Server Colocation, Dedicated Server, and other Managed Services, Gearworx offers an array of services designed to more effectively manage strategies driving businesses on the Web. Headquartered in Fremont, California our state of the art tier one data centers and distributed managed services environment enables Gearworx to offer your business enterprise level solutions through simplified processes.
Gearworx Web Hosting
Glanton: Enterprise Intranet Specialists Using DNN
Glanton Solutions are a premier provider of sevices for large corporates lloking to outsource Intranet sites.
www.glanton.com
Jetkey Smart Map
Smart Map is an AJAX powered Google Map module that displays driving directions, proximity search results and data from your own databases. Smart Map reads GPX (GPS data) files, GeoRSS feeds, and KML data. You can pass any querystring parameter to Smart Map and into your own custom queries to control what data displays on the map.
smartmap.jetkey.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP