<div dir="ltr">We need to support any language ;)<div><br></div><div>Default message bundles are Java properties. For Java developers it may be expected that they are encoded in <span style="font-size:12.8px">ISO-8859-1, but for other people they probably expect UTF-8. Java property files are nice as the format is simple (key=value is much nicer and easier to write than { &quot;key&quot; : &quot;value&quot; }). There&#39;s also support for translating property files backed into IDEs.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 8 October 2015 at 06:48, Thomas Raehalme <span dir="ltr">&lt;<a href="mailto:thomas.raehalme@aitiofinland.com" target="_blank">thomas.raehalme@aitiofinland.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><p dir="ltr"><br>
On Oct 8, 2015 6:53 AM, &quot;Stian Thorgersen&quot; &lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; With regards to internationalization I have two questions:<br>
&gt;<br>
&gt; * Should we fallback to English messages if a key is missing in a translation? Alternative is to show key, but that&#39;s not going to help anyone</p>
</span><p dir="ltr">A missing key is a bug and showing the message in the default locale may hide the problem. </p>
<p dir="ltr">Even though showing the key does not help the end user it helps the developer and identifies the problem. For this reason I think showing the key would be a good idea.</p><span class="">
<p dir="ltr">&gt; * Should we change message bundles to UTF-8? Or is ISO 8859-1 going to work for all languages?</p>
</span><p dir="ltr">Depends what those all languages are :-)</p>
<p dir="ltr">I think UTF-8 is the best choice as it will handle practically any character. </p>
<p dir="ltr">But if you&#39;re referring to Java resource bundles the encoding for .properties is ISO-8859-1 but there are means to handle any UTF-8 character.</p>
<p dir="ltr">Best regards,<br>
Thomas<br></p><div class="HOEnZb"><div class="h5">
<p dir="ltr">&gt;<br>
&gt; On 7 October 2015 at 18:42, Stan Silvert &lt;<a href="mailto:ssilvert@redhat.com" target="_blank">ssilvert@redhat.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Marko brought this to my attention yesterday.  For some things, we<br>
&gt;&gt; dynamically create UI.  In this case, the java code contains the English<br>
&gt;&gt; text and it needs to be localized.  Luckily, the solution was pretty<br>
&gt;&gt; straightforward.  We just replace the English text with a key into the<br>
&gt;&gt; message bundle.  The html template that displays this text already pulls<br>
&gt;&gt; from an Angular scope so we just leave that alone and pass it through<br>
&gt;&gt; the |translate filter.  You do need to also add the double-colon.<br>
&gt;&gt;<br>
&gt;&gt; One nice side effect is that if the key is not found in the bundle then<br>
&gt;&gt; the output of the translate filter is the unchanged text.  This means<br>
&gt;&gt; that any code which has not converted to using bundle keys will still<br>
&gt;&gt; work as expected.   And, any third-party providers can just pass in<br>
&gt;&gt; plain text if they don&#39;t care about l10n.  If they ever do care about<br>
&gt;&gt; l10n we will just need to provide a means for them to add key/value<br>
&gt;&gt; pairs to the resource bundles.<br>
&gt;&gt;<br>
&gt;&gt; Here is an example for anyone who needs to localize English text<br>
&gt;&gt; embedded in java:<br>
&gt;&gt; <a href="https://github.com/ssilvert/keycloak/commit/c9437595b70810c4472325373dd8833c37be8549" target="_blank">https://github.com/ssilvert/keycloak/commit/c9437595b70810c4472325373dd8833c37be8549</a><br>
&gt;&gt;<br>
&gt;&gt; Stan<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; keycloak-dev mailing list<br>
&gt;&gt; <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; keycloak-dev mailing list<br>
&gt; <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
</p>
</div></div></blockquote></div><br></div>