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  |  

telerik -- supercharge your DNN websites
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Language Packs ...  Trying to forge ahead: making the case for a dynamic localization solution
Previous Previous
 
Next Next
New Post 9/3/2005 11:22 AM
User is offline Peter Donker
321 posts
www.bring2mind.net
8th Ranked






Trying to forge ahead: making the case for a dynamic localization solution 

I'm going to have to implement some dynamic content localization for a (German) client soon, so I'm motivated to get this thing going. My current thoughts are:

1. To have one central table with texts with structure:
   - ModuleId AS int
   - Locale AS nvarchar(5)
   - StringName AS nvarchar(50)
   - StringValue AS ntext
The PrimaryKey would be a combination of the first 3 fields.

2. In the core we would have a similar support as GetString but now with signature GetString(ModuleId, StringName). Similarly we would need a SetString with all 4 parameters.

3. I would programmatically/by SQL solve tying this to my existing tables

Your votes please. And your ideas about performance. Because this is dynamic content it is dangerous to cache. Maybe we can use a timeout value on every module to use for caching.

Peter


Peter Donker
Bring2mind http://www.bring2mind.net
Home of the Document Exchange,
the professional document management solution for DNN
 
New Post 9/4/2005 5:35 AM
User is offline Peter Donker
321 posts
www.bring2mind.net
8th Ranked






Re: Trying to forge ahead: making the case for a dynamic localization solution 

Let's elaborate on point 3 while I'm trying to work this out. I'm trying to work out how you could get strings out of SQL without having to go through a separate DB call (i.e. the module asks for a list of objects already localized, not with pointers that need to be resolved first in order to get the strings). My fear is that we would need to pass the whole locale chain to SQL:

User's language: System.Threading.Thread.CurrentThread.CurrentCulture.ToString.ToLower
Fallback language: DotNetNuke.Services.Localization.Localization.GetSupportedLocales(userLanguage).Fallback.ToLower
Generic Language: System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.ToLower
Portal Language: PortalSettings.DefaultLanguage.ToLower

If you'd need to pass all these as parameters into SQL that would lead to huge procedure signatures. However, considering you can define FUNCTIONS in SQL you might do some of this within the database and cut back on parameters. Let me explain.

Let's assume that the locale field is NULL for default portal locale. Then we could try to find the right string as follows:

1. Is there a string for the current context locale (e.g. es-ES)?

2. Is there a string for the generic locale (i.e. es)?

3. Is there a string for a good alternative (e.g. es-MX)?

4. Finally: get the default locale (i.e. locale = NULL)

This could be implemented in SQL by passing just 1 parameter: the context locale. Then you would call your SPROC as GetMyObjects(ModuleId, Locale) and your SQL would use a function GetString(ModuleId, 'Obj'+ObjectId, Locale) and get the string.

Peter


Peter Donker
Bring2mind http://www.bring2mind.net
Home of the Document Exchange,
the professional document management solution for DNN
 
New Post 9/5/2005 9:44 AM
User is offline Sebastian Leupold
15045 posts
www.deutschnetnuke.de
1st Ranked












Re: Trying to forge ahead: making the case for a dynamic localization solution 

Peter,

as fas as I know, there is no concept published by the core team, that covers content localization, Vicenc should know about the status. But I fear, they will not decide soon about the method to be chosen.

Currently there is an solution existing from ErikVB, that contains an API, you may contact him, maybe that is an option for you.

Your solution sounds advanced with options to support translation services as well, but how do you handle ML HTML/Text, that use nText instead of nVarChar for content and summary - handle this in a separate table? Reduction to a single interface would be preferable - my opinion.

It would be nice to hear thoughts from other users.

Sebastian


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 9/5/2005 9:49 AM
User is offline Sebastian Leupold
15045 posts
www.deutschnetnuke.de
1st Ranked












Re: Trying to forge ahead: making the case for a dynamic localization solution 
 donker wrote

Let's assume that the locale field is NULL for default portal locale. Then we could try to find the right string as follows:

1. Is there a string for the current context locale (e.g. es-ES)?

2. Is there a string for the generic locale (i.e. es)?

3. Is there a string for a good alternative (e.g. es-MX)?

4. Finally: get the default locale (i.e. locale = NULL)

I would prefer, to have this fallback mechanism for static localization as well (currently without 2.), only looking for exact same locale is not really sufficient, it needs additional work for translators as me, as I have to support 3 locales (de-DE, de-CH and de-AT), currently containing similar content.

Sebastian


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 9/5/2005 9:57 AM
User is offline ErikVB
3004 posts
www.apollo-software.nl
4th Ranked










Re: Trying to forge ahead: making the case for a dynamic localization solution 
Peter,
 
The method i use to get localized text from the db is much like your suggestion. In one call (just passing the current locale), i get alternative texts in this order: portal locale, system default, any text. iow if text for the requested locale is unavailable, text in the portal locale is returned, and if that is not avaible, text in the system default, and if that is not available then just any available text...
 
To be exact, the api i have available is for navigational localization, not for content localization as such.
 
My suggestion to the dynamic localization of module content would be that module developers implement the actual localization themselves (its not very hard to do), but that an "ILocalizable" interface would be available in the core, by which modules can communicate their localization features to the core. This will be usefull for displaying in one spot what modules offer dynamic localization, and what content is localized in which locales.
 
Apart from this, the search procedures should be slightly changed, so we can pass a locale to addsearchitem. The search module should always only search in the current locale, but an advanced search module should be able to search in a specific locale or in all locales.
 
cheers,
 
erik

Erik van Ballegoij,
a view from my attic, my personal blog

The personal blog of Erik van Ballegoij

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Language Packs ...  Trying to forge ahead: making the case for a dynamic localization solution
 


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.

 


Code Endeavors, LLC
Do you Endeavor to Enhance your DotNetNuke designs by utilizing AJAX technologies to more efficient interactive web experiences
www.codeendeavors.com
T-WORX, INC.
Professional DotNetNuke Solutions
www.t-worx.com
AppTheory
Professional development for medium to large projects based on the DotNetNuke platform.
www.apptheory.com

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