0

I have to add globalization (Arabic) to my English ASP.NET application.

It's been so easy to get information about the changes to be done in Visual Studio but not as easy to get information about general lines to follow (server, database, etc) and specially the changes to do in my SQL Server database. Do I need to duplicate the database? Maybe the tables?

The application is a Learning Management System: users that watch a flash movie and then they do an exam and after it they write comments and feedback. Tables are User, Organisation, Presentation, Movies, Feedback and History, plus a couple more for security.

Our idea is keep one server if it's possible but duplicate databases is allowed (I don't know if that would be an acceptable solution).

How should I proceed?

Thanks very much in advance, any help is really appreciated.

Scheveningen
  • 69
  • 2
  • 14

2 Answers2

0

For the web application, there are a couple ways to handle localization, but you'll end up with resource files (.resx).

On the database side, decide if you only have 2 languages to support, in which case you may be able to get away with duplicating text field, or if there's the possibility of other languages, in which case you would want to have a separate table for text values, joined with a language key.

For example:

table something
  pk id,
  string data, 
  etc

table something_resx
  pk id,
  fk something_id
  fk lang
  string text

Then you'd have a query like

select data, text from something s join something_resx r on s.id = r.something_id where lang = lang_key

chris
  • 36,094
  • 53
  • 157
  • 237
  • Thanks chris. There's a possibility that application must be done in Chinese, too, but just in a future and as an idea to don't close any door. But what about changes in tables at the moment to store arabic characters? I mean, can I do it in my current tables without any change? – Scheveningen May 09 '12 at 09:45
  • @Scheveningen: Obviously, you will need to make changes to your database, since it doesn't currently support multiple languages. – chris May 09 '12 at 11:33
0

I don't know what sort of application you have, but if at all feasible I would advise that you take the localization concern entirely away from the data layer. Of course if your app is content-centric (such as a e-commerce site) it's not feasible. But if your DB only contains a few language-specific things such as country names (for example), then you could remove these and move the localization responsibility to the application layer (to keep with this example, replace the country names in your database with an ISO code, and let the application's presentation layer translate these into country names).

This is because localizing an app can depend on the localization support given to you by the .NET Framework and Visual Studio (resources files, satellite assemblies, language fallback) and many tools will help the process. At the database layer, however, you are left on your own to do everything.

Clafou
  • 15,250
  • 7
  • 58
  • 89
  • Thanks Clafou. My application is a Learning Management System: users see a flash presentation and then they do an exam, adding comments at the end. It's an "easy" system with tables as User, Presentation, Movie, History, Feedback and a couple more for Security, etc. As I answered to chris, I cannot see how I can change my database, or if I should just create a new one in Arabic for arabic users. – Scheveningen May 09 '12 at 09:48
  • Oh well, you're stuck with having to supporting multi-language content in your DB then! I wouldn't think you need to create a new DB, just add new tables with translations (since you wish not to introduce breaking changes to existing tables, you could treat English as a base language, and rely on new tables to get corresponding Arabic content) – Clafou May 09 '12 at 10:27