How is the internationalization of rails going? I think this is a very important part for the framework ( at least for me, since my main language isnt english ). Is anyone working on this already? I relly want to help in this subject, but my ruby skill''s are not good enought yet. If someone could give me any pointers on where to start, i would be very thankfull. Regards. -- Giovanni Degani tiefox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org ICQ 965609 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I believe there is an i18n gem for Ruby... and there was an article posted here before about how to get gettext working with Rails.. lemme see if i can find it. here it is: http://manuals.rubyonrails.com/read/book/16 On 4/29/05, Giovanni Degani <tiefox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > How is the internationalization of rails going? > I think this is a very important part for the framework ( at least for me, > since my main language isnt english ). > Is anyone working on this already? > I relly want to help in this subject, but my ruby skill''s are not good > enought yet. > If someone could give me any pointers on where to start, i would be very > thankfull. > > Regards. > -- > Giovanni Degani > tiefox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > ICQ 965609 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- - Ramin http://www.getintothis.com/blog _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
And before you ask, no, localzied dates and strftime (and all the rest you gte for free from locales) is not there (and gettext does not provide it). And it doesnt look they will be in the nearest future. Pity that I am C-illiterate :-) On 29-apr-05, at 22:39, Ramin wrote:> I believe there is an i18n gem for Ruby... and there was an article > posted here before about how to get gettext working with Rails.. lemme > see if i can find it. > > here it is: http://manuals.rubyonrails.com/read/book/16 >-- Julian "Julik" Tarkhanov
On Friday 29 April 2005 22:32, Giovanni Degani wrote:> How is the internationalization of rails going? > I think this is a very important part for the framework ( at least > for me, since my main language isnt english ). > Is anyone working on this already? > I relly want to help in this subject, but my ruby skill''s are not > good enought yet. > If someone could give me any pointers on where to start, i would be > very thankfull.While Rails and Ruby are not yet internationalized, there are still some things you can do. As Ruby classes and modules are open, you can change them from your own code. I have a directory app/overrides which contains among other things these files, resulting in german validation error messages and month names # active_record/errors.rb module ActiveRecord class Errors begin @@default_error_messages.update( { :inclusion => "ist nicht in Liste gültiger Optionen enthalten", :invalid => "ist ungültig", :confirmation => "entspricht nicht der Bestätigung", :accepted => "muss akzeptiert werden", :empty => "darf nicht leer sein", :too_long => "ist zu lang (höchstens %d Zeichen)", :too_short => "ist zu kurz (mindestens %d Zeichen)", :wrong_length => "hat eine falsche Länge (es sollten %d Zeichen sein)", :taken => "ist schon vergeben", :not_a_number => "ist keine Zahl", }) end end end # date.rb require ''date'' class Date MONTHNAMES = [nil, ''Januar'', ''Februar'', ''März'', ''April'', ''Mai'', ''Juni'', ''Juli'', ''August'', ''September'', ''Oktober'', ''November'', ''Dezember'' ] end # all.rb require ''app/overrides/active_record/errors'' require ''app/overrides/date'' Then, at the end of config/environment.rb I have require ''overrides/all'' This is definitely not pretty. The best I can say is that it appears to work and keeps the intrusive code in one confined place. It would be much better, if all verbatim strings within Rails were piped through gettext or similar. While I''m writing this, I realize that one could use the method shown above to load gettext and wrap _() around the original verbatim strings. If there are no localizations, _() simply returns its argument so everything remains as it is, but for those willing/needing to localize the strings, there''s clean hook to do so. Michael -- Michael Schuerig Airtight arguments have mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org vacuous conclusions. http://www.schuerig.de/michael/ --A.O. Rorty, Explaining Emotions
This is interesting...but would require patching the entire framework. What the core developers think about this? 2005/4/29, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org>:> > On Friday 29 April 2005 22:32, Giovanni Degani wrote: > > How is the internationalization of rails going? > > I think this is a very important part for the framework ( at least > > for me, since my main language isnt english ). > > Is anyone working on this already? > > I relly want to help in this subject, but my ruby skill''s are not > > good enought yet. > > If someone could give me any pointers on where to start, i would be > > very thankfull. > > While Rails and Ruby are not yet internationalized, there are still some > things you can do. As Ruby classes and modules are open, you can change > them from your own code. I have a directory app/overrides which > contains among other things these files, resulting in german validation > error messages and month names > > # active_record/errors.rb > > module ActiveRecord > class Errors > begin > @@default_error_messages.update( { > :inclusion => "ist nicht in Liste gültiger Optionen enthalten", > :invalid => "ist ungültig", > :confirmation => "entspricht nicht der Bestätigung", > :accepted => "muss akzeptiert werden", > :empty => "darf nicht leer sein", > :too_long => "ist zu lang (höchstens %d Zeichen)", > :too_short => "ist zu kurz (mindestens %d Zeichen)", > :wrong_length => "hat eine falsche Länge (es sollten %d Zeichen > sein)", > :taken => "ist schon vergeben", > :not_a_number => "ist keine Zahl", > }) > end > end > end > > # date.rb > > require ''date'' > > class Date > MONTHNAMES = [nil, ''Januar'', ''Februar'', ''März'', ''April'', ''Mai'', > ''Juni'', ''Juli'', ''August'', ''September'', ''Oktober'', > ''November'', ''Dezember'' ] > end > > # all.rb > > require ''app/overrides/active_record/errors'' > require ''app/overrides/date'' > > Then, at the end of config/environment.rb I have > > require ''overrides/all'' > > This is definitely not pretty. The best I can say is that it appears to > work and keeps the intrusive code in one confined place. It would be > much better, if all verbatim strings within Rails were piped through > gettext or similar. While I''m writing this, I realize that one could > use the method shown above to load gettext and wrap _() around the > original verbatim strings. If there are no localizations, _() simply > returns its argument so everything remains as it is, but for those > willing/needing to localize the strings, there''s clean hook to do so. > > Michael > > -- > Michael Schuerig Airtight arguments have > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org vacuous conclusions. > http://www.schuerig.de/michael/ --A.O. Rorty, Explaining Emotions > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Giovanni Degani tiefox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org ICQ 965609 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 30-apr-05, at 0:17, Michael Schuerig wrote:> On Friday 29 April 2005 22:32, Giovanni Degani wrote: >> How is the internationalization of rails going? >> I think this is a very important part for the framework ( at least >> for me, since my main language isnt english ). >> Is anyone working on this already? >> I relly want to help in this subject, but my ruby skill''s are not >> good enought yet. >> If someone could give me any pointers on where to start, i would be >> very thankfull. > > While Rails and Ruby are not yet internationalized, there are still > some > things you can do. As Ruby classes and modules are open, you can change > them from your own code. I have a directory app/overrides which > contains among other things these files, resulting in german validation > error messages and month namesMichael, this is not pretty bur it totally rocks. I was expecting that you can just augment the classes you need, but didn''t know about monthnames etc. Can you put this on the Rails wiki (aliased like OverridingRailsMessagesInOtherLanguage? -- Julian "Julik" Tarkhanov
On Saturday 30 April 2005 12:18, Julian ''Julik'' Tarkhanov wrote:> Can you put this on the Rails wiki (aliased like > OverridingRailsMessagesInOtherLanguage?There it is: <http://wiki.rubyonrails.com/rails/show/OverridingRailsMessagesInAnotherLanguage> Michael -- Michael Schuerig There is no matrix, mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org only reality. http://www.schuerig.de/michael/ --Lawrence Fishburn