Multi-language database
-
martes, 06 de marzo de 2012 9: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 las respuestas
-
martes, 06 de marzo de 2012 9: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
- Editado Alexander BelotserkovskiyMVP martes, 06 de marzo de 2012 9:54
- Propuesto como respuesta Alexander BelotserkovskiyMVP martes, 06 de marzo de 2012 14:38
- Marcado como respuesta n.etx miércoles, 07 de marzo de 2012 7:41
-
martes, 06 de marzo 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,
-
martes, 06 de marzo de 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
- Propuesto como respuesta Alexander BelotserkovskiyMVP martes, 06 de marzo de 2012 14:39
- Marcado como respuesta n.etx miércoles, 07 de marzo de 2012 7:41
-
miércoles, 07 de marzo de 2012 7:41Thanks Alexander, I'll take a look at the links.
- Editado n.etx miércoles, 07 de marzo de 2012 7:41
-
miércoles, 07 de marzo de 2012 7:49Okay, please ask if any issues will occur or please report if you will succesfully find a solution.

