Hassan
Hassan

Reputation: 1433

Asp.Net Localized SQL Content / How to define classes

I have made a lot of research about this subject and now I am asking for some advices :)

I am working on a multilingual intranet. I am not talking about translating the UI (using resources etc..) but in translating the content.

I have several tables based on this format :

Product
-------------
IdProduct | DateCreation

ProductT
-------------
IdProduct | IdLanguage | ShortName

Question
-------------
IdQuestion | DateCreation

QuestionT
-------------
IdQuestion| IdLanguage | ShortName | Description

Language
-------------
IdLanguage | Culture

My question is now :

How to write the C# Classes for this Model. I am using Asp.Net MVC with a repository Pattern and Stored Procedures (No ORM like EF etc..) because we can't (not my decision)

For example for the Questions objects, I Will have to Display a correctly translated questions List in a page. If the selected language version is not found for a question, display the English translation.

So how can I write down my classes to fit this need, and to be usable by my repositories, controllers and views

Upvotes: 0

Views: 116

Answers (1)

webdeveloper
webdeveloper

Reputation: 17288

You need to create your custom ResourceProviderFactory. As example look at ASP.NET 2.0 Custom SQL Server ResourceProvider. I use constant string with PK for accessing translation.

Upvotes: 1

Related Questions