<html><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="font-size: 15px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><span>Hi Ceki</span><br><span></span><br><span>I'm sorry. I'm working to 22 pm in Japan time(14 pm in French time).</span></span></div><div><span class="Apple-style-span" style="font-size: 15px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><br><span>I'll update it until tomorrow morning.</span></span><br><br></div><div><br>On 2009/08/28, at 6:11, Ceki Gulcu &lt;<a href="mailto:ceki@qos.ch">ceki@qos.ch</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><span></span><br><span>Hi Takeshi,</span><br><span></span><br><span>Thank you for sharing your new ideas. I just cloned <a href="http://github.com/takeshi/cai18n/tree/master">http://github.com/takeshi/cai18n/tree/master</a>.</span><br><span></span><br><span>It looks like MessageDefinitionConveyor is referencing the class ch.qos.cai18n.sample.ColorMessageConfiguration (part of the tests). This causes the maven build to fail for me.</span><br><span></span><br><span>I'll look at the code some more tomorrow morning and come back to you with comments.</span><br><span></span><br><span>Cheers,</span><br><span></span><br><span>Takeshi Kondo wrote:</span><br><blockquote type="cite"><span>Hi Ceki</span><br></blockquote><blockquote type="cite"><span>I have two type safe message definition idea.</span><br></blockquote><blockquote type="cite"><span>I've committed draft code to my cai18n project clone.</span><br></blockquote><blockquote type="cite"><span>(<a href="http://github.com/takeshi/cai18n/tree/master">http://github.com/takeshi/cai18n/tree/master</a>)</span><br></blockquote><blockquote type="cite"><span>Please take it in cai18n project, if you like it,.</span><br></blockquote><blockquote type="cite"><span>My ideas is as follows.</span><br></blockquote><blockquote type="cite"><span>1. Message definition by annotation</span><br></blockquote><blockquote type="cite"><span>for instance,</span><br></blockquote><blockquote type="cite"><span>public enum LocalizedColors {</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;@Message("green")</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;GREEN {</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@Message("vert")</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Locale fr = Locale.FRANCE;</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@Message("midori")</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Locale ja = Locale.JAPAN;</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;}</span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><blockquote type="cite"><span>Using enum field declaration with annotation, we can define localized message. It is simple , but we can't add other locale.</span><br></blockquote><blockquote type="cite"><span>2. Message definition by switch case</span><br></blockquote><blockquote type="cite"><span>for instance,</span><br></blockquote><blockquote type="cite"><span>public class ColorDef_fr extends MessageDefinition&lt;Colors&gt; {</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;public Locale getLocale() {</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return Locale.FRANCE;</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;}</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;public String getMessage(Colors e) {</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch (e) {</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case BLUE:</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return "blue";</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case GREEN:</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return "vert";</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case RED:</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return "rouge";</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return null;</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;}</span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><blockquote type="cite"><span>Using method return, we can define localized message.</span><br></blockquote><blockquote type="cite"><span>It is not simple, but this we can define it per locale._______________________________________________</span><br></blockquote><span></span><br><span></span><br><span>-- </span><br><span>Ceki Gülcü</span><br><span>Logback: The reliable, generic, fast and flexible logging framework for Java.</span><br><span><a href="http://logback.qos.ch">http://logback.qos.ch</a></span><br><span>_______________________________________________</span><br><span>cai18n-dev mailing list</span><br><span><a href="mailto:cai18n-dev@qos.ch">cai18n-dev@qos.ch</a></span><br><span><a href="http://qos.ch/mailman/listinfo/cai18n-dev">http://qos.ch/mailman/listinfo/cai18n-dev</a></span><br></div></blockquote></body></html>