As someone asked if I have permission for this, I thought I'd add my solution:
I changed the database schema, so instead of a single table for all translations for different types of text, I have a separate table called βTextβ, for example.
[Product Table] ProductID PK ProductName In master language for reference ProductDesription In master language for reference <other product fields> [ProductText Table] ProductID PK LanguageId PK ProductName Language-Specific name ProductDescription Language-Specific description
I have a number of these βtextβ tables for translation into the local language for each type of entity that it needs.
Then, if I need to access localized data from EF, I use the following (for example, to get German text):
Product product = db.Products.Where(m => m.ProductId == 1); ProductName germanProductName = product.ProductNames(m => m.LanguageId == "de");
Hope this helps
Nick reeve
source share