none
Multi-language database

    Question


  • Hello,


    I want to create a
    multi-language database in sql azure. I mean my database should store data in different languages. Then a windows phone app will query the database depending on localization.

    I would like to know which are the best practices for multi-language database design.

    Thanks,


    Tuesday, March 06, 2012 9:14 AM

Answers

All replies

  • Hello.

    I don't dare call it a best practice but it's definitely good way of doing things (as i think).

    So, we create two tables for each object. In first table we should store service data (PK, for example) and in the second we should store one record per one language.

    Practical example is the best way of illustrating what i mean:

    Table "Thing:
    ID: int
    other service fields

    Table "ThingInOtherLang":
    ID: int (FK => Thing.ID)
    Lang: varchar ("ru-RU", "en-US",etc)
    Description: text (description in specific lang)
    other data



    Tuesday, March 06, 2012 9:53 AM
  • Thanks Alexander, I will follow your suggestion for the design.

    Regarding to Windows Phone Application, this application invokes operations in a WCF service hosted in Azure and there the queries to the multilingual database are implemented.  Now, my doubt is: how does the WP client set the language of the required data?

    I mean, each WCF operation should have a parameter defining the language of the required data? Or should be better to create more than one WCF service
    depending on the language?

    Thanks again,


    Tuesday, March 06, 2012 10:28 AM
  • Hello.

    I have never developed such a thing, but if i'm not mad, WCF uses SOAP. So i suppose you can add optional header to your request using IClientMessageInspector for example.

    Or http://wcfextras.codeplex.com/ .

    Or http://msdn.microsoft.com/en-us/library/ms730255.aspx

    There are many guides in the internet covering this topic, so try to implement such a solution.

    Please write if my answer was useful for you.

    Useful links:

    http://stackoverflow.com/questions/1976217/how-to-add-custom-soap-headers-in-wcf

    http://www.adilmughal.com/2011/10/wcf-custom-header-with-silverlight.html

    http://stackoverflow.com/questions/964433/how-to-add-a-custom-header-to-every-wcf-calls

    Tuesday, March 06, 2012 2:38 PM
  • Thanks Alexander, I'll take a look at the links.
    • Edited by n.etx Wednesday, March 07, 2012 7:41 AM
    Wednesday, March 07, 2012 7:41 AM
  • Okay, please ask if any issues will occur or please report if you will succesfully find a solution.
    Wednesday, March 07, 2012 7:49 AM