Hi,
I think the columns and table in migration should be able to have an optional "display_name" set manually. Something like:
create_table :people, {display_name => "Personne"} do |t| t.column :first_name :string, :display_name => "Prénom". end
Let me explain my point of view:
Rails is a framework made to write programs in English. You see it when you are confronted to the pluralization rules, or the _confirmation fields. I think this is okay, because programming Rails without speaking English is a pain anyway: most of the docs and tutorial available on the web are in English, and all functions have english name.
But where I think Rails goes a little bit too far, is that it is also meant to be a lot more easy using it to write application with english output, for English-speaking user. And if programmers are writing for non-English user, it's a lot more pain for them. I think this is not fair. World is not just english-speaking, and Rails is a world-wide open software.
And I think it would not be difficult for Rails to make it easy programming a non-english output.
For the translations of the error messages, I found that localisation_simplified is a very nice and very lightweight plugin that should be integrated in Rails by default. This would spare programmers the pain to check all plugins availables at http://wiki.rubyonrails.org/rails/pages/InternationalizationComparison when they only want one language output, but non-english.
But this plugin does not offer a solution to translate the database fields, so generated scafold is all in english, and I have to correct all the rhtml files manually Moreover, I'm still displaying error messages like: "First name est un champs obligatoire." So I have to write all error messages manually, repeating myself a lot. Using gettext or internationalisation plugin to solve this problem makes me feel like taking a hammer to kill a bee: I just want one language output.
Scaffolding is such a good part of rails, that it should also be fully enjoyable for programmers wanting a non-english-output!
To solve this, my first thought was to write my database in my target language (French). But then I was confronted to the pluralization problem, and the "_confirmation" things. Moreover, all functions of the framework are in English. So when I'm writing something like "utilisateur.create", I find it ugly, and I feel like neither English nor French programmer would understand what I meant when I wrote this. As I said, Rails is meant to be programmed in full-english.
So if I write my database in English, and want the user to see it in french, then I have to put the translation somewhere. And if I change or create or delete a field in my database, I also have to change, create or delete the translation. (and I don't want to repeat myself).
This is why I think the best place for translation is in migration: this is where we are defining what will be the name of the fields in the database, so it's the best place to define the name we want it to be displayed in the app.
The perfect thing would be just one more option, available for every kind of fields:
create_table :people, {display_name => "Personne"} do |t| t.column :first_name :string, :display_name => "Prénom". end
If default scaffold behaviour is able to understand this, we're done. This feature would also be very useful to people with ugly existing database that they're just not allowed to touch.
And this would also help for globalisation: I would then be able to write: t.column :first_name :string, display_name => translate("First Name").
And if you don't give a display name, you've just got the default behaviour with the "humanize" thing.
I know this is not very compatible with the "sexy migration" of rails 2.0, but I think there is a lot of people for who this feature would be more useful than the "sexy migration" one.
Hope I conviced someone able to do this!
Sebastien.