Last post Feb 16, 2008 04:59 AM by Tok Bek
Feb 10, 2008 04:19 AM|MartijnG|LINK
I’m hoping for some feedback from more experienced developers.
I’m in the process of designing a web application that is to offer multi language support.
My aim is to have the pages in the app determine what language the user has set (from session variable) and display all the labels and buttons etc in the required language
at page load.
I’ve envisaged three approaches to a data source for retrieving the required language
Store it in an XML file and query it using Microsoft jet driver during page load for each particular control on the page.
Store it in a database and query it during page load for each particular control on the page.
Retrieve all the labels for that particular language translation from the database and put it into system cache. When a page loads query the system cache (looping through until the correct primary key number is found for a particular
control) and bind to the control on page load.
Seeing that a page will be loaded many times during the course of the users work flow it seems resource expensive to go back to the data source each time.
So far I’m most favorable of the third method and would prefer only to load a particular language into system cache when required and expire it after 10 minutes. It’s likely
at times there will be different users working using different languages simultaneously.
Does anyone out there have any ideas on this or thoughts for better approaches to this?
Feb 11, 2008 09:06 AM|vivek_iit|LINK
I think you should use RESX files because I dont see a real need for a DB here, and DB access is more costly in terms of performance rather than XML files (which is the default localization system in aSP.NET). Also, these resx file values are cached by asp.net
and the cache expires when there is any change in the file values.
So I suggest using this approach only, and you can refer this article for details :
Hope this helps,
Feb 16, 2008 04:39 AM|MartijnG|LINK
Feb 16, 2008 04:59 AM|Tok Bek|LINK
check out this tutorial as well :