Hello out there! I''m still a newbie regarding Rails and apart from other things that I just don''t understand yet, I''m slightly unhappy with how Rails deals with language. For a quick start it''s nice to have names and actions generated automatically. But the happy feeling wears off quickly and turns into embarrassment. Pluralization and capitalization are just pretty different in german than they are in english; german words generated according to the english rules just look strange. As german, and probably most other languages, are a lot more irregular than english, I''d be happy to manually supply the forms Rails needs. It''s easy to do for table names (ActiveRecord set_table_name). Are there ways to do the same for other places and forms? For instance, I have an ActiveRecord class Klient (client). The generated controller is named klients_controller, where it should be either klient_controller (sg) or klienten_controller (pl). Similarly with the views; they end up in a folder called klients, where I''d much prefer either klient (sg) or klienten (pl). As I said, I''m still very much a newbie and am surely ignorant some of the facilities available in Rails. Michael -- Michael Schuerig The more it stays the same, mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org The less it changes! http://www.schuerig.de/michael/ --Spinal Tap, The Majesty of Rock
> For instance, I have an ActiveRecord class Klient (client). The > generated controller is named klients_controller, where it should be > either klient_controller (sg) or klienten_controller (pl). Similarly > with the views; they end up in a folder called klients, where I''d much > prefer either klient (sg) or klienten (pl).You''re not the only Rails developer who is not from an English speaking country. Actually, I think most of us aren''t. However, most developers, regardless of what country they are from, code in English, I think. It''s just so much simpler that way, and the code is much more readable (since the language''s own methods, classes, constructs and so forth uses the English language). Should you ever want to ask for help with your code (on an English speaking mailing list, chat room, or whatever), it also simplifies matters if classes, methods and variable names are in the English language. So that''s my suggestion: code in English. Regards, Tomas Jogin (from Sweden)
On Friday 15 April 2005 16:54, Tomas Jogin wrote:> > For instance, I have an ActiveRecord class Klient (client). The > > generated controller is named klients_controller, where it should > > be either klient_controller (sg) or klienten_controller (pl). > > Similarly with the views; they end up in a folder called klients, > > where I''d much prefer either klient (sg) or klienten (pl). > > You''re not the only Rails developer who is not from an English > speaking country. Actually, I think most of us aren''t. > > However, most developers, regardless of what country they are from, > code in English, I think. It''s just so much simpler that way, and the > code is much more readableActually, I''d prefer to code in english, but it''s not workable in this case, because I just don''t know the english terms, if they even exist, for some of the domain concepts I''m dealing with. For behind-the-scenes stuff I''m naturally using english. Yes, this gives a somewhat weird language mix, but has the benefit of sticking to the language domain experts and users use for the core concepts. (Cf. Domain-Driven Design, Ubiquitous Language). For my first stumbling steps with Rails this isn''t terribly important, of course. But I''m trying to assess how much of a nuisance it may become in a real project. And, incidentally, this prospective project is littered with german terms (legal, business) that I don''t dare to translate. Michael -- Michael Schuerig Thinking is trying to make up mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org for a gap in one''s education. http://www.schuerig.de/michael/ --Gilbert Ryle
> Actually, I''d prefer to code in english, but it''s not workable in this > case, because I just don''t know the english terms, if they even exist,Of course they do. Look them up. It''s the same for all the rest of us who live in a non-English speaking country. We deal with the exact same issues, and most of us, I think, choose to code in English.> For my first stumbling steps with Rails this isn''t terribly important, > of course. But I''m trying to assess how much of a nuisance it may > become in a real project. And, incidentally, this prospective project > is littered with german terms (legal, business) that I don''t dare to > translate.I don''t know, but don''t think multi-language support for this kind of thing is even on the to-do list, nor will it ever be. It doesn''t make any sense, really. I mean you still have English words in Ruby and Rails all over the place, what good would making a _fraction_ of the environment multi-language do? If you think some more on it, I believe you will conclude that you can very well use English for class names, and I''m sure you''ll find English terms for the concepts you are using. The rest of us do. Best of luck with your projects, Tomas Jogin, Sweden
On 15.4.2005, at 14:23, Michael Schuerig wrote:> > Hello out there! > > I''m still a newbie regarding Rails and apart from other things that I > just don''t understand yet, I''m slightly unhappy with how Rails deals > with language. For a quick start it''s nice to have names and actions > generated automatically. But the happy feeling wears off quickly and > turns into embarrassment. Pluralization and capitalization are just > pretty different in german than they are in english; german words > generated according to the english rules just look strange. > > As german, and probably most other languages, are a lot more irregular > than english, I''d be happy to manually supply the forms Rails needs. > It''s easy to do for table names (ActiveRecord set_table_name). Are > there ways to do the same for other places and forms? > > For instance, I have an ActiveRecord class Klient (client). The > generated controller is named klients_controller, where it should be > either klient_controller (sg) or klienten_controller (pl). Similarly > with the views; they end up in a folder called klients, where I''d much > prefer either klient (sg) or klienten (pl).You can name the controller when you''re creating it: script/generate controller klienten script/generate scaffold klient klienten methoda methodb The folder where the views end up is named after the controller name. You can get instructions on generate scripts by invoking them without any parameters (like "script/generate scaffold"). Gruss, //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Saturday 16 April 2005 12:16, Tomas Jogin wrote:> > Actually, I''d prefer to code in english, but it''s not workable in > > this case, because I just don''t know the english terms, if they > > even exist, > > Of course they do. Look them up.Excuse me being harsh, but your assertion verges on arrogance. For a start try to translate the terms for different kinds of german secondary schools ("Hauptschule", "Realschule", "Gymnasium", "Gesamtschule") to english. Even in the very unlikely case that you succeed, I''d be hard pressed to use these uncommon terms for modelling and implementing an application in that domain; they''re too far removed from anything the relevant domain experts are used to.> I don''t know, but don''t think multi-language support for this kind of > thing is even on the to-do list, nor will it ever be. It doesn''t make > any sense, really. I mean you still have English words in Ruby and > Rails all over the place, what good would making a _fraction_ of the > environment multi-language do?The difference is, as I already stated in my previous message, that the english terms in Ruby and Rails are not related to the application domain. They''re purely concerned with infrastructure and other technicalities. In that area I''m happily using english all the time.> If you think some more on it, I believe you will conclude that you > can very well use English for class names, and I''m sure you''ll find > English terms for the concepts you are using. The rest of us do.Despite your best efforts, I''m not yet convinced that the problem is that I haven''t thought enough about this issue. Please consider the possibility that you are wrong in this case. Michael -- Michael Schuerig Failures to use one''s frontal lobes mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org can result in the loss of them. http://www.schuerig.de/michael/ --William H. Calvin
On Saturday 16 April 2005 13:21, Jarkko Laine wrote:> You can name the controller when you''re creating it: > script/generate controller klienten > script/generate scaffold klient klienten methoda methodbThanks for pointing this out. Michael -- Michael Schuerig You can twist perceptions mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Reality won''t budge http://www.schuerig.de/michael/ --Rush, Show Don''t Tell