Hi,<div><br class="webkit-block-placeholder"></div><div>I am working on api_controller at the moment. I'd like to suggest we take out the output strings and put that in a YAML file.</div><div><br class="webkit-block-placeholder">
</div><div>So rather than:</div><div><br class="webkit-block-placeholder"></div><div><div>unless bbox and bbox.count(',') == 3</div><div> report_error("The parameter bbox is required, and must be of the form min_lon,min_lat,max_lon,max_lat")
</div><div> return</div><div>end</div><div><br class="webkit-block-placeholder"></div><div>We can have:</div><div><div>unless bbox and bbox.count(',') == 3</div><div> report_error(TEXT['boundary_parameter_required']
</div><div> return</div><div>end</div><div><br class="webkit-block-placeholder"></div><div>It separates logic from presentation.</div><div><br class="webkit-block-placeholder"></div><div>The yaml file can be /config/output_texts/en.yml.
</div><div><br class="webkit-block-placeholder"></div><div>It is loaded from this intializer script:</div><div>TEXT = YAML.load(File.read(RAILS_ROOT + "/config/text_outputs/en.yml"))</div><div><br class="webkit-block-placeholder">
</div><div>Doing this will also be a step closer to having outputs in different languages.</div><div><br class="webkit-block-placeholder"></div><div>What does everyone think?</div><div><br class="webkit-block-placeholder">
</div><div>Xin</div><div><br> </div></div></div>