From japgolly at gmail.com Thu Mar 1 18:20:19 2007 From: japgolly at gmail.com (David Barri) Date: Fri, 2 Mar 2007 10:20:19 +1100 Subject: [Rails I18n] Localisation - Looking for a straight-forward solution In-Reply-To: <164b94aa3903610b0c055f3634132902@ruby-forum.com> References: <32720c09d6fa6737fb6147ab35a9fbcb@ruby-forum.com> <91a4a380110145810e8fb7120d4998e4@ruby-forum.com> <66a99f9e9fb18d0111af7276aec51b50@ruby-forum.com> <164b94aa3903610b0c055f3634132902@ruby-forum.com> Message-ID: You'll have to look up the rails api or google it but i remember that methods like cache(), expire_fragment(), cache_page() accept url_for params. I'd give u more help but I've been programming in Java for the last month or two so it feels like a while since I touched ruby on rails. Golly On 28/02/07, David Scheffel wrote: > I have no idea. Actually I'm using the RESTful versions. Therefore the > cache is organised like > /tmp//:resource/:id/:sub_resource/:id.cache > > How can the url_for modify the cache-filename? > > THX > David > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > From joost at swx.nl Mon Mar 5 10:45:24 2007 From: joost at swx.nl (joost) Date: Mon, 5 Mar 2007 16:45:24 +0100 Subject: [Rails I18n] globalize or gettext? In-Reply-To: <6b6419750610281224j44619c64u3e15fd3177a54837@mail.gmail.com> References: <6b6419750610281224j44619c64u3e15fd3177a54837@mail.gmail.com> Message-ID: <440b2a6b8536a6daf98ff933715bf525@ruby-forum.com> Hi Patrick, Did you find an answer yet? -- Posted via http://www.ruby-forum.com/. From lajanus at o2.pl Thu Mar 8 09:50:29 2007 From: lajanus at o2.pl (Linus) Date: Thu, 8 Mar 2007 15:50:29 +0100 Subject: [Rails I18n] Encoding problem - how to debug? Message-ID: <316f61e6da4bfb138b3f973c5221f5e0@ruby-forum.com> When I put character "?" in the search input page, I get the falowing in the logs: Processing SearchController#index (for 127.0.0.1 at 2007-03-08 15:36:18) [POST] Session ID: f3e7710bce35c8ca7476b7829e8a801d Parameters: {"action"=>"index", "controller"=>"search", "query"=>"??", "model"=>{"name"=>"pages"}} The query string is incorrectly encoded, or maybe the log file is incorectly encoded? Nevertheless, then I pass that string to ferret, I get incorrect results (the database is inported from other system and is 100% correct encoded). I can not debug the reason for this happening. I use ruby 1.8.5, rails-1.2.2. I have headers["Content-Type"] ||= "text/html; charset=UTF-8" and page encoding set to UTF8. Any ideas how to debug what is the problem? Best regards, Tom -- Posted via http://www.ruby-forum.com/. From a at rails.com Fri Mar 9 11:39:48 2007 From: a at rails.com (Monkey) Date: Fri, 9 Mar 2007 17:39:48 +0100 Subject: [Rails I18n] is globalize rails 1.2 ready? In-Reply-To: <6b6419750702151002u79bbf9a7scf1048ae8a3ca68f@mail.gmail.com> References: <6b6419750702151002u79bbf9a7scf1048ae8a3ca68f@mail.gmail.com> Message-ID: <7fa5233aeab50f0bbfb24f1d09175eec@ruby-forum.com> Patrick Aljord wrote: > does anyone know if globalize works with rails 1.2? > > thanx in advance > > Pat Yes, According to this : http://www.globalize-rails.org/globalize/ Globalize for Rails 1.2 released! -- Posted via http://www.ruby-forum.com/. From raff_uk at hotmail.com Tue Mar 20 05:34:23 2007 From: raff_uk at hotmail.com (Rafael Vieira) Date: Tue, 20 Mar 2007 10:34:23 +0100 Subject: [Rails I18n] Globalize and Pluralization Rules In-Reply-To: <44EE1133.4090204@rt.sk> References: <44EE1133.4090204@rt.sk> Message-ID: Ondrej Jaura wrote: > Hello, > > Please, where to find some examples how to use pluralization rules in > Globalize? > > I would like to see how to use it also for languages such as Slovak or > Polish, where the rules are slightly more complicated. > e.g. > english: one, more > slovak: one, two...four, five and more > > > Thanks. > > Greetings, > > Ondrej Hello Ondrej, Im looking for a Ruby programmer to work in Brastislava. Please let me know if your are interested or if you know someone. Thank you and sorry for any inconvenience. Rafael Vieira - IM: raff_uk at hotmail.com -- Posted via http://www.ruby-forum.com/. From isak.hansen at gmail.com Mon Mar 26 09:40:21 2007 From: isak.hansen at gmail.com (Isak Hansen) Date: Mon, 26 Mar 2007 15:40:21 +0200 Subject: [Rails I18n] L10n of numbers (i.e. decimal point) Message-ID: <6b9e1eb20703260640i3802060ag30b50caae61e0744@mail.gmail.com> We need localized number format support in our application, in the very least being able to parse the native decimal point for numeric (Float and BigDecimal) fields. I've been spending some time looking at various plugins that do something with number L10n , but as far as I can tell most won't do form IO. Some probably can, i.e. Globalize, but I can't make heads & tails of the source. We already use gettext for translation, so a plugin which just does the number work would be ideal. I am prepared to roll my own, but would need a little help getting started in that case. "Look at the globalize source" isn't specific enough - I'd need something along the lines of: "for input, hook/override methods ... of modules/classes ... , for output override the ror helpers", or whatever.. Thanks in advance, Isak From sunzhoujian at gmail.com Tue Mar 27 19:05:27 2007 From: sunzhoujian at gmail.com (Sun Zhoujian) Date: Wed, 28 Mar 2007 01:05:27 +0200 Subject: [Rails I18n] Easy Puzzle Mountain problem Message-ID: <612f46cfd17f46b384849a070fea1166@ruby-forum.com> Hello everyone, Did you guys work on UTF-8 before? If so, could you take a look at the problem below. I'd like to hear your thoughts about tackling this kind of problems. It is about the software internalization. I couldn't find the specific group to ask, so I ask here and I hope you don't mind. //////////////////////////////////// ////////////// //////////// Easy Puzzle Mountain Part 1: How many bytes long is the sequence for the code point whose UTF-8 representation begins with 0xE3? Part 2: 0xA9 0xE3 0xB4 0xB1 0x54 0x98 0xB4 0x77 0x88 0x01 0xB2 0x8E 0x5D 0xAA 0xBB 0x66 0x9A 0xC4 0xB2 0x3F 0x8C 0xA3 0xDF 0xA0 0x90 0x4A 0x83 0x90 0x00 0xA2 0xA7 0x94 0x83 0x5C 0x5B 0x86 0x91 0xBF 0xAA 0x60 0xA1 0x47 0x89 0xB2 0xC4 0x89 0x50 0x99 -- Posted via http://www.ruby-forum.com/. From rubyforum.moriz at spamgourmet.com Thu Mar 29 13:07:55 2007 From: rubyforum.moriz at spamgourmet.com (Roland) Date: Thu, 29 Mar 2007 19:07:55 +0200 Subject: [Rails I18n] GetText doesn't work in ActionMailer In-Reply-To: <20061201130921.d182f5fb.mutoh@highway.ne.jp> References: <35f335a949791bfaf3e50642b8628a12@ruby-forum.com> <20060815003514.61edd209.mutoh@highway.ne.jp> <5674aa149ffd87e22032d299c8452a9b@ruby-forum.com> <20061129084058.708baeea.mutoh@highway.ne.jp> <003b94b071fcdfef5beb9d2bdadf467e@ruby-forum.com> <20061201014027.cba671f9.mutoh@highway.ne.jp> <13cce36bfe8de635ee153f8db19b93ff@ruby-forum.com> <0dd482ea704e43b14da716a757e80490@ruby-forum.com> <20061201130921.d182f5fb.mutoh@highway.ne.jp> Message-ID: <8739acb378018bd7f5a9fb58e11e980f@ruby-forum.com> This problem is still existant with Rails 1.2.3 and gettext 1.9.0. Strings in ActionMailer don't get translated with the _() method, they don't appear at all (not even the base language). This is very annoying because it forces me to hardcode all text blurbs in language dependent files (that works as reported before) e.g. text_en.rhtml, text_de.rhtml, ... Is there maybe a way to fix it? thank you in advance, best regards -- Posted via http://www.ruby-forum.com/. From myko at PureNetworks.com Thu Mar 29 14:27:56 2007 From: myko at PureNetworks.com (Myk O'Leary) Date: Thu, 29 Mar 2007 11:27:56 -0700 Subject: [Rails I18n] GetText doesn't work in ActionMailer In-Reply-To: <8739acb378018bd7f5a9fb58e11e980f@ruby-forum.com> References: <35f335a949791bfaf3e50642b8628a12@ruby-forum.com><20060815003514.61edd209.mutoh@highway.ne.jp><5674aa149ffd87e22032d299c8452a9b@ruby-forum.com><20061129084058.708baeea.mutoh@highway.ne.jp><003b94b071fcdfef5beb9d2bdadf467e@ruby-forum.com><20061201014027.cba671f9.mutoh@highway.ne.jp><13cce36bfe8de635ee153f8db19b93ff@ruby-forum.com><0dd482ea704e43b14da716a757e80490@ruby-forum.com><20061201130921.d182f5fb.mutoh@highway.ne.jp> <8739acb378018bd7f5a9fb58e11e980f@ruby-forum.com> Message-ID: <2A5AA1691961974DB645DC90898A8E4902034CFB@ex01.PureNetworks.com> There are plenty of issues if you try to do this with ActionMailer in places like LoginEngine, etc; however, if you create a mailer in your root app, it does it mighty fine with no hassles. $RAILS_ROOT> script/generate mailer Mailer This will create a file RAILS_ROOT/app/model/mailer.rb Use the _() in this new model after setting your locale, just as in a controller. Other benefits include much easier sweeping of the tagged strings into your stock .po files. --- Myk Oleary Web Services Developer Pure Networks myko at purenetworks.com -----Original Message----- From: railsi18n-discussion-bounces at rubyforge.org [mailto:railsi18n-discussion-bounces at rubyforge.org] On Behalf Of Roland Sent: Thursday, March 29, 2007 10:08 AM To: railsi18n-discussion at rubyforge.org Subject: Re: [Rails I18n] GetText doesn't work in ActionMailer This problem is still existant with Rails 1.2.3 and gettext 1.9.0. Strings in ActionMailer don't get translated with the _() method, they don't appear at all (not even the base language). This is very annoying because it forces me to hardcode all text blurbs in language dependent files (that works as reported before) e.g. text_en.rhtml, text_de.rhtml, ... Is there maybe a way to fix it? thank you in advance, best regards -- Posted via http://www.ruby-forum.com/. _______________________________________________ Railsi18n-discussion mailing list Railsi18n-discussion at rubyforge.org http://rubyforge.org/mailman/listinfo/railsi18n-discussion From rubyforum.moriz at spamgourmet.com Fri Mar 30 09:33:21 2007 From: rubyforum.moriz at spamgourmet.com (Roland) Date: Fri, 30 Mar 2007 15:33:21 +0200 Subject: [Rails I18n] GetText doesn't work in ActionMailer In-Reply-To: <2A5AA1691961974DB645DC90898A8E4902034CFB@ex01.PureNetworks.com> References: <35f335a949791bfaf3e50642b8628a12@ruby-forum.com> <20060815003514.61edd209.mutoh@highway.ne.jp> <5674aa149ffd87e22032d299c8452a9b@ruby-forum.com> <20061129084058.708baeea.mutoh@highway.ne.jp> <003b94b071fcdfef5beb9d2bdadf467e@ruby-forum.com> <20061201014027.cba671f9.mutoh@highway.ne.jp> <13cce36bfe8de635ee153f8db19b93ff@ruby-forum.com> <0dd482ea704e43b14da716a757e80490@ruby-forum.com> <20061201130921.d182f5fb.mutoh@highway.ne.jp> <8739acb378018bd7f5a9fb58e11e980f@ruby-forum.com> <2A5AA1691961974DB645DC90898A8E4902034CFB@ex01.PureNetworks.com> Message-ID: <0a42cc3e33d571da31598498c7273d09@ruby-forum.com> Myk O'Leary wrote: > This will create a file RAILS_ROOT/app/model/mailer.rb > > Use the _() in this new model after setting your locale, just as in a > controller. Looks like a misunderstanding: The problem is that the _() does not work in rhtml templates used by ActionMailer. e.h mailer_template.rthml <%= _("string") %> => nothing -- Posted via http://www.ruby-forum.com/. From myko at purenetworks.com Fri Mar 30 10:16:12 2007 From: myko at purenetworks.com (Myk OLeary) Date: Fri, 30 Mar 2007 07:16:12 -0700 Subject: [Rails I18n] GetText doesn't work in ActionMailer In-Reply-To: <0a42cc3e33d571da31598498c7273d09@ruby-forum.com> References: <35f335a949791bfaf3e50642b8628a12@ruby-forum.com> <0a42cc3e33d571da31598498c7273d09@ruby-forum.com> Message-ID: <1175264176.340B7CE9@ff1.dngr.org> Making a mailer in your root application solves that issue as well. The .rhtml I'm using is full of _() that work fine. -Myk On Fri, 30 Mar 2007 6:58 am, Roland wrote: > Myk O'Leary wrote: > >> This will create a file RAILS_ROOT/app/model/mailer.rb >> >> Use the _() in this new model after setting your locale, just as in a >> controller. > > Looks like a misunderstanding: The problem is that the _() does not > work > in rhtml templates used by ActionMailer. --From the road on my Sidekick From rubyforum.moriz at spamgourmet.com Fri Mar 30 11:54:55 2007 From: rubyforum.moriz at spamgourmet.com (Roland) Date: Fri, 30 Mar 2007 17:54:55 +0200 Subject: [Rails I18n] GetText doesn't work in ActionMailer In-Reply-To: <1175264176.340B7CE9@ff1.dngr.org> References: <35f335a949791bfaf3e50642b8628a12@ruby-forum.com> <20060815003514.61edd209.mutoh@highway.ne.jp> <5674aa149ffd87e22032d299c8452a9b@ruby-forum.com> <20061129084058.708baeea.mutoh@highway.ne.jp> <003b94b071fcdfef5beb9d2bdadf467e@ruby-forum.com> <20061201014027.cba671f9.mutoh@highway.ne.jp> <13cce36bfe8de635ee153f8db19b93ff@ruby-forum.com> <0dd482ea704e43b14da716a757e80490@ruby-forum.com> <20061201130921.d182f5fb.mutoh@highway.ne.jp> <8739acb378018bd7f5a9fb58e11e980f@ruby-forum.com> <2A5AA1691961974DB645DC90898A8E4902034CFB@ex01.PureNetworks.com> <0a42cc3e33d571da31598498c7273d09@ruby-forum.com> <1175264176.340B7CE9@ff1.dngr.org> Message-ID: Myk OLeary wrote: > Making a mailer in your root application solves that issue as well. The > .rhtml I'm using is full of _() that work fine. > Well I alread have a mailer model: app/models/signup_mailer.rb and it does not work. Do you have template files per language? e.g. template_en.rhtml, template_xy.rhtml? -- Posted via http://www.ruby-forum.com/. From myko at PureNetworks.com Fri Mar 30 12:49:41 2007 From: myko at PureNetworks.com (Myk O'Leary) Date: Fri, 30 Mar 2007 09:49:41 -0700 Subject: [Rails I18n] GetText doesn't work in ActionMailer In-Reply-To: References: <35f335a949791bfaf3e50642b8628a12@ruby-forum.com><20060815003514.61edd209.mutoh@highway.ne.jp><5674aa149ffd87e22032d299c8452a9b@ruby-forum.com><20061129084058.708baeea.mutoh@highway.ne.jp><003b94b071fcdfef5beb9d2bdadf467e@ruby-forum.com><20061201014027.cba671f9.mutoh@highway.ne.jp><13cce36bfe8de635ee153f8db19b93ff@ruby-forum.com><0dd482ea704e43b14da716a757e80490@ruby-forum.com><20061201130921.d182f5fb.mutoh@highway.ne.jp><8739acb378018bd7f5a9fb58e11e980f@ruby-forum.com><2A5AA1691961974DB645DC90898A8E4902034CFB@ex01.PureNetworks.com><0a42cc3e33d571da31598498c7273d09@ruby-forum.com><1175264176.340B7CE9@ff1.dngr.org> Message-ID: <2A5AA1691961974DB645DC90898A8E4902034DEB@ex01.PureNetworks.com> I do not. I'll enclose snippets from my setup with what may help you out with getting it to work. There are snippets not included for the actual setting of the locale which I'll assume you have since you have this working elsewhere. One note is that I have my controller, model and view one directory level deeper than you likely do. This won't affect success, but does affect the directory paths, etc that you see below. RAILS_ROOT/app/controllers/application.rb: ... require 'gettext/rails' ... RAILS_ROOT/app/controllers/netreport/report_controller.rb: ... def emailreport ... Netreport::Reporter.deliver_emailreport(@user, @locale) ... end ... RAILS_ROOT/app/models/netreport/reporter.rb: class Netreport::Reporter < ActionMailer::Base ... def emailreport(user, locale) require 'iconv' ActionMailer::Base.default_charset = "iso-8859-1" C = Iconv.new('ISO-8859-1', 'UTF-8') ... NR_setlocale(locale) @subject = C.iconv(_("My subject")) hash_body = {"user" => user, "locale" => locale} @body = C.iconv(render_message("emailreport", hash_body)) ... end ... RAILS_ROOT/app/views/netreport/reporter/emailreport.rhtml: ... NR_setlocale(@locale) _("Report for ") ... Non gettext related notes are that we use iconv for translated emails at present because several web mail providers are very inconsistent with presentation of UTF8 character encoded emails. This did and will work w/o needing to use iconv, but I don't have the time today to revert back to our previous code to make sure the snippets I post are working. I know the above are, as they are in production right now. Make sure you set the locale in the view, or you could very well not get the proper translations. --- Myk OLeary - myko at purenetworks.com Web Services Developer Pure Networks - http://www.purenetworks.com -----Original Message----- From: railsi18n-discussion-bounces at rubyforge.org [mailto:railsi18n-discussion-bounces at rubyforge.org] On Behalf Of Roland Sent: Friday, March 30, 2007 8:55 AM To: railsi18n-discussion at rubyforge.org Subject: Re: [Rails I18n] GetText doesn't work in ActionMailer Myk OLeary wrote: > Making a mailer in your root application solves that issue as well. The > .rhtml I'm using is full of _() that work fine. > Well I alread have a mailer model: app/models/signup_mailer.rb and it does not work. Do you have template files per language? e.g. template_en.rhtml, template_xy.rhtml? -- Posted via http://www.ruby-forum.com/. _______________________________________________ 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/20070330/1f551f8e/attachment.html From rubyforum.moriz at spamgourmet.com Fri Mar 30 14:09:07 2007 From: rubyforum.moriz at spamgourmet.com (Roland) Date: Fri, 30 Mar 2007 20:09:07 +0200 Subject: [Rails I18n] GetText doesn't work in ActionMailer In-Reply-To: <2A5AA1691961974DB645DC90898A8E4902034DEB@ex01.PureNetworks.com> References: <35f335a949791bfaf3e50642b8628a12@ruby-forum.com> <20060815003514.61edd209.mutoh@highway.ne.jp> <5674aa149ffd87e22032d299c8452a9b@ruby-forum.com> <20061129084058.708baeea.mutoh@highway.ne.jp> <003b94b071fcdfef5beb9d2bdadf467e@ruby-forum.com> <20061201014027.cba671f9.mutoh@highway.ne.jp> <13cce36bfe8de635ee153f8db19b93ff@ruby-forum.com> <0dd482ea704e43b14da716a757e80490@ruby-forum.com> <20061201130921.d182f5fb.mutoh@highway.ne.jp> <8739acb378018bd7f5a9fb58e11e980f@ruby-forum.com> <2A5AA1691961974DB645DC90898A8E4902034CFB@ex01.PureNetworks.com> <0a42cc3e33d571da31598498c7273d09@ruby-forum.com> <1175264176.340B7CE9@ff1.dngr.org> <2A5AA1691961974DB645DC90898A8E4902034DEB@ex01.PureNetworks.com> Message-ID: Myk O'Leary wrote: > I'll enclose snippets from my setup with what may help you out with > getting it to work. There are snippets not included for the actual > setting of the locale which I'll assume you have since you have this > working elsewhere. Thank you very much :-) two questions: - This means to get gettext working with ActionMailer you have to pass the current locale from the controller over to the Mailer-model and even down to the view? right? This doesn't look like DRY :-( - NR_setlocale() is that your custom method setting GetText.locale? best regards, Roland -- Posted via http://www.ruby-forum.com/. From myko at PureNetworks.com Fri Mar 30 14:20:40 2007 From: myko at PureNetworks.com (Myk O'Leary) Date: Fri, 30 Mar 2007 11:20:40 -0700 Subject: [Rails I18n] GetText doesn't work in ActionMailer In-Reply-To: References: <35f335a949791bfaf3e50642b8628a12@ruby-forum.com><20060815003514.61edd209.mutoh@highway.ne.jp><5674aa149ffd87e22032d299c8452a9b@ruby-forum.com><20061129084058.708baeea.mutoh@highway.ne.jp><003b94b071fcdfef5beb9d2bdadf467e@ruby-forum.com><20061201014027.cba671f9.mutoh@highway.ne.jp><13cce36bfe8de635ee153f8db19b93ff@ruby-forum.com><0dd482ea704e43b14da716a757e80490@ruby-forum.com><20061201130921.d182f5fb.mutoh@highway.ne.jp><8739acb378018bd7f5a9fb58e11e980f@ruby-forum.com><2A5AA1691961974DB645DC90898A8E4902034CFB@ex01.PureNetworks.com><0a42cc3e33d571da31598498c7273d09@ruby-forum.com><1175264176.340B7CE9@ff1.dngr.org><2A5AA1691961974DB645DC90898A8E4902034DEB@ex01.PureNetworks.com> Message-ID: <2A5AA1691961974DB645DC90898A8E4902034DFE@ex01.PureNetworks.com> Yes and yes. --- Myk OLeary - myko at purenetworks.com Web Services Developer Pure Networks - http://www.purenetworks.com -----Original Message----- From: railsi18n-discussion-bounces at rubyforge.org [mailto:railsi18n-discussion-bounces at rubyforge.org] On Behalf Of Roland Sent: Friday, March 30, 2007 11:09 AM To: railsi18n-discussion at rubyforge.org Subject: Re: [Rails I18n] GetText doesn't work in ActionMailer Myk O'Leary wrote: > I'll enclose snippets from my setup with what may help you out with > getting it to work. There are snippets not included for the actual > setting of the locale which I'll assume you have since you have this > working elsewhere. Thank you very much :-) two questions: - This means to get gettext working with ActionMailer you have to pass the current locale from the controller over to the Mailer-model and even down to the view? right? This doesn't look like DRY :-( - NR_setlocale() is that your custom method setting GetText.locale? best regards, Roland -- Posted via http://www.ruby-forum.com/. _______________________________________________ Railsi18n-discussion mailing list Railsi18n-discussion at rubyforge.org http://rubyforge.org/mailman/listinfo/railsi18n-discussion