From chuckr2 at velofish.com Fri Nov 2 16:20:52 2007 From: chuckr2 at velofish.com (Chuck R.) Date: Fri, 2 Nov 2007 21:20:52 +0100 Subject: [Rails I18n] internationalization options Message-ID: <5186d516d407bd78147fa2fdb8855498@ruby-forum.com> Hi, I'm new to ruby and rails. I need support for for localized pages, pages with multilingual content, international date/time formats, and calendar and time zone calculations. Initially, I asked someone on the ICU project and they directed me to ICU4R . I thought that this was my solution until I scrolled down and found this comment: "The code is slow and inefficient yet, is still highly experimental, so can have many security and memory leaks, bugs, inconsistent documentation, incomplete test suite. Use it at your own risk." Next, I found this link: http://wiki.rubyonrails.org/rails/pages/InternationalizationComparison Globalize looks very up-to-date and well supported. And every time I ask people about internationalization options, they seem to either mention Globalize or say that they don't know. Is Globalize the most widely used option? Do people on this list recommend Globalize or other options? thanks, Chuck -- Posted via http://www.ruby-forum.com/. From me at samlown.com Mon Nov 5 04:21:08 2007 From: me at samlown.com (Samuel Lown) Date: Mon, 5 Nov 2007 10:21:08 +0100 Subject: [Rails I18n] internationalization options In-Reply-To: <5186d516d407bd78147fa2fdb8855498@ruby-forum.com> References: <5186d516d407bd78147fa2fdb8855498@ruby-forum.com> Message-ID: <31d809301f06f319d72d3f078f712479@ruby-forum.com> Hi Chuck, Chuck R. wrote: > > Is Globalize the most widely used option? Do people on this list > recommend Globalize or other options? > Globalize is probably is one of the most widely used solutions for internationalisation in Rails, given, as you say, it is well looked after and provides a very easy solution to integrate with your Rails project. However, I suspect most people are slightly suspicious about the way translations are handled, everything in Globalize is stored in three tables, including one master table that contains all of your translations in every language. If your into wanting to make DB access as minimal and efficient as possible, like me, then this may or may not ring bells. Personally, I now use Gettext for all of my web application texts, as its very mature and while initially it takes a bit of understanding, it offers the most complete solutions for handling strings. Having said that, I did use Globalize in one major project and it works great! One thing you should bare in mind, is the distinction between translating the application (the text in the views) and the data models. Globalize will throw these together in the same basket, but I'm not convinced this is an ideal solution. Checkout my plugin 'translate_columns' for a description of the problems and a solution that I came up with: http://samlown.com/page/RailsTranslateColumnsPluginReadme This only handles models, so you'd need to find another solution, such as globalize or gettext, for your views. I18n is quite complex, and requires a bit of thought to implement well, but stick with it, its worth the effort! Cheers, Sam -- Posted via http://www.ruby-forum.com/. From xjcd at uol.com.br Mon Nov 5 10:39:27 2007 From: xjcd at uol.com.br (Julio Damasceno) Date: Mon, 5 Nov 2007 16:39:27 +0100 Subject: [Rails I18n] Legacy ISO-8859-1 MSSQL db and UTF8 rails app In-Reply-To: <17818186ab7c9ff95567ad36e208b41c@ruby-forum.com> References: <64f457d2222fdd531635bc43aa63b37d@ruby-forum.com> <7776d611a664493070e6451242e96c77@ruby-forum.com> <17818186ab7c9ff95567ad36e208b41c@ruby-forum.com> Message-ID: <3e5c8c99d38a903bb47c21afd989cab0@ruby-forum.com> Tom Bak wrote: > I solved my problem with own plugin: > > recode_legacy_database :from => "ISO-8859-1", :to => "UTF-8" > > Which translates fields in models on read and before write to database. > > Cheers, > Tomasz Tom, How is the usage of this plugin? I have to run this command manual? When I have to put this code? Thanks, Julio -- Posted via http://www.ruby-forum.com/. From mark at chandlerm.com Fri Nov 9 20:11:15 2007 From: mark at chandlerm.com (Mark Chandler) Date: Sat, 10 Nov 2007 02:11:15 +0100 Subject: [Rails I18n] Problem with image_tag Message-ID: <5bc00ed52ca49bd8d0f1b30bf29d4675@ruby-forum.com> I've been following a tutorial for Rails that goes through uploading images directly to databases. The problem is that using image_tag keeps automatically appending .png to the end of the address. /classified/image/9 displays the image correctly, but the image /classified/image/9.png keeps being added to the view instead. Thanks in advance! classified_controller.rb: ... def image @image = Classified.find(params[:id]) send_data @image.picture, :filename => "pic.jpg", :type => @image.content_type, :disposition => "inline" end ... show.rhtml: ... <% unless @classified.picture.blank? %> <%= image_tag(url_for({:action => 'image', :id => @classified.id})) -%> <% end %> ... -- Posted via http://www.ruby-forum.com/. From mark at chandlerm.com Fri Nov 9 20:12:21 2007 From: mark at chandlerm.com (Mark Chandler) Date: Sat, 10 Nov 2007 02:12:21 +0100 Subject: [Rails I18n] Problem with image_tag In-Reply-To: <5bc00ed52ca49bd8d0f1b30bf29d4675@ruby-forum.com> References: <5bc00ed52ca49bd8d0f1b30bf29d4675@ruby-forum.com> Message-ID: Just realized I posted this in the wrong forum! Please delete! -- Posted via http://www.ruby-forum.com/. From johan at withaspoon.se Fri Nov 16 05:23:39 2007 From: johan at withaspoon.se (Johan Stille) Date: Fri, 16 Nov 2007 11:23:39 +0100 Subject: [Rails I18n] removing accents from sentences (ex: url creations) - wh In-Reply-To: <4a68b8cf0708230859o1c70f8ebj86c0e332bf49af0b@mail.gmail.com> References: <4a68b8cf0708230859o1c70f8ebj86c0e332bf49af0b@mail.gmail.com> Message-ID: <1d60ec6b8b88110005d6fdaf853cdc88@ruby-forum.com> I wrote this extension to String a long time ago. I think it does what you want. require 'iconv' class String def pretty_url Iconv.iconv("ASCII//IGNORE//TRANSLIT", "UTF-8", self).join.sanitize rescue self.sanitize end def sanitize self.gsub(/[^a-z._0-9 -]/i, "").tr(".", "_").gsub(/(\s+)/, "_").dasherize.downcase end end Thibaut Barr?re wrote: > Hi! > > I could not find it so far - but maybe rails i18n is the right list for > that > question: is there something already available somewhere in the ruby > space > to remove accents and other diacritics from a string ? (like: > translation > ?ph?m?re to ephemere, etc) > > I've seen the mephisto PermalinkFu trick (iconv from utf-8 to > ascii//ignore//translit) but it doesn't work on my workstation. > > I've attached DiacriticsFu which I wrote and is working fine for me - > I'd be > happy to find something cleaner, cross-platform, and which does not rely > on > Rails like this implementation (it would most likely work with unicode > hacks) > > any hint, comment, link, idea ? > > cheers > > Thibaut -- Posted via http://www.ruby-forum.com/. From pathall at gmail.com Fri Nov 16 05:31:45 2007 From: pathall at gmail.com (Patrick Hall) Date: Fri, 16 Nov 2007 05:31:45 -0500 Subject: [Rails I18n] removing accents from sentences (ex: url creations) - wh In-Reply-To: <1d60ec6b8b88110005d6fdaf853cdc88@ruby-forum.com> References: <4a68b8cf0708230859o1c70f8ebj86c0e332bf49af0b@mail.gmail.com> <1d60ec6b8b88110005d6fdaf853cdc88@ruby-forum.com> Message-ID: <6465924d0711160231p5dc6f4cfk3c717e631752ba4f@mail.gmail.com> Hi, On Nov 16, 2007 5:23 AM, Johan Stille wrote: > require 'iconv' > > class String > def pretty_url > Iconv.iconv("ASCII//IGNORE//TRANSLIT", "UTF-8", self).join.sanitize > rescue > self.sanitize > end > > def sanitize > self.gsub(/[^a-z._0-9 -]/i, "").tr(".", "_").gsub(/(\s+)/, "_").dasherize.downcase > end > end There's a missing dasherize method here, no? -Pat From cch1 at hapgoods.com Fri Nov 16 09:53:23 2007 From: cch1 at hapgoods.com (Chris Hapgood) Date: Fri, 16 Nov 2007 09:53:23 -0500 Subject: [Rails I18n] Railsi18n-discussion Digest, Vol 17, Issue 1 In-Reply-To: References: Message-ID: <000601c82860$6fdb17a0$9401a8c0@hapgoods.com> Sam wrote "...distinction between translating the application (the text in the views) and the data models. Globalize will throw these together in the same basket, but I'm not convinced this is an ideal solution..." Globalize does not *require* that you translate views with DB-backed strings. You can also use per-language template files. Chris Hapgood Skype: chris.hapgood -----Original Message----- From: railsi18n-discussion-bounces at rubyforge.org [mailto:railsi18n-discussion-bounces at rubyforge.org] On Behalf Of railsi18n-discussion-request at rubyforge.org Sent: Friday, November 16, 2007 05:39 To: railsi18n-discussion at rubyforge.org Subject: Railsi18n-discussion Digest, Vol 17, Issue 1 Send Railsi18n-discussion mailing list submissions to railsi18n-discussion at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/railsi18n-discussion or, via email, send a message with subject or body 'help' to railsi18n-discussion-request at rubyforge.org You can reach the person managing the list at railsi18n-discussion-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Railsi18n-discussion digest..." Today's Topics: 1. unicode categories in regexps? (Jonathan Rochkind) 2. Re: Gettext's Locale class in application namespace (Samuel Lown) 3. Dates in Gettext (Samuel Lown) 4. Re: Ruby-Gettext and date/time? (Samuel Lown) 5. Re: Dates in Gettext (Samuel Lown) 6. Re: Dates in Gettext (Samuel Lown) 7. internationalization options (Chuck R.) 8. Re: internationalization options (Samuel Lown) 9. Re: Legacy ISO-8859-1 MSSQL db and UTF8 rails app (Julio Damasceno) 10. Problem with image_tag (Mark Chandler) 11. Re: Problem with image_tag (Mark Chandler) 12. Re: removing accents from sentences (ex: url creations) - wh (Johan Stille) 13. Re: removing accents from sentences (ex: url creations) - wh (Patrick Hall) ---------------------------------------------------------------------- Message: 1 Date: Thu, 25 Oct 2007 19:30:48 +0200 From: Jonathan Rochkind Subject: [Rails I18n] unicode categories in regexps? To: railsi18n-discussion at rubyforge.org Message-ID: <0debd6023fcfa4e0ef00f2e0cb3db687 at ruby-forum.com> Content-Type: text/plain; charset=utf-8 Is there anything for ruby that will give me access to unicode character categories in a regexp like function? For instance, say I want to replace all punctuation with a space, in a unicode-friendly way that will work with any langauges script in unicode. Unicode does provide character classes to make this possible, and other languages built in regexp features support that... but do I have any options in ruby? Thanks, Jonathan -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 2 Date: Sun, 28 Oct 2007 11:58:25 +0100 From: Samuel Lown Subject: Re: [Rails I18n] Gettext's Locale class in application namespace To: railsi18n-discussion at rubyforge.org Message-ID: <25f6700d7dbb8e9e84b29cb776175638 at ruby-forum.com> Content-Type: text/plain; charset=utf-8 For the moment, I've converted my own Locale model into SystemLocale so that it does not conflict with the interests of Gettext. Not the ideal situation IMHO, but it will suffice. Cheers, sam -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 3 Date: Wed, 31 Oct 2007 12:25:10 +0100 From: Samuel Lown Subject: [Rails I18n] Dates in Gettext To: railsi18n-discussion at rubyforge.org Message-ID: Content-Type: text/plain; charset=utf-8 Hi All, It comes up quite a lot, and after much searching, I've not been able to find a solution to handling dates in Gettext that I actually liked. Overriding array constants inside various libraries and expecting things to work didn't do it for me. So I made my own solution. The attached gettext_date.rb file is a *preview* to try and get a bit of feedback about the viability of this approach. Dates are messy, so I'm expecting that my solution does not cover all the possible exceptions to the basic rules I've defined. It's primarily designed for Ruby on Rails, but should work with any ruby app, although the TimeExtensions is unnecessary. To install, copy the gettext_date.rb file to your /lib directory, and add the following line to your environment.rb: require 'lib/gettext_date' Assuming you have every other part of Rails setup for Gettext, and you're .po files contain the translated month and day names, it should "just work". There is no need to add the .localize call to all your time methods, and you can stick with the standard strftime calls. Its also designed so that Time.now.to_s(:rfc822) or similar RFC calls will use the standard ruby strftime method, and remain in english as the standard requires. The key advantage with my approach, is that if your application does not use English as your native language, the GettextDate::Conversions class can be overwritten with the names in the other language, therefore removing any confusing language inconsistencies for the translators. I'll set up a web site as soon as possible with more details, but I'd love to get some feedback! At least now Gettext fans don't have to be jealous of the Globalize crowd :-) Cheers, sam Attachments: http://www.ruby-forum.com/attachment/821/gettext_date.rb -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 4 Date: Wed, 31 Oct 2007 12:34:18 +0100 From: Samuel Lown Subject: Re: [Rails I18n] Ruby-Gettext and date/time? To: railsi18n-discussion at rubyforge.org Message-ID: <2081d507e54d95dad9bfd5355833f73c at ruby-forum.com> Content-Type: text/plain; charset=utf-8 Christian Johansen wrote: > How can I have localized dates and times using Ruby-Gettext? You can now! http://www.ruby-forum.com/topic/129944 sam -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 5 Date: Wed, 31 Oct 2007 14:01:56 +0100 From: Samuel Lown Subject: Re: [Rails I18n] Dates in Gettext To: railsi18n-discussion at rubyforge.org Message-ID: <847b09166940fb5ae262bd0abc3e9330 at ruby-forum.com> Content-Type: text/plain; charset=utf-8 Forgot to mention, the _( ) method needs to be accessible to the GettextDate library, a quick fix for this is to add the following in /config/environment.rb just after the 'gettext/rails' require. include GetText::Rails bindtextdomain('DOMAIN') require 'lib/gettext_date' DOMAIN should be replaced with your current application domain. This approach provides the _( ) method for everything, and duplicates the init_gettext call, which is a bit lame, so I'll work on doing it another way. Good for testing though! Cheers, sam -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 6 Date: Wed, 31 Oct 2007 14:41:19 +0100 From: Samuel Lown Subject: Re: [Rails I18n] Dates in Gettext To: railsi18n-discussion at rubyforge.org Message-ID: Content-Type: text/plain; charset=utf-8 Samuel Lown wrote: > > include GetText::Rails > bindtextdomain('DOMAIN') > require 'lib/gettext_date' > Scrap that, use this version instead, which automatically extends the ActionController::Base with a version of init_gettext that adds the text domain to the Conversions: http://www.samlown.com/uploads/ruby/gettext_date.rb sam. -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 7 Date: Fri, 2 Nov 2007 21:20:52 +0100 From: "Chuck R." Subject: [Rails I18n] internationalization options To: railsi18n-discussion at rubyforge.org Message-ID: <5186d516d407bd78147fa2fdb8855498 at ruby-forum.com> Content-Type: text/plain; charset=utf-8 Hi, I'm new to ruby and rails. I need support for for localized pages, pages with multilingual content, international date/time formats, and calendar and time zone calculations. Initially, I asked someone on the ICU project and they directed me to ICU4R . I thought that this was my solution until I scrolled down and found this comment: "The code is slow and inefficient yet, is still highly experimental, so can have many security and memory leaks, bugs, inconsistent documentation, incomplete test suite. Use it at your own risk." Next, I found this link: http://wiki.rubyonrails.org/rails/pages/InternationalizationComparison Globalize looks very up-to-date and well supported. And every time I ask people about internationalization options, they seem to either mention Globalize or say that they don't know. Is Globalize the most widely used option? Do people on this list recommend Globalize or other options? thanks, Chuck -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 8 Date: Mon, 5 Nov 2007 10:21:08 +0100 From: Samuel Lown Subject: Re: [Rails I18n] internationalization options To: railsi18n-discussion at rubyforge.org Message-ID: <31d809301f06f319d72d3f078f712479 at ruby-forum.com> Content-Type: text/plain; charset=utf-8 Hi Chuck, Chuck R. wrote: > > Is Globalize the most widely used option? Do people on this list > recommend Globalize or other options? > Globalize is probably is one of the most widely used solutions for internationalisation in Rails, given, as you say, it is well looked after and provides a very easy solution to integrate with your Rails project. However, I suspect most people are slightly suspicious about the way translations are handled, everything in Globalize is stored in three tables, including one master table that contains all of your translations in every language. If your into wanting to make DB access as minimal and efficient as possible, like me, then this may or may not ring bells. Personally, I now use Gettext for all of my web application texts, as its very mature and while initially it takes a bit of understanding, it offers the most complete solutions for handling strings. Having said that, I did use Globalize in one major project and it works great! One thing you should bare in mind, is the distinction between translating the application (the text in the views) and the data models. Globalize will throw these together in the same basket, but I'm not convinced this is an ideal solution. Checkout my plugin 'translate_columns' for a description of the problems and a solution that I came up with: http://samlown.com/page/RailsTranslateColumnsPluginReadme This only handles models, so you'd need to find another solution, such as globalize or gettext, for your views. I18n is quite complex, and requires a bit of thought to implement well, but stick with it, its worth the effort! Cheers, Sam -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 9 Date: Mon, 5 Nov 2007 16:39:27 +0100 From: Julio Damasceno Subject: Re: [Rails I18n] Legacy ISO-8859-1 MSSQL db and UTF8 rails app To: railsi18n-discussion at rubyforge.org Message-ID: <3e5c8c99d38a903bb47c21afd989cab0 at ruby-forum.com> Content-Type: text/plain; charset=utf-8 Tom Bak wrote: > I solved my problem with own plugin: > > recode_legacy_database :from => "ISO-8859-1", :to => "UTF-8" > > Which translates fields in models on read and before write to database. > > Cheers, > Tomasz Tom, How is the usage of this plugin? I have to run this command manual? When I have to put this code? Thanks, Julio -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 10 Date: Sat, 10 Nov 2007 02:11:15 +0100 From: Mark Chandler Subject: [Rails I18n] Problem with image_tag To: railsi18n-discussion at rubyforge.org Message-ID: <5bc00ed52ca49bd8d0f1b30bf29d4675 at ruby-forum.com> Content-Type: text/plain; charset=utf-8 I've been following a tutorial for Rails that goes through uploading images directly to databases. The problem is that using image_tag keeps automatically appending .png to the end of the address. /classified/image/9 displays the image correctly, but the image /classified/image/9.png keeps being added to the view instead. Thanks in advance! classified_controller.rb: ... def image @image = Classified.find(params[:id]) send_data @image.picture, :filename => "pic.jpg", :type => @image.content_type, :disposition => "inline" end ... show.rhtml: ... <% unless @classified.picture.blank? %> <%= image_tag(url_for({:action => 'image', :id => @classified.id})) -%> <% end %> ... -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 11 Date: Sat, 10 Nov 2007 02:12:21 +0100 From: Mark Chandler Subject: Re: [Rails I18n] Problem with image_tag To: railsi18n-discussion at rubyforge.org Message-ID: Content-Type: text/plain; charset=utf-8 Just realized I posted this in the wrong forum! Please delete! -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 12 Date: Fri, 16 Nov 2007 11:23:39 +0100 From: Johan Stille Subject: Re: [Rails I18n] removing accents from sentences (ex: url creations) - wh To: railsi18n-discussion at rubyforge.org Message-ID: <1d60ec6b8b88110005d6fdaf853cdc88 at ruby-forum.com> Content-Type: text/plain; charset=utf-8 I wrote this extension to String a long time ago. I think it does what you want. require 'iconv' class String def pretty_url Iconv.iconv("ASCII//IGNORE//TRANSLIT", "UTF-8", self).join.sanitize rescue self.sanitize end def sanitize self.gsub(/[^a-z._0-9 -]/i, "").tr(".", "_").gsub(/(\s+)/, "_").dasherize.downcase end end Thibaut Barr?re wrote: > Hi! > > I could not find it so far - but maybe rails i18n is the right list for > that > question: is there something already available somewhere in the ruby > space > to remove accents and other diacritics from a string ? (like: > translation > ?ph?m?re to ephemere, etc) > > I've seen the mephisto PermalinkFu trick (iconv from utf-8 to > ascii//ignore//translit) but it doesn't work on my workstation. > > I've attached DiacriticsFu which I wrote and is working fine for me - > I'd be > happy to find something cleaner, cross-platform, and which does not rely > on > Rails like this implementation (it would most likely work with unicode > hacks) > > any hint, comment, link, idea ? > > cheers > > Thibaut -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 13 Date: Fri, 16 Nov 2007 05:31:45 -0500 From: "Patrick Hall" Subject: Re: [Rails I18n] removing accents from sentences (ex: url creations) - wh To: railsi18n-discussion at rubyforge.org Message-ID: <6465924d0711160231p5dc6f4cfk3c717e631752ba4f at mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Hi, On Nov 16, 2007 5:23 AM, Johan Stille wrote: > require 'iconv' > > class String > def pretty_url > Iconv.iconv("ASCII//IGNORE//TRANSLIT", "UTF-8", self).join.sanitize > rescue > self.sanitize > end > > def sanitize > self.gsub(/[^a-z._0-9 -]/i, "").tr(".", "_").gsub(/(\s+)/, "_").dasherize.downcase > end > end There's a missing dasherize method here, no? -Pat ------------------------------ _______________________________________________ Railsi18n-discussion mailing list Railsi18n-discussion at rubyforge.org http://rubyforge.org/mailman/listinfo/railsi18n-discussion End of Railsi18n-discussion Digest, Vol 17, Issue 1 *************************************************** No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.33/1133 - Release Date: 15/11/2007 20:57 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.33/1133 - Release Date: 15/11/2007 20:57 From gorter9 at xs4all.nl Mon Nov 19 15:44:41 2007 From: gorter9 at xs4all.nl (GA Gorter) Date: Mon, 19 Nov 2007 21:44:41 +0100 Subject: [Rails I18n] belongs_to in a list Message-ID: I have list of blogs with usernames <% for @blogs in @blogs.reverse %> <% @user = @blogs.user %>
<%= @user.login %> but the user.login is a no method error. when i in a view of a specific blog the user.login is returned well but in the list of all blogs i have no idea to view the user.login -- Posted via http://www.ruby-forum.com/. From benjamin.meichsner at googlemail.com Wed Nov 21 17:11:32 2007 From: benjamin.meichsner at googlemail.com (Benjamin Meichsner) Date: Wed, 21 Nov 2007 23:11:32 +0100 Subject: [Rails I18n] uninitialized constant: GetText::Rails::Configuration Message-ID: <6fe3a18d083bccfb580508c1f42c08f2@ruby-forum.com> hey I'm using gettext (1.10.0) in my app (rails 1.2.5) and everything works fine except a litte action. this exception occurs, when i finish an order (were using a software to manage foodcoops) and the users should get an mail-notification. when i follow the backtrace, the error occurs in the mailer-method, which is used to build the templates: # message.rb, our mail-model # exception is raised in line 2 def self.from_template(template, vars, attributes) view = ActionView::Base.new(Rails::Configuration.new.view_path, {}, MessagesController.new) new(attributes.merge(:body => view.render(:partial => template, :locals => vars))) end I hope, you have an idea. greetings benni Attachments: http://www.ruby-forum.com/attachment/1020/uninitialized_constant.txt -- Posted via http://www.ruby-forum.com/. From revurikarna at gmail.com Thu Nov 22 06:34:49 2007 From: revurikarna at gmail.com (Athu Athu) Date: Thu, 22 Nov 2007 12:34:49 +0100 Subject: [Rails I18n] Globalize: Collection Messages In-Reply-To: <75eb46d82a4ed258435fb94c5f0c5fb8@ruby-forum.com> References: <8C79FE06-5A29-41B5-A77A-1D6643DC8578@b-simple.de> <074893060ea1875663a3e5ac65709678@ruby-forum.com> <75eb46d82a4ed258435fb94c5f0c5fb8@ruby-forum.com> Message-ID: <3dee1aafda7506a3e1d0715f7863578c@ruby-forum.com> I'm getting the following error , I have added the above method in method in application helper file and called from one of the view but got the follwoing error uninitialized constant ApplicationHelper::LOCALES Could u give me more information about it (i.e how to use it)? -- Posted via http://www.ruby-forum.com/. From shiva.98 at gmail.com Wed Nov 28 05:13:33 2007 From: shiva.98 at gmail.com (Shiva Kumaran) Date: Wed, 28 Nov 2007 11:13:33 +0100 Subject: [Rails I18n] reg : select_datetime s Message-ID: Hi, I want to display date and time. I used <%= datetime_select (:program ,:trailer_date )%> program=Program.new(params[:program]) when i save this format it is throwing error.if any one knows how to solve pls help me with regards, shiva -- Posted via http://www.ruby-forum.com/. From ben.wyrosdick at gmail.com Thu Nov 29 02:09:00 2007 From: ben.wyrosdick at gmail.com (Ben Wyrosdick) Date: Thu, 29 Nov 2007 08:09:00 +0100 Subject: [Rails I18n] globalize_countries conflict In-Reply-To: <3b1167aceff1da457ae4fa186c0a3561@ruby-forum.com> References: <21d9d82a3cd3afb8337b25c671dfe5b8@ruby-forum.com> <88687807ac87615f609151136d1692aa@ruby-forum.com> <3b1167aceff1da457ae4fa186c0a3561@ruby-forum.com> Message-ID: <2ebe0717b2d15cfe1a6f6a9991f53e8e@ruby-forum.com> I had the same problem ... I fixed it without wrapping my model in a module. http://blog.commonthread.com/2007/11/28/globalize-hijacked-my-country Philipp Hofmann wrote: > Ingo Weiss wrote: >> Thanks for the reply! I got my app working by wrapping my Country model >> in a module like this MyApp::Country, and replacing all references to >> Country with MyApp::Country. > > Hi, > > I am experiencing the same problem and havn't figured out yet how to > point a *belongs_to* to the *moduled* model. > > The obvious approach ... > > module MyApp > class Country < ActiveRecord::Base > end > end > > class Person > belongs_to :country, :class_name => 'MyApp::Country' > end > > ... sadly doesn't work. -- Posted via http://www.ruby-forum.com/.