John,<div><br class="webkit-block-placeholder"></div><div>That's a great idea. The code will also be more usable.</div><div><br class="webkit-block-placeholder"></div><div>I'm thinking of calling the module 'i18n.rb
' which will go into /lib/.</div><div><br class="webkit-block-placeholder"></div><div>The API call might look like: text_for(:node_limit_exceeded).</div><div><br class="webkit-block-placeholder"></div><div>What do you think?
</div><div><br class="webkit-block-placeholder"></div><div>Xin</div><div><br><div><span class="gmail_quote">On 24/01/2008, <b class="gmail_sendername">John McKerrell</b> <<a href="mailto:john@mckerrell.net">john@mckerrell.net
</a>> wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">
Xin,<div><br> </div><div>You could still store the information in a yaml file but access it using a function though couldn't you? One example of added functionality that we might want is to be able to fallback to a different language when we don't have a translation of some text, what do you think?
</div><span class="sg"><div><br> </div><div>John</div></span><div><span class="e" id="q_117ab40abe2015f4_2"><div><br><div><div>On 23 Jan 2008, at 17:49, Xin Zheng wrote:</div><br><blockquote type="cite">Cool. I'm glad we can agree on this.
<div><br> </div><div>I'm working away at map method at the moment. I'll either apply the patch or code in the functionalities before end of this week. </div><div><br> </div><div>John,</div><div>The reason it's in a hash it because Ruby can load a yaml file straight into it. A yaml file is basically a hash in file format. Imagine this in the file:
</div><div>en:</div><div> this_text: "say something here"</div><div> other_text: "say something else"</div><div><div>cn:</div><div> this_text: "i'd type in chinese if I could"</div><div>
other_text: "some more stuff"</div><div><br> </div><div>Ruby can then load all that into a hash to be easily used.</div><div><br><div><span class="gmail_quote">On 23/01/2008, <b class="gmail_sendername"> Tom Hughes
</b> <<a href="mailto:tom@compton.nu" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tom@compton.nu</a>> wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
In message <<a href="mailto:e04cd2420801230920t7eec23e6q4d21e298c38130a3@mail.gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> e04cd2420801230920t7eec23e6q4d21e298c38130a3@mail.gmail.com
</a>><br> Xin Zheng <<a href="mailto:xin@zxv.ltd.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">xin@zxv.ltd.uk</a>> wrote:<br><br>> My aim is to clean up the code so I can easily and safely add new
<br>> functionality. Extracting the output string like this takes a step in that<br>> direction.<br><br>Clearly this is not bad as such, and it doesn't do any significant<br>damage beyond perhaps making certain types of edit to the code a bit
<br>more of a pain, so if you really want to do it then fine. I just don't<br>think it's worth spending a lot of time on when there are better<br>things to do.<br><br>If you want to do something useful to the map call then review the
<br>patch at <a href="http://trac.openstreetmap.org/ticket/648" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://trac.openstreetmap.org/ticket/648</a> and consider<br>applying it, and see if you can tidy things up now that we have
<br>the multi component key stuff - the version in amf_controller <br>looks quite a lot nicer than the main map call now ;-)<br><br>With that I think I'm going to tune out for a few days and let you<br>three get on with whatever it is you're going to do and I'll look at
<br>what you come up with next week or something rather than trying to <br>keep up in real time.<br><br>Have fun, and try not to do too much damage guys!<br><br>Tom<br><br>--<br>Tom Hughes (<a href="mailto:tom@compton.nu" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
tom@compton.nu</a>)<br><a href="http://www.compton.nu/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.compton.nu/ </a><br><br>_______________________________________________<br>dev mailing list
<br><a href="mailto:dev@openstreetmap.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dev@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev</a><br></blockquote></div><br> </div></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">_______________________________________________
</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">dev mailing list</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><a href="mailto:dev@openstreetmap.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
dev@openstreetmap.org</a></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev</a></div> </blockquote></div><br> </div></span></div></div></blockquote></div><br> </div>