This post originated from an RSS feed registered with .NET Buzz
by Mark Harrison.
Original Post: Implementing multi-language CMS.RAPID
Feed Title: Mark Harrison
Feed URL: http://markharrison.co.uk/blog/xml.aspx
Feed Description: .NET Portals, Collaboration and eBiz
If you want different languages in MCMS then you would normally have separate channels per language, CMS.RAPID does not prevent you from being able to do this it just provides an alternate way where different languages are stored within the same Page (Posting). CMS.RAPID will handle showing the appropriate content depending on the selected language.
CMS.RAPID uses XML templates to define the layout of a page. These templates also make use of 'Base' templates which allow you to define the overall layout (header, footers, navigation, images etc) which appear on every page. CMS.RAPID can use different XML templates for each language.
The templates in turn load standard ASP.Net (System.Web.UserControl) controls to generate the content. Mostly (but they don't have to) they inherit from one of the CMS.RAPID base classes and use XML and XSLT to produce the output. It is possible for CMS.RAPID to use different XSLT for each language.
When using the multi-language functionality built into CMS.RAPID postings are shared between languages. This means that if you want to change the content on one page you get to change the content for each language on that single page (using the Telerik tabbed multi-language control). RapidBlue shows this concept.
In order to accommodate the different languages each posting has separate DisplayNames and PageTitles for each languages (This is on the Language tab of the posting properties). CMS.RAPID will use these when generating the XML for that posting so that the appropriate language is displayed.
So that the navigation shows the correct languages there are also channel properties which allow different names to be specified for each language for each channel. This again automatically switches based on the current language.
The RapidBlue is a simple demonstration of what can be achieved without any modification to CMS.RAPID, which is why some text is hard-coded into the XML and XSLT. CMS.RAPID is designed to be extended though and it would not take much effort to implement your own resource management which could be implemented in a number of ways.
1- Post-process the XML before it is transformed using the XSLT. Here you could translate text within the XML so that the XSLT does not have to. You could also add the resources for the current language to the XML, which could then be used by the XSLT to pick the appropriate text for the current language.
2- Write an ASP.Net (or CMS.RAPID) control which selects the translated text at runtime. This could then be used in the XML templates where you wish to hard-code some text, but still have it translated.
I suspect that you would use both of these methods (with some additional of your own) to ensure that the correct translation was performed at the correct time.
As stated CMS.RAPID does not prevent you from using traditional approaches to multi-language MCMS it just provides you with another option.
The CMS.RAPID approach allows customers to maintain only one channel hierarchy for each language. Also if another language is required in the future you simply add it in a site setting. You will still need to add the translation for each page/channel but it will always display the default language you specify until the translation is available.