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 PacksTrying to forge ahead: making the case for a dynamic localization solutionTrying to forge ahead: making the case for a dynamic localization solution
Previous
 
Next
New Post
9/3/2005 1:22 PM
 

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 7:35 AM
 

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 11:44 AM
 

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


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
9/5/2005 11:49 AM
 
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


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
9/5/2005 11:57 AM
 
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, Former DNN Corp. Employee and DNN Expert

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

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsLanguage PacksLanguage PacksTrying to forge ahead: making the case for a dynamic localization solutionTrying to forge ahead: making the case for a dynamic localization solution


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