From pppswing at yahoo.fr Mon Sep 1 05:37:58 2008 From: pppswing at yahoo.fr (David Nguyen) Date: Mon, 1 Sep 2008 11:37:58 +0200 Subject: [Rails I18n] layout Message-ID: <99fa5b9e59f70fd3c78ae3288bd551e2@ruby-forum.com> Hi I have one main layout and I would like that the left menu change depending on the controller. How can I do it ? Thanks -- Posted via http://www.ruby-forum.com/. From jaimeiniesta at gmail.com Mon Sep 1 13:02:55 2008 From: jaimeiniesta at gmail.com (Jaime Iniesta) Date: Mon, 1 Sep 2008 19:02:55 +0200 Subject: [Rails I18n] layout In-Reply-To: <99fa5b9e59f70fd3c78ae3288bd551e2@ruby-forum.com> References: <99fa5b9e59f70fd3c78ae3288bd551e2@ruby-forum.com> Message-ID: <58e0d6c60809011002n4d5e6bd8pe9532b03636fbd00@mail.gmail.com> 2008/9/1 David Nguyen > Hi > I have one main layout and I would like that the left menu change > depending on the controller. How can I do it ? Hey David, please notice that you were writing to a mailing list dedicated only to internationalization features. You should send these general rails questions to the general rails mailing list. Anyway here's how to do it: you can check what controller and/or action you're in on your layout and then show its corresponding menu. You just need to check: controller.controller_name controller.action_name -- Jaime Iniesta http://jaimeiniesta.com http://www.workingwithrails.com/person/6722-jaime-iniesta -------------- next part -------------- An HTML attachment was scrubbed... URL: From difeiz at gmail.com Sat Sep 6 08:23:01 2008 From: difeiz at gmail.com (Difei Zhao) Date: Sat, 6 Sep 2008 14:23:01 +0200 Subject: [Rails I18n] UTF-8 in rails Message-ID: <71a0a88df62bf2f79c385838314a0742@ruby-forum.com> Greetings all, Just hours ago I found the :with options of helpers like validates_format_of seems UTF-8 compatible (for instance, "/.{2}/" matches exactly two UTF-8 characters instead of a length 2 UTF-8 string). I am wondering if there are any documentation about this UTF-8 compatible methods? Are there any UTF-8 compatible regex engine in ruby itself? TIA! Difei -- Posted via http://www.ruby-forum.com/. From lanwen.bangba at gmail.com Tue Sep 9 10:24:25 2008 From: lanwen.bangba at gmail.com (Wen Lan) Date: Tue, 9 Sep 2008 16:24:25 +0200 Subject: [Rails I18n] How can i use AR to save french and japanese? Message-ID: <3c11f04ab4eb67acdb21de1999dd9ca4@ruby-forum.com> hi, all i had a strange problem that i can not use ActiveRecord to save french and japanese. i use Tmail and mms2r to parse a mail, and i have a mail model in the db, the mail model has a txt_body column. After i had fetched the mail from mail server and parse the mail, i set the txt_body with the value of the mail's body. I found that i could not save the french and japanese correctly. for example, if the mail body contains "fran?ais fran?ais fran?ais", i just get "fran" in the db, losing the remaim characters, that is "?ais fran?ais fran?ais". the same as japanese. i had setted my db to use utf-8. any advise? -- Posted via http://www.ruby-forum.com/. From sunny_bogawat at neovasolutions.com Wed Sep 10 03:44:15 2008 From: sunny_bogawat at neovasolutions.com (Sunny Bogawat) Date: Wed, 10 Sep 2008 09:44:15 +0200 Subject: [Rails I18n] Time Problem Message-ID: <6e49312c3dcba85bbac0489f7ad9e39b@ruby-forum.com> Hi, In my application I have to correct the time stamp on event discussion posts. Perhaps they are not observing DST? In any case, they are slow by one hour. how to do this ? I have following type of code and I have been using rails 1.3:- <%= frmt_note_date(message.created_on) %> at <%= display_formated_time(user_timezone_dateTime(message.created_on,'fmt_in_dateTime').split(' at ').last) %> above code shows me:- 9/08/2008 at 4:32 AM Please I need a solution for this problem? -- Posted via http://www.ruby-forum.com/. From ij.rubylist at gmail.com Mon Sep 15 04:33:57 2008 From: ij.rubylist at gmail.com (Izidor Jerebic) Date: Mon, 15 Sep 2008 10:33:57 +0200 Subject: [Rails I18n] UTF-8 in rails In-Reply-To: <71a0a88df62bf2f79c385838314a0742@ruby-forum.com> References: <71a0a88df62bf2f79c385838314a0742@ruby-forum.com> Message-ID: <457D094B-6F2D-4D03-9F1D-7E7C9D743611@gmail.com> Ruby has kind-of UTF-8 compatible regexp: single character matches single UTF-8 character (when given UTF-8 encoding directive, which is default in Rails), not single byte. But character classes, such as [:alfa:], work only for ASCII. For general UTF-8 regex with character classes, you can use Oniguruma gem... izidor On 6.9.2008, at 14:23, Difei Zhao wrote: > Greetings all, > > Just hours ago I found the :with options of helpers like > validates_format_of seems UTF-8 compatible (for instance, "/.{2}/" > matches exactly two UTF-8 characters instead of a length 2 UTF-8 > string). I am wondering if there are any documentation about this > UTF-8 > compatible methods? Are there any UTF-8 compatible regex engine in > ruby > itself? TIA! > > Difei > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion From saeedawan at yahoo.com Mon Sep 29 18:54:54 2008 From: saeedawan at yahoo.com (Simon Watson) Date: Tue, 30 Sep 2008 00:54:54 +0200 Subject: [Rails I18n] Unicode number to UTF-8 character Message-ID: <3972c20636c2fb6080e4e2bdcd3fd7a7@ruby-forum.com> All, Say if I have a hex number 041C, how can I convert it into UTF-8 in rails. Regards, - newB -- Posted via http://www.ruby-forum.com/.