Respondido Multi-language database

  • terça-feira, 6 de março de 2012 09:14
     
     

    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,


Todas as Respostas

  • terça-feira, 6 de março de 2012 09:53
     
     Respondido
    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



  • terça-feira, 6 de março de 2012 10:28
     
     

    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,


  • terça-feira, 6 de março de 2012 14:38
     
     Respondido

    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

  • quarta-feira, 7 de março de 2012 07:41
     
     
    Thanks Alexander, I'll take a look at the links.
    • Editado n.etx quarta-feira, 7 de março de 2012 07:41
    •  
  • quarta-feira, 7 de março de 2012 07:49
     
     
    Okay, please ask if any issues will occur or please report if you will succesfully find a solution.