From pedrolito at lavache.com Wed Dec 10 09:59:41 2008 From: pedrolito at lavache.com (Fernando Perez) Date: Wed, 10 Dec 2008 15:59:41 +0100 Subject: [Rails I18n] Automatically detect client's locale setting Message-ID: <66bcc1fc365e886ca685c1af1f014588@ruby-forum.com> Hi, Does I18n provide any easy feature to detect the client's browser locale? -- Posted via http://www.ruby-forum.com/. From thedickster at gmail.com Fri Dec 12 11:08:36 2008 From: thedickster at gmail.com (Richard Schneeman) Date: Fri, 12 Dec 2008 17:08:36 +0100 Subject: [Rails I18n] auto detect URL Message-ID: <32c33d04c3cd1dfe60646ca6f385a69e@ruby-forum.com> Is it possible to read the URL that someone uses to access your site. For example: I own, www.english.com and www.chinese.com and only have one rails site. Is it possible, when a user accessing my rails site from english.com is automatically set to use my English I18n, as well as a separate style sheet, where as www.chinese.com would utilize chinese I18n ?? -- Posted via http://www.ruby-forum.com/. From jaimeiniesta at gmail.com Fri Dec 12 11:24:06 2008 From: jaimeiniesta at gmail.com (Jaime Iniesta) Date: Fri, 12 Dec 2008 17:24:06 +0100 Subject: [Rails I18n] auto detect URL In-Reply-To: <32c33d04c3cd1dfe60646ca6f385a69e@ruby-forum.com> References: <32c33d04c3cd1dfe60646ca6f385a69e@ruby-forum.com> Message-ID: <58e0d6c60812120824k7457e963m3a7739cd228eabb0@mail.gmail.com> On Fri, Dec 12, 2008 at 5:08 PM, Richard Schneeman wrote: > Is it possible to read the URL that someone uses to access your site. > For example: I own, www.english.com and www.chinese.com and only have > one rails site. Is it possible, when a user accessing my rails site from > english.com is automatically set to use my English I18n, as well as a > separate style sheet, where as www.chinese.com would utilize chinese > I18n ?? Hi Richard, yes it's possible. I have a rails app that can be accessed from various domains, what I do is check request.host to get the domain. -- Jaime Iniesta http://jaimeiniesta.com http://www.workingwithrails.com/person/6722-jaime-iniesta From thedickster at gmail.com Fri Dec 12 14:27:37 2008 From: thedickster at gmail.com (Richard Schneeman) Date: Fri, 12 Dec 2008 20:27:37 +0100 Subject: [Rails I18n] auto detect URL In-Reply-To: <58e0d6c60812120824k7457e963m3a7739cd228eabb0@mail.gmail.com> References: <32c33d04c3cd1dfe60646ca6f385a69e@ruby-forum.com> <58e0d6c60812120824k7457e963m3a7739cd228eabb0@mail.gmail.com> Message-ID: <0e22b92d44daebcb674517704c1d3998@ruby-forum.com> Hey thanks for the heads up!!! For anyone else who wants to implement this, you can just put <%= request.host %> in your view or request.host in your controller if you are looking at your site from http://0.0.0.0:3000 you will get a return of: 0.0.0.0 Thanks Jaime !! -- Posted via http://www.ruby-forum.com/. From beijor at 126.com Sun Dec 21 00:11:38 2008 From: beijor at 126.com (Jacky Lin) Date: Sun, 21 Dec 2008 06:11:38 +0100 Subject: [Rails I18n] Easy Puzzle Mountain problem In-Reply-To: <8fa4b37a36163981db41adb354431e56@ruby-forum.com> References: <612f46cfd17f46b384849a070fea1166@ruby-forum.com> <8fa4b37a36163981db41adb354431e56@ruby-forum.com> Message-ID: http://www.flyingzg.com http://www.flyingzg.com -- Posted via http://www.ruby-forum.com/. From faivrem at gmail.com Wed Dec 24 04:41:22 2008 From: faivrem at gmail.com (Mickael Faivre-Macon) Date: Wed, 24 Dec 2008 10:41:22 +0100 Subject: [Rails I18n] Loading several locales files Message-ID: <51cc3943468b0c5c04bd9d51e5dbc09b@ruby-forum.com> Hi, If I put my 2 locales en and fr in one file (config/locales/en.yml) english an french locales are loaded and I can switch between the two. But if I put the french local in a separate fr.yml file, then I get "translation missing: fr, email" errors. My configuration.rb has: config.i18n.load_path += Dir[File.join(RAILS_ROOT, 'config', 'locales', '*.{rb,yml}')] Could someone explain this ? Thanks for any help, Mickael. -- Posted via http://www.ruby-forum.com/. From uzytkownik2 at gmail.com Wed Dec 24 16:29:52 2008 From: uzytkownik2 at gmail.com (Maciej Piechotka) Date: Wed, 24 Dec 2008 22:29:52 +0100 Subject: [Rails I18n] I18n plugin for merb Message-ID: <87prjh9s8f.fsf@news.piechotka.com.pl> Hello. I have been writing a i18n/l10n plugin for merb. Today I get knew about the merging betwean the merb and rails. I'm not entiry sure but while I looked through rails api it seems that I have more richer API then I18n. 1. Should I abandon the project? 2. Is there anywhere a full list of I18n features? Regards -- I've probably left my head... somewhere. Please wait untill I find it. Homepage (pl_PL): http://uzytkownik.jogger.pl/ (GNU/)Linux User: #425935 (see http://counter.li.org/) From thedickster at gmail.com Tue Dec 30 18:17:14 2008 From: thedickster at gmail.com (Richard Schneeman) Date: Wed, 31 Dec 2008 00:17:14 +0100 Subject: [Rails I18n] Passing a dynamic class to translate Message-ID: I have a single form that can be used for multiple models, in my view i origionally had "Add a New #{@element.class}" how can i write a dynamic i18n translate call? I want to do something like <%= t 'new.form. at element.class'%> What is the best way to accomplish this functionality? -- Posted via http://www.ruby-forum.com/.