From dhaval.internship at drupaldesigns.com Wed Oct 3 06:12:04 2007 From: dhaval.internship at drupaldesigns.com (Dhaval Parikh) Date: Wed, 3 Oct 2007 12:12:04 +0200 Subject: [Rails I18n] write insert query in views Message-ID: Hello frnds Is there any method to write the insert query in the .rhtml file (eg: -list.rhtml). If so please do let me know. Thanks Dhaval Parikh -- Posted via http://www.ruby-forum.com/. From basic70 at gmail.com Thu Oct 4 02:03:20 2007 From: basic70 at gmail.com (Daniel Brahneborg) Date: Thu, 4 Oct 2007 08:03:20 +0200 Subject: [Rails I18n] write insert query in views In-Reply-To: References: Message-ID: You really, really, don't want to do this. Fetching data directly from the views is bad, and storing data is even worse. Do all the database stuff in your controller. That way the view becomes simpler, and your code becomes testable. Regards, /Daniel On 10/3/07, Dhaval Parikh wrote: > Hello frnds > > Is there any method to write the insert query in the .rhtml file (eg: > -list.rhtml). If so please do let me know. > > Thanks > > Dhaval Parikh > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > From dhaval.internship at drupaldesigns.com Thu Oct 4 05:02:39 2007 From: dhaval.internship at drupaldesigns.com (Dhaval Parikh) Date: Thu, 4 Oct 2007 11:02:39 +0200 Subject: [Rails I18n] write insert query in views In-Reply-To: References: Message-ID: <3956f177d93bd8cd4f7211f000b021d0@ruby-forum.com> well yes I know that but i actually want to do this while listing of the values.. in my list.rhtml i m having @email which is storing email addresses so i want to store those into my db how could i do that? please let me know... thanks -- Posted via http://www.ruby-forum.com/. From stephan.oehlert at gmx.net Thu Oct 4 05:51:44 2007 From: stephan.oehlert at gmx.net (Stephan Oehlert) Date: Thu, 4 Oct 2007 11:51:44 +0200 Subject: [Rails I18n] Gettext error_messages_for problem In-Reply-To: <960e4c87d624286e826c9e23268150b3@ruby-forum.com> References: <960e4c87d624286e826c9e23268150b3@ruby-forum.com> Message-ID: Can someone confirm that this solution works? I have run into this problem as well and can't get it to work yet. I use Rails 1.2.3, Ruby 1.8.6. Except for this problem, Gettext works well with rails. The problem is: TypeError: can't convert Array into String /opt/local/lib/ruby/gems/1.8/gems/gettext-1.10.1/lib/gettext/active_record.rb:243:in `=~' /opt/local/lib/ruby/gems/1.8/gems/gettext-1.10.1/lib/gettext/active_record.rb:243:in `localize_error_message' /opt/local/lib/ruby/gems/1.8/gems/gettext-1.10.1/lib/gettext/active_record.rb:242:in `each' /opt/local/lib/ruby/gems/1.8/gems/gettext-1.10.1/lib/gettext/active_record.rb:242:in `localize_error_message' /opt/local/lib/ruby/gems/1.8/gems/gettext-1.10.1/lib/gettext/active_record.rb:273:in `localize_error_messages' [...] Thanks a lot -- Posted via http://www.ruby-forum.com/. From summercoolness at gmail.com Sun Oct 14 08:46:51 2007 From: summercoolness at gmail.com (SpringFlowers AutumnMoon) Date: Sun, 14 Oct 2007 14:46:51 +0200 Subject: [Rails I18n] how to glob with international or unicode file names? Message-ID: <7bdadc299f8143e9eb55a283307a44cc@ruby-forum.com> with the Dir[" path "] or Dir.glob is it possible to glob the filenames with unicode or international characters in it? Right now it is returning ????????.mp3 to test it, you can grab some international characters at http://news.google.com/news?ned=hk -- Posted via http://www.ruby-forum.com/. From yfshoe1 at hotmail.com Thu Oct 18 09:46:24 2007 From: yfshoe1 at hotmail.com (Libing Lin) Date: Thu, 18 Oct 2007 15:46:24 +0200 Subject: [Rails I18n] hot sell nike jordan puma af1 air max nike shox etc Message-ID: hi,my dear friends, thank you for reading my message! i am a professional and honest wholesaler of all kinds of brand sneaks and apparel. at present,my company provied some lastest style shoes and clothes,and other products. in order to acquaint you with a general idea of the various kinds of our products. i enclose my website for your reference:www.yfshoe.cn what do you like to? all kind of the brand shoes? nice clothes? different hat/bags?sunglasses? come on!! contact me !! Email:yfshoe1 at gmail.com MSN:yfshoe1 at hotmail.com -- Posted via http://www.ruby-forum.com/. From me at samlown.com Tue Oct 23 06:14:17 2007 From: me at samlown.com (Samuel Lown) Date: Tue, 23 Oct 2007 12:14:17 +0200 Subject: [Rails I18n] Gettext's Locale class in application namespace Message-ID: Hi, I've been trying to use Gettext with one my web applications. I've used Gettext many times in the past without problems and appreciate it greatly. In this particular instance, my web application has its own ActiveRecord Locale model which I use to store the locales the application will support. (I prefer to use Locale for the user interface, and Language for the language a model is available in; a subtle but important difference.) The problem with Gettext in this situation however, is that it provides its own Locale class in the application namespace instead of something like Gettext::Locale. This conflicts with my Locale model, preventing things from working. Globalize also provides its own Locale class, but sensibly inside the Globalize module's namespace, i.e. Globalize::Locale so that it doesn't cause any problems. I would like to ask for any opinions on this matter, to see if anyone else agrees that Gettext's Locale *should* be inside the Gettext module. I'd also be interested in any recommendations for alternative methods, other than renaming my Locale model to something else which is the most obvious! Thanks in advance, Cheers, Sam Lown -- Posted via http://www.ruby-forum.com/. From rochkind at jhu.edu Thu Oct 25 13:30:48 2007 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Thu, 25 Oct 2007 19:30:48 +0200 Subject: [Rails I18n] unicode categories in regexps? Message-ID: <0debd6023fcfa4e0ef00f2e0cb3db687@ruby-forum.com> 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/. From me at samlown.com Sun Oct 28 06:58:25 2007 From: me at samlown.com (Samuel Lown) Date: Sun, 28 Oct 2007 11:58:25 +0100 Subject: [Rails I18n] Gettext's Locale class in application namespace In-Reply-To: References: Message-ID: <25f6700d7dbb8e9e84b29cb776175638@ruby-forum.com> 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/. From me at samlown.com Wed Oct 31 07:25:10 2007 From: me at samlown.com (Samuel Lown) Date: Wed, 31 Oct 2007 12:25:10 +0100 Subject: [Rails I18n] Dates in Gettext Message-ID: 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/. From me at samlown.com Wed Oct 31 07:34:18 2007 From: me at samlown.com (Samuel Lown) Date: Wed, 31 Oct 2007 12:34:18 +0100 Subject: [Rails I18n] Ruby-Gettext and date/time? In-Reply-To: <4bb8d814f55c92fff6c261226228ce87@ruby-forum.com> References: <4bb8d814f55c92fff6c261226228ce87@ruby-forum.com> Message-ID: <2081d507e54d95dad9bfd5355833f73c@ruby-forum.com> 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/. From me at samlown.com Wed Oct 31 09:01:56 2007 From: me at samlown.com (Samuel Lown) Date: Wed, 31 Oct 2007 14:01:56 +0100 Subject: [Rails I18n] Dates in Gettext In-Reply-To: References: Message-ID: <847b09166940fb5ae262bd0abc3e9330@ruby-forum.com> 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/. From me at samlown.com Wed Oct 31 09:41:19 2007 From: me at samlown.com (Samuel Lown) Date: Wed, 31 Oct 2007 14:41:19 +0100 Subject: [Rails I18n] Dates in Gettext In-Reply-To: <847b09166940fb5ae262bd0abc3e9330@ruby-forum.com> References: <847b09166940fb5ae262bd0abc3e9330@ruby-forum.com> Message-ID: 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/.