Hello Tobias,<br><br>thanks for the hint, and now I remember you had mentioned this during our OpenCms training... :-)<br><br>Best regards,<br>Yves<br><br><div class="gmail_quote">On 7 October 2011 09:21, Tobias Herrmann <span dir="ltr"><<a href="mailto:t.herrmann@alkacon.com">t.herrmann@alkacon.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF" text="#000000">
Hi Yves,<br>
<br>
the parameter '__locale' will only be evauluated once for each
request by the CmsDefaultLocaleHandler before your template jsp or
any other resource gets rendered. If you want to set the locale
depending on a cookie value, you should really implement you own
locale handler by implementing org.opencms.i18n.I_CmsLocaleHandler
or extending org.opencms.i18n.CmsDefaultLocaleHandler. You can set
the global locale handler within /WEB-INF/config/opencms-system.xml
at opencms/system/internationalization/localehandler.<br>
<br>
If you still need to do an include with another locale than the
current request-context locale, you still could use the OpenCms API
by calling <br>
<br>
org.opencms.jsp.CmsJspTagInclude.includeTagAction(<br>
PageContext context,<br>
String target,<br>
String element,<br>
Locale locale,<br>
boolean editable,<br>
boolean cacheable,<br>
Map<String, String[]> paramMap,<br>
Map<String, Object> attrMap,<br>
ServletRequest req,<br>
ServletResponse res)<br>
<br>
This is the same method used by the include tag, only that you can't
set another locale than the current through the tag.<br>
<br>
Greetings,<br>
Tobias<br>
<pre cols="300">--
Alkacon Software GmbH - The OpenCms Experts
<a href="http://www.alkacon.com" target="_blank">http://www.alkacon.com</a> -- <a href="http://www.opencms.org" target="_blank">http://www.opencms.org</a>
</pre>
<br>
Am 05.10.2011 10:29, schrieb Yves Glodt:
<blockquote type="cite"><div><div></div><div class="h5">Hello,<br>
<br>
in my attempt to create a proof-of-concept of a
multilanguage-website without the needs for /en/, /de/, /fr/
folders and siblings, I tried the following in my template:<br>
<br>
<span style="font-family:courier new,monospace"><cms:include
element='body' editable="true"></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">
<cms:param name="__locale">${empty cookie.lang.value ?
'en' : </span><span style="font-family:courier new,monospace">cookie.lang.value</span><span style="font-family:courier new,monospace">}</cms:param></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"></cms:include></span><br style="font-family:courier new,monospace">
<br>
But it does not work as expected. The <span style="font-family:courier new,monospace">__locale </span>parameter seems to be
ignored. I use OpenCms 7.5.4 here.<br>
<br>
Someone else already had this problem: <a href="http://mail.opencms.org/pipermail/opencms-dev/2008q4/030850.html" target="_blank">http://mail.opencms.org/pipermail/opencms-dev/2008q4/030850.html</a><br>
<br>
Is there a solution in the meantime?<br>
<br>
Best regards,<br>
Yves<br>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a href="http://lists.opencms.org/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/mailman/listinfo/opencms-dev</a></pre>
</blockquote>
</div>
<br><br>
_______________________________________________<br>
This mail is sent to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
<a href="http://lists.opencms.org/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br></blockquote></div><br>