From oksteev at gmail.com Mon Sep 4 06:48:28 2006 From: oksteev at gmail.com (steve dp) Date: Mon, 4 Sep 2006 10:48:28 +0000 (UTC) Subject: [Rails I18n] gettext speed issues Message-ID: Hi, I noticed gettext severely impacts rendering time, 3-4x slower than without. Is there any hope of a faster one in the future maybe written in C? Or any sort of support for pre-translated templates? Any help or suggestions would be greatly appreciated, Thanks! - steve dp From mutoh at highway.ne.jp Mon Sep 4 12:00:33 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Tue, 5 Sep 2006 01:00:33 +0900 Subject: [Rails I18n] gettext speed issues In-Reply-To: References: Message-ID: <20060905010033.4c4108af.mutoh@highway.ne.jp> Hi, On Mon, 4 Sep 2006 10:48:28 +0000 (UTC) steve dp wrote: > Hi, > > I noticed gettext severely impacts rendering time, 3-4x slower than without. Is > there any hope of a faster one in the future maybe written in C? Not planed. Anyway, 3-4x slower? Hmm. It's too slow. I think it's special case. > Or any sort of support for pre-translated templates? It may be better to use separate rhtml in each locales. See http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer. BTW, the next version of Ruby-GetText is faster than older version. The sample blog in Ruby-GetText is 1.96 times faster than 1.7.0 in my environment. -- .:% Masao Mutoh From dylans at gmail.com Tue Sep 5 01:21:45 2006 From: dylans at gmail.com (Dylan Stamat) Date: Mon, 4 Sep 2006 22:21:45 -0700 Subject: [Rails I18n] Indentifier name too long Message-ID: <292e73400609042221w7783f035o56375dedffed4fa2@mail.gmail.com> Running Edge (4991) and MySQL (5.0.22) ============================== When running "rake db:migrate" Mysql::Error: Identifier name 'index_globalize_translations_on_table_name_and_item_id_and_language_id' is too long: CREATE INDEX `index_globalize_translations_on_table_name_and_item_id_and_language_id` ON globalize_translations (`table_name`, `item_id`, `language_id`) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/railsi18n-discussion/attachments/20060904/ad6f776a/attachment.html From bschmeil at autoscout24.com Tue Sep 5 04:20:08 2006 From: bschmeil at autoscout24.com (Martin Bernd Schmeil) Date: Tue, 5 Sep 2006 10:20:08 +0200 Subject: [Rails I18n] Indentifier name too long In-Reply-To: <292e73400609042221w7783f035o56375dedffed4fa2@mail.gmail.com> References: <292e73400609042221w7783f035o56375dedffed4fa2@mail.gmail.com> Message-ID: Just add a :name => ?something_idx? parameter to the add_index statement. Btw. If you have the same problem with foreign_keys: 1) create an index with a shorter name 2) add_fkey ?, :name => ?something_fk?, :index => false does the trick. Also you can handle the identifier name limit for the foreign key itself and index with a possibly too long name will be auto created ?unless you use the :index => false option. On most (all?) RDBMS you need an index for foreign keys column(s) though. - Bernd -- Posted via http://www.ruby-forum.com/. From steve.odom at gmail.com Tue Sep 5 17:53:29 2006 From: steve.odom at gmail.com (Steve Odom) Date: Tue, 5 Sep 2006 16:53:29 -0500 Subject: [Rails I18n] globalize and respond_to Message-ID: <32D67F8A-1C75-42BE-81CD-641681E2ADDF@gmail.com> Has anyone using globalize tried it with a respond_to in your controller? Something like: def show @question = Question.find(1) respond_to do |type| type.html type.xml end end I started RESTifying my site and started using respond_to. I kept getting an error saying that "show.rhtml" was not found, even though it was there. If I removed the respond_to block then the show view would output correctly. I tried all sorts of things trying to figure out the problem - including changing servers many times from webbrick, to mongrel inside of locomotive and then finally to litespeed. None of that worked. I know it was something local to my site because I set up a test app and respond_to worked fine. I started stripping out all the stuff to see if that would help and that brought me to globalize. If I comment out all of the globalize stuff, then my respond_to works fine. I haven't dug in to see what could be causing it within globalize, but it definetely works without globalize and does not with globalize. Has anyone else experienced this? Thanks, Steve From pic at superfluo.org Tue Sep 5 23:49:17 2006 From: pic at superfluo.org (Nicola Piccinini) Date: Wed, 06 Sep 2006 05:49:17 +0200 Subject: [Rails I18n] globalize and respond_to In-Reply-To: <32D67F8A-1C75-42BE-81CD-641681E2ADDF@gmail.com> References: <32D67F8A-1C75-42BE-81CD-641681E2ADDF@gmail.com> Message-ID: <44FE453D.6030803@superfluo.org> yes, I copy and paste here an email I sent about 3 weeks ago to the globalize mailing list: ------------------------ Hi, I'm having problem with globalize (for-1.1, revision 199) and actionview combined with MimeResponds. This is my, hopefully not too wrong, analysis: Responders in MimeResponds ( actionpack-1.12.5/lib/action_controller/mime_responds.rb ) work rendering a template_path that includes extension, for example template.rxml, template.rhtml, etc. ActionView::Base in globalize ( globalize/lib/globalize/rails/action_view.rb ) passes this kind of templates to pick_template_extension (line 29) and this throws an exception. To workaround this problem, one can borrow code from rails 1.1 ActionView::Base#render_file and substitute if use_full_path template_extension = pick_template_extension(template_path).to_s template_file_name = full_template_path(template_path, template_extension) with if use_full_path template_extension = nil template_path_without_extension, template_extension = path_and_extension(template_path) if template_extension template_file_name = full_template_path(template_path_without_extension, template_extension) else template_extension = pick_template_extension(template_path).to_s template_file_name = full_template_path(template_path, template_extension) end This works well in controllers but, unfortunately, completely breaks the globalize action_mailer_test because of the content type "extensions" added by globalize. Example: passed value -> test.en.plain.text expected template -> test.en.plain.text.rhtml but path_and_extension cuts text and search test.en.plain.rhtml -> exception. What are your thoughts? Thanks in advance. ------------------------ Unfortunately nobody has replied :-( , anyway I suppose that you could solve your problems with the proposed modifications in globalize/lib/globalize/rails/action_view.rb By the way, to work out the consequent problems with ActionMailer, perhaps Globalize should use _ as separator, as gettext does ( http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer ) Best regards -- Nicola Piccinini -- http://superfluo.org From oksteev at gmail.com Wed Sep 6 17:42:30 2006 From: oksteev at gmail.com (steve dp) Date: Wed, 6 Sep 2006 21:42:30 +0000 (UTC) Subject: [Rails I18n] gettext speed issues References: <20060905010033.4c4108af.mutoh@highway.ne.jp> Message-ID: Masao Mutoh highway.ne.jp> writes: > > there any hope of a faster one in the future maybe written in C? > > Not planed. Sad about this :/ > BTW, the next version of Ruby-GetText is faster than older version. > The sample blog in Ruby-GetText is 1.96 times faster than 1.7.0 in my > environment. That's GREAT to hear, I'm also going to look into the Rails Template Optimizer. There might be a way to have it work with gettext so that it only actually has to run the gettext lookup once per string per template and then subsequent loads theres no more gettext() calls invovled: http://railsexpress.de/blog/articles/2006/08/15/rails-template-optimizer-beta-test comments 18 -> 21 From gregsfm at tpg.com.au Sat Sep 9 00:15:57 2006 From: gregsfm at tpg.com.au (Greg Hauptmann) Date: Sat, 9 Sep 2006 06:15:57 +0200 Subject: [Rails I18n] Most popular I18N plugin?? Which one would it be?? Message-ID: <31fca7bbd4c495ff3cf0bcbacd07253c@ruby-forum.com> Hi, Just wondering is there an obvious most popular I18N plugin that people use? e.g. the one with the most traction/development/number of releases out? Just wondering which one to dive into to. Tks -- Posted via http://www.ruby-forum.com/. From sellittf at lu.unisi.ch Sat Sep 9 14:46:28 2006 From: sellittf at lu.unisi.ch (Franco Sellitto) Date: Sat, 9 Sep 2006 20:46:28 +0200 Subject: [Rails I18n] Globalize and render_component: infinite loop? Message-ID: <20e62f8f05943b4fec10caade1f772aa@ruby-forum.com> Hi, I just installed Globalize and I'm very excited about it! Using it with the default map.connect ':controller/:action/:id' in config/routes.rb, there is no problem, but so far I set map.connect ':locale/:controller/:action/:id' to pass the language trough the URL, it seems to enter in an infine loop when I have a view with a render_component() call. For sure in both above cases, the Locale.set() is in app/controllers/application.rb. Is it an already known bug? Is there a way around? Thanks for hints -- Posted via http://www.ruby-forum.com/. From sellittf at lu.unisi.ch Mon Sep 11 17:07:45 2006 From: sellittf at lu.unisi.ch (Franco Sellitto) Date: Mon, 11 Sep 2006 23:07:45 +0200 Subject: [Rails I18n] Globalize and render_component: infinite loop? In-Reply-To: <20e62f8f05943b4fec10caade1f772aa@ruby-forum.com> References: <20e62f8f05943b4fec10caade1f772aa@ruby-forum.com> Message-ID: I found the problem. It was something else in the application.rb. Actually the map.connect ':locale/:controller/:action/:id' works very well. Bye PS: If you're in the same problem, I'll explain you how to prevent the loop. -- Posted via http://www.ruby-forum.com/. From phil.kursawe at gmail.com Tue Sep 12 15:36:04 2006 From: phil.kursawe at gmail.com (PhilK) Date: Tue, 12 Sep 2006 21:36:04 +0200 Subject: [Rails I18n] Globalize - German Month and Daynames Message-ID: <0114bc8203949fc3b0ddd58dd98fe24a@ruby-forum.com> Hello, Just wondering if there is a reason why German month- and daynames are omitted from the data/csv files to translate dates into German? Or am I just blind? Thanks, Phil -- Posted via http://www.ruby-forum.com/. From sellittf at lu.unisi.ch Wed Sep 13 03:30:36 2006 From: sellittf at lu.unisi.ch (Franco Sellitto) Date: Wed, 13 Sep 2006 09:30:36 +0200 Subject: [Rails I18n] Globalize - German Month and Daynames In-Reply-To: <0114bc8203949fc3b0ddd58dd98fe24a@ruby-forum.com> References: <0114bc8203949fc3b0ddd58dd98fe24a@ruby-forum.com> Message-ID: Hi PhilK Yor're right, there is not the translation to german. Maybe are just forgotten. -- Posted via http://www.ruby-forum.com/. From phil.kursawe at gmail.com Wed Sep 13 18:38:13 2006 From: phil.kursawe at gmail.com (PhilK) Date: Thu, 14 Sep 2006 00:38:13 +0200 Subject: [Rails I18n] Globalize - German Month and Daynames In-Reply-To: References: <0114bc8203949fc3b0ddd58dd98fe24a@ruby-forum.com> Message-ID: <61714976da098195c47a780aee72d4c0@ruby-forum.com> Franco Sellitto wrote: > Hi PhilK > > Yor're right, there is not the translation to german. > Maybe are just forgotten. Ok, I created the forgotten entries myself now and could contribute them to the project as a patch somehow? -- Posted via http://www.ruby-forum.com/. From phil.kursawe at gmail.com Wed Sep 13 18:43:55 2006 From: phil.kursawe at gmail.com (PhilK) Date: Thu, 14 Sep 2006 00:43:55 +0200 Subject: [Rails I18n] How to Globalize using variants of templates? In-Reply-To: <4f428e7b0607260650o38a19f6an56aa6dd422b7ecf7@mail.gmail.com> References: <4f428e7b0607260650o38a19f6an56aa6dd422b7ecf7@mail.gmail.com> Message-ID: Yash Ganthe wrote: > However, in case of some languages like Arabic, the entire layout of > all pages will have to be changed. The RHTMLs themselves will have to > be different. This may also be the case for some other languages for > which the static text does not align properly and we are forced to > create still more variants of the RHTMLs. Layouts could be switched depending on the Locale.language.direction field. Usally its "ltr" and if it is "rtl" you could load a different set of stylesheets using a before_filter in your ApplicationController. > How do we make sure our application has a set of default templates > that are used if the corresponding localized templates are not > present? > Is there something we need to do in routes.rb? > How will Rails locate the template to be used for rendering? Globalize tries to find templates by the current set locale in that format: ..rhtml If it does not find a file matching that convention, then it just uses the .rhtml file. -- Posted via http://www.ruby-forum.com/. From scruffytech at gmx.net Thu Sep 14 03:44:56 2006 From: scruffytech at gmx.net (Helmut Ziegler) Date: Thu, 14 Sep 2006 09:44:56 +0200 Subject: [Rails I18n] globalize server down Message-ID: <6C0FFB6A-5FD4-40B5-B702-9620CD289A74@gmx.net> Hi, since yesterday the server of globalize-rails.org seems to be down. Does anyone know if it has moved to another url or when it will be online again? I'd like to check out globalize for rails 1.1. Cheers, Helmut From joshmh at gmail.com Thu Sep 14 09:02:25 2006 From: joshmh at gmail.com (Joshua Harvey) Date: Thu, 14 Sep 2006 16:02:25 +0300 Subject: [Rails I18n] globalize server down In-Reply-To: <6C0FFB6A-5FD4-40B5-B702-9620CD289A74@gmx.net> References: <6C0FFB6A-5FD4-40B5-B702-9620CD289A74@gmx.net> Message-ID: <3527dd260609140602j2a00f402r8ced541221e5e07f@mail.gmail.com> I just contacted the guys at Planet Argon who host the site, they're looking into it. -- Josh On 9/14/06, Helmut Ziegler wrote: > > Hi, > > since yesterday the server of globalize-rails.org seems to be down. > Does anyone know if it has moved to another url or when it will be > online again? > I'd like to check out globalize for rails 1.1. > > Cheers, > Helmut > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/railsi18n-discussion/attachments/20060914/13ab6be3/attachment.html From joshmh at gmail.com Thu Sep 14 14:05:17 2006 From: joshmh at gmail.com (Joshua Harvey) Date: Thu, 14 Sep 2006 21:05:17 +0300 Subject: [Rails I18n] globalize server down In-Reply-To: <6C0FFB6A-5FD4-40B5-B702-9620CD289A74@gmx.net> References: <6C0FFB6A-5FD4-40B5-B702-9620CD289A74@gmx.net> Message-ID: <3527dd260609141105g4f66f187w993dd432ae1640df@mail.gmail.com> Back up. -- Josh On 9/14/06, Helmut Ziegler wrote: > > Hi, > > since yesterday the server of globalize-rails.org seems to be down. > Does anyone know if it has moved to another url or when it will be > online again? > I'd like to check out globalize for rails 1.1. > > Cheers, > Helmut > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/railsi18n-discussion/attachments/20060914/4cac0a04/attachment.html From iannehkg at yahoo.com.hk Fri Sep 15 05:47:24 2006 From: iannehkg at yahoo.com.hk (Ianne Leson) Date: Fri, 15 Sep 2006 11:47:24 +0200 Subject: [Rails I18n] Can javascript be localized using globalize, gloc, ... Message-ID: or other localization method? -- Posted via http://www.ruby-forum.com/. From mutoh at highway.ne.jp Mon Sep 18 03:23:34 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Mon, 18 Sep 2006 16:23:34 +0900 Subject: [Rails I18n] Rails Engine localization with Ruby-GetText Message-ID: <20060918162334.5ce785cb.mutoh@highway.ne.jp> Hi, Recently, some people ask me for the l10n of Engines with gettext. So I wrote a HOWTO for it. http://www.yotabanana.com/hiki/?ruby-gettext-howto-engines And I localized login_engine for an example. It includes English and Japanese messages. http://www.yotabanana.com/hiki/?c=plugin;plugin=attach_download;p=ruby-gettext-howto-engines;file_name=login_engine_v1.0.2.gettext.tar.gz HTH, -- .:% Masao Mutoh From registrera at gmail.com Wed Sep 27 10:31:27 2006 From: registrera at gmail.com (Daniel Sa) Date: Wed, 27 Sep 2006 16:31:27 +0200 Subject: [Rails I18n] Are id-based keys possible with Globalize? Message-ID: <4825c370fa8bcc95d871927dbe02e633@ruby-forum.com> Is my understanding correct that Globalize use the base language string as the key when looking up translations? Example: class Product < ActiveRecord::Base translates :name end Locale.set_base_language('en-US') Locale.set('en-US') # Add my first product Product.create!(:name => 'foo') # Add another product Product.create!(:name => 'foo') Locale.set('es-ES') # Get my first product and translate it prod = Product.find(1) prod.name = 'bar' prod.save # Now the other product will already be translated? prod = Product.find(2) prod.name -> 'bar' I have a couple of use cases where this isn't a desired behaviour: 1. Synonymes in the base language I have several totally different products that share the same name but they would be translated different since they are not synonymes in the other language. (Think of the word "plane".) 2. Synonymes in the other language Users define their own terms which they then translate, and even though they mean the same thing, they prefer different translations. When one user translates his product (or whatever), the other users product shouldn't be affected. I currently have a problem like use case two, and am looking for a solution. Would it be possible/doable to tweak Globalize to use some kind of string_id's instead of the actual strings when looking up the translations, while preserving the assumed seamless integration (avoiding creating extra fields in the db for the models)? Is there any other existing solution to this? Any suggestions/ideas how this could be implemented if I would have to roll my own? -- Posted via http://www.ruby-forum.com/.