Hi,
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.
So rather than:
unless bbox and bbox.count(',') == 3
report_error("The parameter bbox is required, and must be of the form
min_lon,min_lat,max_lon,max_lat")
return
end
We can have:
unless bbox and bbox.count(',') == 3
report_error(TEXT['boundary_parameter_required']
return
end
It separates logic from presentation.
The yaml file can be /config/output_texts/en.yml.
It is loaded from this intializer script:
TEXT = YAML.load(File.read(RAILS_ROOT + "/config/text_outputs/en.yml"))
Doing this will also be a step closer to having outputs in different
languages.
What does everyone think?
Xin
_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev