I am creating an application and would like from the beginning to be multilingual. Research has told me the standard way to do this is to turn text files into resource files and then compile it and use it in your application with the ResourceManager. (GetString())
Being that I am very particular about applicaiton architecture, I want to seperate these files etc from the application because who knows if I am going to develop another app that needs to be multilingual, so that if you change the resource file then you dont
have to update all the applications. This makes things slightly more complicated, but still not a huge deal.
Before I take the plunge and get stated, I don't understand why the translations arent stored in a database, such as SQL Server. The only thing I can think of is performance, but I figure that by caching looked-up words as an application variable datatable
I can redunce the overhead to almost nothing.
Using a database may take more time to set up the translation mechanism, but alot of developer tiem would be saved when it comes to updating the actual translations.
What do you think/advise? If I am on to something here maybe I can write my first "The Code Project" article :)
i went exactly the same way, and adapted the project found here:
http://openmymind.net/index.aspx?documentId=3
(using custom xml fils to store localized ressources), to have it using ressources located in a sql database...
I also coded an utilisty to manage ressources...
If you want, i can send it to you (as is, with no support of course)
doing some of the same work here ... caching a "Translator" object at the Application level that loads a language into the appropriate hashtable upon first call against that lang, and pulls back the translated value.
The reason translations are stored in resource files is that .NET comes pre-packaged with a solution that fits the vast majority of needs (a wholly justifiable criterion) but it is not appropriate or practical in many cases. You could implement your own
"provider" but of course they don't make that obvious or easy. If you change the default resource XML the application reloads. Know any commercial apps that would be acceptable for? Besides, who says all of your multi-language data is static? Using a simple
set of dictionaries stored anywhere you (e.g., the database) with simple keys, makes a lot more sense. What you could hard-code are formatting rules for a given locale.
A side note is the term "culture" which replaces the not-invented-here term "locale". Culture is independent of language in that mid-town Manhattan customers get the same "culture" as the Amish. Keep in mind that text translation is part of the UI culture
(not surprising) whereas formatting rules (very much a UI concern) are not. What's important is that there are two settings, not that the names don't make any sense.
Eric78
Member
150 Points
30 Posts
Localization - store translations in database? (theory)
Jul 15, 2005 06:09 AM|LINK
I am creating an application and would like from the beginning to be multilingual. Research has told me the standard way to do this is to turn text files into resource files and then compile it and use it in your application with the ResourceManager. (GetString())
Being that I am very particular about applicaiton architecture, I want to seperate these files etc from the application because who knows if I am going to develop another app that needs to be multilingual, so that if you change the resource file then you dont have to update all the applications. This makes things slightly more complicated, but still not a huge deal.
Before I take the plunge and get stated, I don't understand why the translations arent stored in a database, such as SQL Server. The only thing I can think of is performance, but I figure that by caching looked-up words as an application variable datatable I can redunce the overhead to almost nothing.
Using a database may take more time to set up the translation mechanism, but alot of developer tiem would be saved when it comes to updating the actual translations.
What do you think/advise? If I am on to something here maybe I can write my first "The Code Project" article :)
Thanks,
Eric
lucdlucd
Member
230 Points
48 Posts
Re: Localization - store translations in database? (theory)
Jul 15, 2005 02:28 PM|LINK
Hello Eric,
i went exactly the same way, and adapted the project found here: http://openmymind.net/index.aspx?documentId=3
(using custom xml fils to store localized ressources), to have it using ressources located in a sql database...
I also coded an utilisty to manage ressources...
If you want, i can send it to you (as is, with no support of course)
rgds
Luc (lucd @ swing . be)
bruh_man
Member
47 Points
13 Posts
Re: Localization - store translations in database? (theory)
Aug 01, 2005 02:02 PM|LINK
I'm also trying to adapt the code from the same article to populate from a database. Can you show me how you did it?
lucdlucd
Member
230 Points
48 Posts
Re: Localization - store translations in database? (theory)
Aug 01, 2005 02:32 PM|LINK
Hello
drop me an email at lucd at swing dot be, i'll send you the thing...
Rgds,
Luc
lucdlucd
Member
230 Points
48 Posts
Re: Localization - store translations in database? (theory)
Apr 22, 2006 04:37 PM|LINK
If anybody interested in, here is it
http://www.inzenet.com/Lucd/PermaLink,guid,58d9a5a8-53fc-40af-8bb3-94a0e5d44b1b.aspx
abadincrotch
Member
283 Points
88 Posts
Re: Localization - store translations in database? (theory)
Apr 26, 2006 04:48 PM|LINK
MCTS: Service Communication Applications
lucdlucd
Member
230 Points
48 Posts
Re: Localization - store translations in database? (theory)
Jun 25, 2006 12:30 PM|LINK
Moved the file there : http://www.inzenet.com/Asp.Net/Default.Aspx
rickoshay
Member
22 Points
8 Posts
Re: Localization - store translations in database? (theory)
Dec 13, 2008 08:48 PM|LINK
The reason translations are stored in resource files is that .NET comes pre-packaged with a solution that fits the vast majority of needs (a wholly justifiable criterion) but it is not appropriate or practical in many cases. You could implement your own "provider" but of course they don't make that obvious or easy. If you change the default resource XML the application reloads. Know any commercial apps that would be acceptable for? Besides, who says all of your multi-language data is static? Using a simple set of dictionaries stored anywhere you (e.g., the database) with simple keys, makes a lot more sense. What you could hard-code are formatting rules for a given locale.
A side note is the term "culture" which replaces the not-invented-here term "locale". Culture is independent of language in that mid-town Manhattan customers get the same "culture" as the Amish. Keep in mind that text translation is part of the UI culture (not surprising) whereas formatting rules (very much a UI concern) are not. What's important is that there are two settings, not that the names don't make any sense.
Culture Localizationzation