I have a problem which brings 2 technical questions.
I have a Products table with language independent values (like some ID-s, numeric and DateTime values) and
ProductDetails table with language dependent values (like Name, Description, etc.).
The 2nd table has a column which identifies the language with LCID. The tables have one ot many connection. So I have only one language table no matter how many language I want to support.
The first question is how can I display data from ProductDetails depending on the current locale settings? How can I JOIN these tables in the List template view? I also have to display data from the
Products table in the same gridview. So if I click on Products
in Default.aspx (My tables) I should see rows from Products with values from
ProductDetails on the selected language.
The secound question is how should I create a form which display input fileds for every language? This Insert/Update template view should display fields for
Products table and multiple fields for different languages separated by a tabcontrol (or similar). This form should submit all values at once and insert one row to
Products and several to ProductDetails.
Is it possible to supply a diagram of the relationships
e.g.
Product -> ProductDetails -> Language
and what fields are linked, the easyist way would be to take a snap shot of the Linq to SQL model designer and pop it on to a google picas account and then post the link here Like this:
Dynamic Data
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
I have a problem which brings 2 technical questions.
I have a Products table with language independent values (like some ID-s, numeric and DateTime values) and
ProductDetails table with language dependent values (like Name, Description, etc.).
The 2nd table has a column which identifies the language with LCID. The tables have one ot many connection. So I have only one language table no matter how many language I want to support.
Hi, another question the third table which is linked via LCID does this table contain values or just the language name?
Dynamic Data
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
This is an administration site with Dynamic Data. So I say both.
The admin page sould display data in the prefered language (based on profile or browser settings) in lists (gridview, List.aspx), but when this admin want to upload or modify data, s/he should be able to set values for every language. For the specific fileds
there should be a tabcontrol (or so), like in this forum when you Reply (there is Compose, Preview, etc.) only with the same fileds (formview?) asking for the language specific value. When the admin click on submit, than all data sould be inserted to database.
Than there are 7 records in ProductDetails.
In lists it should list the default language value if no preffered, but it is good enough if it alwas display the default language. The matter is, how to insert/update data.
FTeR
Member
8 Points
22 Posts
LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 02:59 PM|LINK
Hi,
I have a problem which brings 2 technical questions.
I have a Products table with language independent values (like some ID-s, numeric and DateTime values) and ProductDetails table with language dependent values (like Name, Description, etc.).
The 2nd table has a column which identifies the language with LCID. The tables have one ot many connection. So I have only one language table no matter how many language I want to support.
The first question is how can I display data from ProductDetails depending on the current locale settings? How can I JOIN these tables in the List template view? I also have to display data from the Products table in the same gridview. So if I click on Products in Default.aspx (My tables) I should see rows from Products with values from ProductDetails on the selected language.
The secound question is how should I create a form which display input fileds for every language? This Insert/Update template view should display fields for Products table and multiple fields for different languages separated by a tabcontrol (or similar). This form should submit all values at once and insert one row to Products and several to ProductDetails.
ex.:
_____________
_____________
Thanks.
Dynamic Data Insert List.aspx Edit scaffold LCID
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 04:08 PM|LINK
Is it possible to supply a diagram of the relationships
e.g.
Product -> ProductDetails -> Language
and what fields are linked, the easyist way would be to take a snap shot of the Linq to SQL model designer and pop it on to a google picas account and then post the link here Like this:
Dynamic Data
Always seeking an elegant solution.
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 04:13 PM|LINK
Hi, another question the third table which is linked via LCID does this table contain values or just the language name?
Dynamic Data
Always seeking an elegant solution.
FTeR
Member
8 Points
22 Posts
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 04:38 PM|LINK
Thanks for the quick answer.
Here it is, I truncated the unnecessary fields:

Here is a good article about the use of LCID in a table structure like this: http://www.codeproject.com/KB/aspnet/localizationByVivekTakur.aspx
See the last Using a Database for Localization section (he named the column CultureID).
Edit:
There is no 3rd table. The LCID came from .Net http://www.microsoft.com/globaldev/reference/lcid-all.mspx
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 04:48 PM|LINK
Right so let me see if I got this right,
is it 1 or 2?
Dynamic Data I18N
Always seeking an elegant solution.
FTeR
Member
8 Points
22 Posts
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 04:52 PM|LINK
2.
sry, by language table I meant the ProductDetails, so there is no ProductDetails_En, ProductDetails_De, ProductDetails_Fr or so.
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 05:05 PM|LINK
Got that, how is the language selected is it selected on each form or when the user logs on?
Dynamic Data I18N
Always seeking an elegant solution.
FTeR
Member
8 Points
22 Posts
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 05:17 PM|LINK
This is an administration site with Dynamic Data. So I say both.
The admin page sould display data in the prefered language (based on profile or browser settings) in lists (gridview, List.aspx), but when this admin want to upload or modify data, s/he should be able to set values for every language. For the specific fileds there should be a tabcontrol (or so), like in this forum when you Reply (there is Compose, Preview, etc.) only with the same fileds (formview?) asking for the language specific value. When the admin click on submit, than all data sould be inserted to database.
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 05:27 PM|LINK
I assume that the number of languages is not fixed, for instance the admin could add a new language at any time.
And what about a site with say 2 products with 3 languages and one product with only one language?
Dynamic Data I18N
Always seeking an elegant solution.
FTeR
Member
8 Points
22 Posts
Re: LCID: how to scaffold language dependent fields from separate tables?
Jul 28, 2008 05:34 PM|LINK
Than there are 7 records in ProductDetails.
In lists it should list the default language value if no preffered, but it is good enough if it alwas display the default language. The matter is, how to insert/update data.