<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 8, 2015 at 7:54 AM, Stian Thorgersen <span dir="ltr"><<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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 { "key" : "value" }). There's also support for translating property files backed into IDEs.</span></div></blockquote><div><br></div><div>At the moment if you use Java properties with ResourceBundle the file encoding must be ISO-8859-1. I think Java 9 may introduce support for UTF-8 (<a href="http://openjdk.java.net/jeps/226">http://openjdk.java.net/jeps/226</a>). <br><br></div><div>Best regards,<br></div><div>Thomas<br></div><div><br><br><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 8 October 2015 at 06:48, Thomas Raehalme <span dir="ltr"><<a href="mailto:thomas.raehalme@aitiofinland.com" target="_blank">thomas.raehalme@aitiofinland.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span><p dir="ltr"><br>
On Oct 8, 2015 6:53 AM, "Stian Thorgersen" <<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>> wrote:<br>
><br>
> With regards to internationalization I have two questions:<br>
><br>
> * Should we fallback to English messages if a key is missing in a translation? Alternative is to show key, but that'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>
<p dir="ltr">> * 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'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><div>
<p dir="ltr">><br>
> On 7 October 2015 at 18:42, Stan Silvert <<a href="mailto:ssilvert@redhat.com" target="_blank">ssilvert@redhat.com</a>> wrote:<br>
>><br>
>> Marko brought this to my attention yesterday. For some things, we<br>
>> dynamically create UI. In this case, the java code contains the English<br>
>> text and it needs to be localized. Luckily, the solution was pretty<br>
>> straightforward. We just replace the English text with a key into the<br>
>> message bundle. The html template that displays this text already pulls<br>
>> from an Angular scope so we just leave that alone and pass it through<br>
>> the |translate filter. You do need to also add the double-colon.<br>
>><br>
>> One nice side effect is that if the key is not found in the bundle then<br>
>> the output of the translate filter is the unchanged text. This means<br>
>> that any code which has not converted to using bundle keys will still<br>
>> work as expected. And, any third-party providers can just pass in<br>
>> plain text if they don't care about l10n. If they ever do care about<br>
>> l10n we will just need to provide a means for them to add key/value<br>
>> pairs to the resource bundles.<br>
>><br>
>> Here is an example for anyone who needs to localize English text<br>
>> embedded in java:<br>
>> <a href="https://github.com/ssilvert/keycloak/commit/c9437595b70810c4472325373dd8833c37be8549" target="_blank">https://github.com/ssilvert/keycloak/commit/c9437595b70810c4472325373dd8833c37be8549</a><br>
>><br>
>> Stan<br>
>> _______________________________________________<br>
>> keycloak-dev mailing list<br>
>> <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> keycloak-dev mailing list<br>
> <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
> <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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><b>Thomas Raehalme</b></div><div><i>CTO, teknologiajohtaja</i></div><div>Mobile +358 40 545 0605</div><div><br></div><div><b>Aitio Finland Oy</b></div><div>Väinönkatu 26 A</div><div>40100 JYVÄSKYLÄ, Finland</div><div>Tel. +358 10 322 0040</div><div><a href="http://www.codecenter.fi" target="_blank">www.aitiofinland.com</a></div><div><pre cols="72" style="white-space:pre-wrap;color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"><div style="white-space:normal;font-family:arial,sans-serif"><span style="background-color:rgb(230,145,56)"><font color="#cc0000"><b><span style="background-color:rgb(255,255,255)"><span></span><span style="color:rgb(230,145,56)">Codecenter on nyt Aitio – me kun ei <span></span>vain koodata!</span></span></b></font></span></div></pre></div></div></div></div></div></div></div></span></div></div>
</div></div>