Technical support This forum is closed.
Version 1.x > Technical support > Problems about Multilanguage View modes: 
User avatar
Member
Member
astajl - 12/30/2005 9:23:50 AM
   
Problems about Multilanguage
<b>If we want to store data of books and we implement 2 language, let say English and Chinese, CMS use 2 rows to store in table. However, I want to store them all in 1 row. I thought a approach to implement, but there are some problem.</b>
<hr>
When I created the document template "Book", I created enough fields for both lang version (e.g. EnglishBookName and ChineseBookName). I built the pages (menu) for under these 2 lang culture. Content Editor only need to create document type as "Book" under a language, let say English, but he had to fill all fields (BOTH EnglishBookName and ChineseBookName).

I created 2 transformations, "englishview" and "chineseview".
englishview:
<%# DataBinder.Eval(Container, "DataItem.EnglishBookName") %>
chineseview:
<%# DataBinder.Eval(Container, "DataItem.ChineseBookName") %>

I used Sessions to store the current culture, and use cmsdatalist the retrieve the data in the aspx file.
<% If sessionCulture = "en-us" Then %>
<cc1:cmsdatalist id="Book_EnglisgView" SelectNodesClassName="cms.Book" TransformationName="cms.Book.englishview" ... runat="server"></cc1:cmsdatalist>
<% ElseIf sessionCulture = "zh-tw" Then %>
<cc1:cmsdatalist id="Book_ChineseView" SelectNodesClassName="cms.Book" TransformationName="cms.Book.chineseview"... runat="server"></cc1:cmsdatalist>
<% End If %>
<hr>
<b>Problem: ONLY english version work, because I did not create chinese version of that document. I believe my approach is wrong. I just want to know if there is any other solution can solve the problem(store 2 language in 1 row).</b>

User avatar
Member
Member
astajl - 12/30/2005 12:13:00 PM
   
Re: Problems about Multilanguage
<add key="CMSCombineWithDefaultCulture" value="true"/>, ok?

User avatar
Guest
admin - 12/30/2005 8:49:12 PM
   
Re: Problems about Multilanguage
Your approach should generally work, although it's not recommended. Did you have any problem with that?

User avatar
Member
Member
astajl - 1/3/2006 8:27:34 AM
   
Re: Problems about Multilanguage
<add key="CMSCombineWithDefaultCulture" value="true"/> works

You said it is not recommended.
You mean use <add key="CMSCombineWithDefaultCulture" value="true"/> to solve the problem, or you mean store 2 language in the same row?

Why?

User avatar
Guest
admin - 1/3/2006 2:26:26 PM
   
Re: Problems about Multilanguage
Sorry, I meant storing 2 languages in the same row - because if your customer decides to add another language, you will need to change the database structure and code again...

Usage of the CMSCombineWithDefaultCulture is, of course, possible and "recommended" in appropriate cases, however, it will not help you in case that you store both languages in the same row.

Best Regards,