Kerala Microsoft Users Group

Managing multilingual data

Latest post 02-12-2009 4:17 AM by NinethSense. 13 replies.
  • 02-11-2009 5:01 AM

    Managing multilingual data

    Hi All,

    I want to develop a multi-language website which captures both English and Chinese data. I would like to know how I can handle multi-language data within a single database (For example, English users will enter the "Name" in English whereas Chinese users will enter "Name" in Chinese). I heard that this could be managed via SQL collations. Please help me with more details.

    Thank you

    When the going gets tough...the tough gets going..!!!

    • Post Points: 45
  • 02-11-2009 5:06 AM In reply to

    Re: Managing multilingual data

    Hi,

    How about making use of Resource files / Satellite Assemblies? if the data is common and not much?

     

    Thanks,

    Vikram Pendse.

    Microsoft MVP

    http://pendsevikram.blogspot.com

    • Post Points: 25
  • 02-11-2009 5:42 AM In reply to

    Re: Managing multilingual data

    Hi Vikram,

    I am using resource files to manage multilingual GUI. I am, however, looking for a method by which I can save multilingual data (user input) onto a SQL Server DB. For example, let us take an application that takes user name and address as input.English users will enter the data in English and Chinese users will do the same in Chinese. Can I save both types of data onto a single database? If so, how?

    Thank you again for your support and co-operation.

    When the going gets tough...the tough gets going..!!!

    • Post Points: 25
  • 02-11-2009 6:23 AM In reply to

    Re: Managing multilingual data

    If you really wish to use sql server for saving translations use a table structure like this:

     

    id - key - languagecode - value
    -------------------------
    1 - title_hello - EN - Hello
    2 - title_hello - DE - Halo
    3 - title_goodmorning - DE - Guten Morgen
    ...

    Praveen V Nair, PMP
    Tech Blog | PM Blog

    • Post Points: 25
  • 02-11-2009 6:30 AM In reply to

    Re: Managing multilingual data

    Thank you, that was a good one.

    Just to make the concept clearer, is it possible to save date which is in a language that contains special characters? For example Chinese, Arabic, French etc. Does the concept of collation has anything to do with this scenario?

    When the going gets tough...the tough gets going..!!!

    • Post Points: 25
  • 02-11-2009 6:39 AM In reply to

    Re: Managing multilingual data

    Better reformat it to DateTime before you save.

    Praveen V Nair, PMP
    Tech Blog | PM Blog

    • Post Points: 25
  • 02-11-2009 6:43 AM In reply to

    Re: Managing multilingual data

    But, I have more than one field to be saved. I have numerous fields like name, address, qualification etc. All these are of types nvarchar.

    When the going gets tough...the tough gets going..!!!

    • Post Points: 25
  • 02-11-2009 7:40 AM In reply to

    Re: Managing multilingual data

    Are you saving all fields in same field?

    Anyway, no problem even if it is single field. Just cast it to .NET DateTime format and save it. When you retrieve you can convert it to a desired culture format from UI.

    Praveen V Nair, PMP
    Tech Blog | PM Blog

    • Post Points: 25
  • 02-11-2009 11:03 PM In reply to

    Re: Managing multilingual data

    Let me make my point clearer.

    I have a table by name TBL_MEMBER which has mainly 4 fields, NAME, ADDRESS, FATHER'S NAME, DOB. All these fields except DOB are specified as of nvarchar datatype and DOB is of datetime type. My users can enter data either in English or in Chinese. I want to save the data onto a single table. As you mentioned previously, I can manage this by adding seperate table columns that specify language or culture. My question is, can I save the Chinese characters onto the same table? Except for DOB field, I can't make any DateTime format casting.

    Thank you for your support.

    When the going gets tough...the tough gets going..!!!

    • Post Points: 25
  • 02-12-2009 1:55 AM In reply to

    Re: Managing multilingual data

    >> can I save the Chinese characters onto the same table?

    Yes. By plaing with COLLATION

    Praveen V Nair, PMP
    Tech Blog | PM Blog

    • Post Points: 25
  • 02-12-2009 3:15 AM In reply to

    Re: Managing multilingual data

    But nvarchar datatype can contain Unicode characters right, then why we need COLLATION?

    Thanks

    Anuraj P
    http://www.dotnetthoughts.net

    THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS.
    BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT, NOT TRIED IT.

    • Post Points: 45
  • 02-12-2009 3:20 AM In reply to

    Re: Managing multilingual data

    That means, I will have to keep 2 name columns: one for English names and one for Chinese names. For the former, I can have default collation and for the latter I need to use a collation that supports Chinese characters. If the user's culture is supporting Chinese language, I need to retrieve data from Chinese columns and vice versa.

    Idea This gives me something to work on.

    Yes Thank you for your valuable suggestions.

     

    When the going gets tough...the tough gets going..!!!

    • Post Points: 5
  • 02-12-2009 3:30 AM In reply to

    Re: Managing multilingual data

    Does that mean I can save Chinese characters directly onto the same column?

    If it is possible, then only one column would be required, which contains English and Chinese data.

    If so, in which scenario do we need to use Collation property?

    When the going gets tough...the tough gets going..!!!

    • Post Points: 5
  • 02-12-2009 4:17 AM In reply to

    Re: Managing multilingual data

    >>But nvarchar datatype can contain Unicode characters right, then why we need COLLATION?

    I thought he was having issues with existing collation. Yes nvarchar is unicode.

    Praveen V Nair, PMP
    Tech Blog | PM Blog

    • Post Points: 5
Page 1 of 1 (14 items) | RSS