Multi-language database
-
6 martie 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,
Toate mesajele
-
6 martie 2012 09:53
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
- Editat de Alexander BelotserkovskiyMVP 6 martie 2012 09:54
- Propus ca răspuns de Alexander BelotserkovskiyMVP 6 martie 2012 14:38
- Marcat ca răspuns de n.etx 7 martie 2012 07:41
-
6 martie 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,
-
6 martie 2012 14:38
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
- Propus ca răspuns de Alexander BelotserkovskiyMVP 6 martie 2012 14:39
- Marcat ca răspuns de n.etx 7 martie 2012 07:41
-
7 martie 2012 07:41Thanks Alexander, I'll take a look at the links.
- Editat de n.etx 7 martie 2012 07:41
-
7 martie 2012 07:49Okay, please ask if any issues will occur or please report if you will succesfully find a solution.