[Hippo-cms7-user] Language switching

Wouter Danes Wouter.Danes at hinttech.com
Mon Apr 23 23:00:29 CEST 2012


My link to the home page of course needs a mount="alias of this locale's mount", oops. :0

-----Original Message-----
From: hippo-cms7-user-bounces at lists.onehippo.org [mailto:hippo-cms7-user-bounces at lists.onehippo.org] On Behalf Of Wouter Danes
Sent: maandag 23 april 2012 22:58
To: Hippo CMS 7 development public mailinglist
Subject: Re: [Hippo-cms7-user] Language switching

Hi Jérôme, 

This is definitely possible. Check the getAvailableTranslationsBean() method on your beans.
In your JSP you could solve it by creating links to translations.

If you have a list of "flags" or other "go to this language" links you can do something along these lines:

(Let's say your document is in the attribute "document") <c:set var="translations" value="${document.availableTranslationsBean}/>

Then when you create a link to f.ex the English page, you can do this:

<c:choose>
  <c:when test="${translations.hasTranslation('en_GB')}">
    <hst:link bean="${translations.translation('en_GB')}" var="en_link"/>
  </c:when>
  <c:otherwise>
   <hst:link siteMapItemRefId="home" var="en_link"/>
  </c:otherwise>
</c:choose>
<a href="${en_link}">EN</a>

Hope this makes sense. I'd prepare some stuff in a generic java component and just write out links in the JSP, but you can do it all in the JSP if you want..

-----Original Message-----
From: hippo-cms7-user-bounces at lists.onehippo.org [mailto:hippo-cms7-user-bounces at lists.onehippo.org] On Behalf Of jmirc
Sent: maandag 23 april 2012 22:37
To: hippo-cms7-user at lists.onehippo.com
Subject: [Hippo-cms7-user] Language switching

Hi,

I would like to know if it is feasible when the customer switches language to stay on the current page with the new selected language instead of to be redirected to the home page.

Thanks

Jérôme

--
View this message in context: http://hippo.2275632.n2.nabble.com/Language-switching-tp7493220p7493220.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html


More information about the Hippo-cms7-user mailing list