You are here:   » Home » Documentation » Details » How-To » Multilingualism » Home

Switch over to multi-lingual documents

Switching from German to English and back while the site is active.

Solution: To integrate a kind of DTML template for language selection at a fixed place in the site layout

<!-- BO bodyContent_NavigationTranslate  -->

<form name="fmLangSelect">
 <select size="1" 
  onchange="location.href=this.options[this.selectedIndex].value;">
   <dtml-in "getLanguages()">
    <dtml-let req="{'lang':_['sequence-item'],
                    'preview':REQUEST.get('preview','')}">
     <dtml-if "isVisible(req)">
      <option value="<dtml-var "getHref2IndexHtml(req)">"
        <dtml-if "lang==req['lang']">
         selected="selected"
        </dtml-if>
       ><dtml-var "getLanguageLabel(req['lang'])"
      ></option>
     </dtml-if>
    </dtml-let>
   </dtml-in>
 </select>
</form>

<!-- EO bodyContent_NavigationTranslate  -->

Comment: ZMS function isTranslated(lang,REQUEST) checks whether the current object is available in the hetero-lingual variant, too, resp. has been translated. Please find more information and an exemplary use case in the API documentation.

References: