<?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><item><title>Comment by Oliver Heer on xchatter's question</title><link>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3939</link><description>&lt;p&gt;&lt;a href="https://answers.axonivy.com/users/710/alex-suter"&gt;&lt;a href="https://answers.axonivy.com/users/710/alex-suter"&gt;@alex&lt;/a&gt;&lt;/a&gt;-suter you are absolutely right that we should enhance our API with a method that can handle the above case, I created issue XIVY-3314 where we should address that.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Oliver Heer</dc:creator><pubDate>Wed, 28 Aug 2019 17:31:02 -0400</pubDate><guid>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3939</guid></item><item><title>Comment by Alex Suter on xchatter's question</title><link>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3938</link><description>&lt;p&gt;Hello &lt;a href="https://answers.axonivy.com/users/1180/oliver-heer"&gt;&lt;a href="https://answers.axonivy.com/users/1180/oliver-heer"&gt;@oliver&lt;/a&gt;&lt;/a&gt;-heer
Is the API lacking of this capability?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Suter</dc:creator><pubDate>Wed, 28 Aug 2019 16:59:03 -0400</pubDate><guid>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3938</guid></item><item><title>Comment by xchatter on xchatter's question</title><link>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3928</link><description>&lt;p&gt;Thanks Oliver, this seems to be doing the job. :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">xchatter</dc:creator><pubDate>Mon, 26 Aug 2019 03:35:20 -0400</pubDate><guid>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3928</guid></item><item><title>Comment by Oliver Heer on xchatter's question</title><link>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3926</link><description>&lt;p&gt;You could try the following:
1) set the desired locale on your session -&amp;gt; session.setContentLocale(Locale.GERMANY)
2) call .co(uri, list) which should now be executed with the just set locale
3) reset the locale on the session to its initial locale&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Oliver Heer</dc:creator><pubDate>Fri, 23 Aug 2019 05:53:37 -0400</pubDate><guid>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3926</guid></item><item><title>Comment by a_v_a on xchatter's question</title><link>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3924</link><description>&lt;p&gt;That would be good to know :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">a_v_a</dc:creator><pubDate>Wed, 21 Aug 2019 03:19:52 -0400</pubDate><guid>https://answers.axonivy.com/questions/3923/ivy-cms-colocale-with-dynamic-data#3924</guid></item></channel></rss>