From rails at gauffin.org Sun Jul 1 07:36:24 2007 From: rails at gauffin.org (Jonas) Date: Sun, 1 Jul 2007 13:36:24 +0200 Subject: [Rails I18n] DateFields and ActiveRecords Message-ID: <213941ba509b2c43371b2fd14c95551a@ruby-forum.com> Here is some typical code, right? <% for column in User.visible_columns true %> <%= column.human_name %> <%=h @user.send(column.name) %> <% end %> I want to customize how the date is formatted for timestamps. How do I do that? (I want the code above to automatically use my new format for timestamp/datetime columns) -- Posted via http://www.ruby-forum.com/. From railsgeek at gmail.com Mon Jul 2 07:52:43 2007 From: railsgeek at gmail.com (Moises Deniz) Date: Mon, 2 Jul 2007 13:52:43 +0200 Subject: [Rails I18n] DateFields and ActiveRecords In-Reply-To: <213941ba509b2c43371b2fd14c95551a@ruby-forum.com> References: <213941ba509b2c43371b2fd14c95551a@ruby-forum.com> Message-ID: > > <% for column in User.visible_columns true %> > > <%= column.human_name %> > <%=h @user.send(column.name) %> > > <% end %> > > I want to customize how the date is formatted for timestamps. How do I > do that? (I want the code above to automatically use my new format for > timestamp/datetime columns) Try modifing the DATE_FORMATS[:db] constant with your own format... you can see at: http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Time/Conversions.html -- Posted via http://www.ruby-forum.com/. From no at valid.address Wed Jul 4 11:32:35 2007 From: no at valid.address (Stim) Date: Wed, 4 Jul 2007 17:32:35 +0200 Subject: [Rails I18n] Globalize: Collection Messages In-Reply-To: <074893060ea1875663a3e5ac65709678@ruby-forum.com> References: <8C79FE06-5A29-41B5-A77A-1D6643DC8578@b-simple.de> <074893060ea1875663a3e5ac65709678@ruby-forum.com> Message-ID: <75eb46d82a4ed258435fb94c5f0c5fb8@ruby-forum.com> Thank you for your contribution Eduard. I am saving myself pretty some work using it. Still, I have (tried to have) improve your code a little, mainly the regexp: def harvest @strs = [] allowed = ' \w0-9%:;@&#<>\/\\\?\!\+\)\(-=\*' regexp = Regexp.new('[\"](['+allowed+'\']*)[\"]\.t|[\'](['+allowed+'\"]*)[\']\.t') Dir.glob("#{RAILS_ROOT}/app/views/**/*.rhtml").collect do |f| @strs << File.read(f).scan(regexp) end @new_strs=Array.new @strs=@strs.flatten.uniq 0.upto @strs.size-1 do |i| if @strs[i] then @strs[i].each do |str| @new_strs << str end end end @strs = [] Dir.glob("#{RAILS_ROOT}/app/controllers/**/*.rb").collect do |f| @strs << File.read(f).scan(regexp) end @strs=@strs.flatten.uniq 0.upto @strs.size-1 do |i| if @strs[i] then @strs[i].each do |str| @new_strs << str end end end @new_strs=@new_strs.uniq.sort LOCALES.each do |key,loc| Locale.set loc @new_strs.each do |str| str.to_s.translate end ActiveRecord::Errors.default_error_messages.each_value do |error_msg| error_msg.translate end end end -- Posted via http://www.ruby-forum.com/. From pathall at gmail.com Wed Jul 4 18:40:08 2007 From: pathall at gmail.com (Patrick Hall) Date: Wed, 4 Jul 2007 19:40:08 -0300 Subject: [Rails I18n] CLDR and Globalize Message-ID: <6465924d0707041540o28476245sf15d2688b98c35d8@mail.gmail.com> Hi folks, I have been digging around in various i18n packages, and so far my team is leaning toward Globalize, it seems like an active and usable project. Question: How is the data in globalize/trunk/data/ populated? I'm not sure if this has been discussed in this list, but there is a huge amount of localization information in the Common Locale Data Repository (CLDR): http://www.unicode.org/cldr/ (Not only is the data extensive, it's also localized into several languages -- you can get at how to say "Japanese" in Spanish, "Russia" in Swahili, etc.) It seems like tracking the data in CLDR would be much easier to maintain than trying to maintain the data just for the Globalize project. Best regards, Pat Hall From chenhui0594 at hotmail.com Fri Jul 13 10:30:47 2007 From: chenhui0594 at hotmail.com (Chen Hui) Date: Fri, 13 Jul 2007 16:30:47 +0200 Subject: [Rails I18n] shox Message-ID: <9271b18caff18dbebe638d7c91e3ca8e@ruby-forum.com> Dear my friend It is our pleasure to meet you here. We are professional and honest wholesaler of all kinds of brand sneaks and apparel.the products our company supply are as follows: 1.jordan1-21shoes 2.airmax(95/97/360/2003/TN?)shoes 3.airforce1(airforce1/bape/dunk?)shoes 4.shox(R3/R4/NZ/turbo/t13/monster?)shoes 5.puma/prada/timberland/rift/adidas shoes 6.fashion branded hoodies/jeans/caps/handbag/t-shirts and others 7.because the space of the website is limited,we can also supply many other products which be not showed out in our site. if you have the photos of the products you need , we are pleasure to supply for your orders. And our company can supply for our customers ,as follow: 1. top quality.all our products have top quality. 2. most rational price.we will give you best price according to your ordering quatity and the place you are at. 3. safe and fast shipment. As different country you are in, we will deliver the products to you by different ways and pledge to arrive to your address 100%.and we will send the products to you within 24h after we get your payment. 4.many products in stock. We have many products in stock and kinds of size you need , also include kid?s. 5.our credit. If the products can be not delivered to your address as our reason, we will refund the money you paid. Hope sincerely to have glad and long term business relationship with you. If you are interested in our products and have any problem, welcome to contact us. Please trust us , we will be your best choice !!! web:www.lovbiz.com E-mail /msn:chenhui0594 at hotmail.com waiting for your reply,thank u -- Posted via http://www.ruby-forum.com/. From rogovskiy at gmail.com Fri Jul 20 19:24:24 2007 From: rogovskiy at gmail.com (Test Test) Date: Sat, 21 Jul 2007 01:24:24 +0200 Subject: [Rails I18n] how to detect translated fields? In-Reply-To: <6b6419750706080947y7e172a34o289d6742cb4e6630@mail.gmail.com> References: <6b6419750706080947y7e172a34o289d6742cb4e6630@mail.gmail.com> Message-ID: <28b694fead0126f2662dceb75fa7b27c@ruby-forum.com> Patrick Aljord wrote: > Hey all, > I use globalize intern translation like this: > > class Media < ActiveRecord::Base > self.keep_translations_in_model = true > translates :name, :base_as_default => true > end > > and I use it for several models. Is there a globalize function that > returns all the translated fields of a given model? > Also, is there a function that returns the array of all the defined > language in environment.rb? > I don't know - ask somebody else. -- Posted via http://www.ruby-forum.com/. From rogovskiy at gmail.com Fri Jul 20 19:25:02 2007 From: rogovskiy at gmail.com (Test Test) Date: Sat, 21 Jul 2007 01:25:02 +0200 Subject: [Rails I18n] how to detect translated fields? In-Reply-To: <28b694fead0126f2662dceb75fa7b27c@ruby-forum.com> References: <6b6419750706080947y7e172a34o289d6742cb4e6630@mail.gmail.com> <28b694fead0126f2662dceb75fa7b27c@ruby-forum.com> Message-ID: <76ad5ab46b129ff46a0f9a6967777697@ruby-forum.com> >> class Media < ActiveRecord::Base >> self.keep_translations_in_model = true >> translates :name, :base_as_default => true >> end >> >> and I use it for several models. Is there a globalize function that >> returns all the translated fields of a given model? >> Also, is there a function that returns the array of all the defined >> language in environment.rb? >> > > > I don't know - ask somebody else. Test -- Posted via http://www.ruby-forum.com/.