Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Architecture> implement multi language support
 

Pages: 1
Architecture
implement multi language support
Page:1/1 

  Print all messages in this thread  
Poster Message
ChBaeumer
User



Location:
Berlin, Germany
Joined on:
23-Oct-2003 14:44:03
Posted:
175 posts
# Posted on: 12-Mar-2010 15:47:17.  
I have a question how to handle multi language in an efficient way.

Today I have following
Code:

table Element (
    ElementPK
)

table ElementAttribute
(
    ElementAttributePK,
    ElementPK,
    Locale,
    Value
)

  • There exists a table which holds all available languages.
  • There exists a default language which should be used when an attribute for a locale is not defined.
  • Languages can be added and removed during runtime.

So, in the code I load all ElementAttribute of the element and first search for the specified locale and if it is not found I search for the default locale.

This makes it hard to bind the element entity to GUI components since I have to write public properties the retrieve the correct values. Another thing I don't like is that the element needs access to the language table. The element entity should be unaware of this.

Is this the way it has to be done? How do you handle this?

Christoph
  Top
Seth
User



Location:
Salt Lake City, Utah
Joined on:
25-Mar-2006 02:56:26
Posted:
204 posts
# Posted on: 12-Mar-2010 20:14:15.  
Have you looked into .NET globalization? You can set the current thread's UICulture which would do this.

-Seth


______________________________
Seth Juarez
Strivea, LLC
http://www.sethjuarez.com
 
Top
ChBaeumer
User



Location:
Berlin, Germany
Joined on:
23-Oct-2003 14:44:03
Posted:
175 posts
# Posted on: 13-Mar-2010 10:51:04.  
No thats not the same.

You have to differenciate between the language used for the GUI and the language used in a model.

In my case I have a modeller for business processes.
The business process should be displayed in different languages i.e. the content of the application. The user models in a default language and has the capability to translate the content to different languages.

The whole model can than be exported to html and then the client can choose the display language of the model, i.e the business process with its content.
  Top
psandler
User



Location:
Chicago, IL
Joined on:
22-Feb-2005 22:24:13
Posted:
528 posts
# Posted on: 14-Mar-2010 00:29:40.  
I don't think it's clear what you are asking. Is your question about database efficiency? Database design?

When I have done this in the past with a similar model, I use the database to store languages, keys, default text, and translated text (per language, per key) and pull the information into a "translation dictionary" for the user (in a WPF/Winforms environment) or globally, one per language (in a web environment).

I think it's possble to do it with entities, but translations really lend themselves to in-memory key/value pair dictionaries, which are a far more efficient way to look up the information (this is assuming you don't have millions of translation which may not work as it would take up a lot of memory). So load the translations into a dictionary(s) once at startup (and maybe refresh periodically or manually when there are translation changes), and then look them up as you need them.

I have no idea if this fits your scenario or not, but from my experience it is a very efficient way to do it.


My C#/SQL Blog (some LLBL content)
Email: psandler70 (at) yahoo.com
 
Top
ChBaeumer
User



Location:
Berlin, Germany
Joined on:
23-Oct-2003 14:44:03
Posted:
175 posts
# Posted on: 28-Apr-2010 16:18:56.  
Thank you for you responses.

I think I found a solution which suits my business case.
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.