<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: ivy.cms.coLocale() with dynamic data</title><link>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data</link><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The method
&lt;strong&gt;ivy.cms.co(String uri, List&amp;lt;object&amp;gt; formatObjects)&lt;/strong&gt; can be used with list of objects, so that you can pass dynamic data to your cms templates using {0} , {1} afterwards.
However this method will always use the current locale. If we want to get a translation in another language, we can use the &lt;strong&gt;ivy.cms.coLocale(String uri, Locale locale&lt;/strong&gt;) , but it seems this method does not take List&amp;lt;objects&amp;gt; so how can we pass the dynamic data ?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 07 Nov 2019 07:59:47 -0500</lastBuildDate><item><title>Answer by SupportIvyTeam</title><link>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data/4150</link><description>&lt;p&gt;There is no nice API for this use case. But there is a workaround:&lt;/p&gt;
&lt;p&gt;1) set the desired locale on your session -&amp;gt; &lt;code&gt;session.setContentLocale(Locale.GERMANY)&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;2) call &lt;code&gt;.co(uri, list)&lt;/code&gt; which should now be executed with the just set locale &lt;/p&gt;
&lt;p&gt;3) reset the locale on the session to its initial locale&lt;/p&gt;
&lt;p&gt;There has been an issue created to improve the API (XIVY-3314).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SupportIvyTeam</dc:creator><pubDate>Thu, 07 Nov 2019 07:59:47 -0500</pubDate><guid>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data/4150</guid></item></channel></rss>