<html><body><div>The definition in the message property file should be like this.</div><div><span style="font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; font-size: 15px; line-height: 1.5;">invalidPassword.minlength.message=Invalid password: must contain at least {0}</span></div><div><span style="font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; font-size: 15px; line-height: 1.5;"><br></span></div><div><font face="Helvetica Neue, Helvetica, Arial, Verdana, sans-serif"><span style="font-size: 15px; line-height: 22.5px;">The current password validation for example returns messages like this:</span></font></div><div><div><span style="font-size: 15px; line-height: 22.5px; font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif;">return count &lt; min ? "Invalid password: must contain at least " + min + " numerical digits" : null;</span></div></div><div><span style="font-size: 15px; line-height: 22.5px; font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif;"><br></span></div><div><span style="font-size: 15px; line-height: 22.5px; font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif;">I can't replace this with a single key, because of the variable min.</span></div><div><span style="font-size: 15px; line-height: 22.5px; font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif;"><br></span></div><div><span style="font-size: 15px; line-height: 22.5px; font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif;">However, I can replace the return type with an object which contains the message key and their parameters or a string lilke ${</span><span style="font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22.5px;">invalidPassword.minlength.message:min</span><span style="font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22.5px;">} or something similar.</span></div><div><span style="font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22.5px;">I think there are other places where we need a possibility to internationalize a message with variables.</span></div><div><br>Am 26. Februar 2015 um 07:17 schrieb Stian Thorgersen &lt;stian@redhat.com&gt;:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch"><span class="body-text-content"><span class="body-text-content">I'm concerned that allowing any variable in any message would result in horrible performance. We'd have to use FreeMarker or something else to template each individual message, and it couldn't be cached either as the variables change. Would doing it on a case-by-case basic be enough?<br><br>For example:<br><br> invalidPassword.minlength.message=Invalid password: must contain at least {0}<br><br>----- Original Message -----<br></span></span><blockquote class="quoted-plain-text" type="cite">From: "Bill Burke" &lt;<a href="mailto:bburke@redhat.com" data-mce-href="mailto:bburke@redhat.com">bburke@redhat.com</a>&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">To: "Michael Gerber" &lt;<a href="mailto:gerbermichi@me.com" data-mce-href="mailto:gerbermichi@me.com">gerbermichi@me.com</a>&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">Cc: <a href="mailto:keycloak-dev@lists.jboss.org" data-mce-href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a></blockquote><blockquote class="quoted-plain-text" type="cite">Sent: Wednesday, February 25, 2015 9:30:45 PM</blockquote><blockquote class="quoted-plain-text" type="cite">Subject: Re: [keycloak-dev] Internationalization for model data</blockquote><blockquote class="quoted-plain-text" type="cite"></blockquote><blockquote class="quoted-plain-text" type="cite">invalidPassword.minlength.message=Invalid password: must contain at</blockquote><blockquote class="quoted-plain-text" type="cite">least ${realm.passwordpolicy.minLength}</blockquote><blockquote class="quoted-plain-text" type="cite"></blockquote><blockquote class="quoted-plain-text" type="cite">Would need a way to resolve non message property properties.</blockquote><blockquote class="quoted-plain-text" type="cite"></blockquote><blockquote class="quoted-plain-text" type="cite">On 2/25/2015 2:21 PM, Michael Gerber wrote:</blockquote><blockquote class="quoted-plain-text" type="cite">&gt; How do we want to internationalize messages which contains variables like:</blockquote><blockquote class="quoted-plain-text" type="cite">&gt; „Invalid password: must contain at least „ + min + " upper case characters"</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt; ${invalidPassword.minLength} This doesn’t work.</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; Am 24.02.2015 um 14:44 schrieb Bill Burke &lt;<a href="mailto:bburke@redhat.com" data-mce-href="mailto:bburke@redhat.com">bburke@redhat.com</a>&gt;:</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; There's data stored in a bunch of places that should be</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; internationalized. i.e. Role descriptions. I was thinking for this</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; type of stuff, for both simplicity and ease of migration, we still</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; continue to input this type of metadata through one field. Then if the</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; user wants to internationalize a piece of data, they just replace the</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; text with a property variable.</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; Role Description: "Admin access to main application"</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; could be replaced with</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; Role Description: "${role.admin.description}"</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; Then the variable 'role.admin.description' is just replaced with a</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; theme-based property.</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; This way, users dont' have to learn about internationalization until</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; when and if the need it, existing deployments will still just work, and</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; we don't have to expand our data model.</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt;</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; --</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; Bill Burke</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; JBoss, a division of Red Hat</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; <a href="http://bill.burkecentral.com" data-mce-href="http://bill.burkecentral.com">http://bill.burkecentral.com</a></blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; _______________________________________________</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; keycloak-dev mailing list</blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; <a href="mailto:keycloak-dev@lists.jboss.org" data-mce-href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a></blockquote><blockquote class="quoted-plain-text" type="cite">&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" data-mce-href="https://lists.jboss.org/mailman/listinfo/keycloak-dev">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></blockquote><blockquote class="quoted-plain-text" type="cite">&gt;</blockquote><blockquote class="quoted-plain-text" type="cite"></blockquote><blockquote class="quoted-plain-text" type="cite">--</blockquote><blockquote class="quoted-plain-text" type="cite">Bill Burke</blockquote><blockquote class="quoted-plain-text" type="cite">JBoss, a division of Red Hat</blockquote><blockquote class="quoted-plain-text" type="cite"><a href="http://bill.burkecentral.com" data-mce-href="http://bill.burkecentral.com">http://bill.burkecentral.com</a></blockquote><blockquote class="quoted-plain-text" type="cite">_______________________________________________</blockquote><blockquote class="quoted-plain-text" type="cite">keycloak-dev mailing list</blockquote><blockquote class="quoted-plain-text" type="cite"><a href="mailto:keycloak-dev@lists.jboss.org" data-mce-href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a></blockquote><blockquote class="quoted-plain-text" type="cite"><a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" data-mce-href="https://lists.jboss.org/mailman/listinfo/keycloak-dev">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></blockquote></div></div></blockquote></div></body></html>