I have set match ''/:locale'' => "welcome#home", :as => :root but it doesn''t cover the default case, when user enter the domain url wo locale, http://www.myapp.com Is there any way to default it to the app default locale I18n.locale ?? thanks for feedback -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/GbT5L0qXE18J. For more options, visit https://groups.google.com/groups/opt_out.
Hallo Erwin.. When you work with before_filter :set_locale def set_locale # update sessions if passed session[:locale] = params[:locale] if params[:locale] # set locale based on sessions or default I18n.locale = session[:locale] || I18n.default_locale end just create index.html.erb index.en.html.erb ect.. Gruss Am Dienstag, 13. November 2012 15:31:16 UTC+1 schrieb Erwin:> > I have set > > match ''/:locale'' => "welcome#home", :as => :root > > but it doesn''t cover the default case, when user enter the domain url wo > locale, http://www.myapp.com > > Is there any way to default it to the app default locale I18n.locale ?? > > thanks for feedback >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/7wc0kBBvWtsJ. For more options, visit https://groups.google.com/groups/opt_out.
root :to => ''welcome#index'' is enough Am Dienstag, 13. November 2012 15:37:06 UTC+1 schrieb Werner:> > Hallo Erwin.. > > When you work with > > before_filter :set_locale > > def set_locale > # update sessions if passed > session[:locale] = params[:locale] if params[:locale] > > # set locale based on sessions or default > I18n.locale = session[:locale] || I18n.default_locale > end > > just create > > index.html.erb > index.en.html.erb > > ect.. > > > Gruss > > > > > Am Dienstag, 13. November 2012 15:31:16 UTC+1 schrieb Erwin: >> >> I have set >> >> match ''/:locale'' => "welcome#home", :as => :root >> >> but it doesn''t cover the default case, when user enter the domain url wo >> locale, http://www.myapp.com >> >> Is there any way to default it to the app default locale I18n.locale ?? >> >> thanks for feedback >> >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/X6C8Cs2rE-4J. For more options, visit https://groups.google.com/groups/opt_out.
Thanks Werner, I''m quite there .. I am working as you mentionned .. but I don''t understand why I still have the locale parameter in my root_url : in the console : root_url "http://lvh.me:3000/?locale=en" root_path "/?locale=en" I18n.locale :en I would like to have : root_url "http://lvh.me:3000/en" root_path "/en" as root_url doesn''t pass thru url_for, I cannot play with it ... where is it generated ? erwin Le mardi 13 novembre 2012 15:38:55 UTC+1, Werner a écrit :> > root :to => ''welcome#index'' > > is enough > > Am Dienstag, 13. November 2012 15:37:06 UTC+1 schrieb Werner: >> >> Hallo Erwin.. >> >> When you work with >> >> before_filter :set_locale >> >> def set_locale >> # update sessions if passed >> session[:locale] = params[:locale] if params[:locale] >> >> # set locale based on sessions or default >> I18n.locale = session[:locale] || I18n.default_locale >> end >> >> just create >> >> index.html.erb >> index.en.html.erb >> >> ect.. >> >> >> Gruss >> >> >> >> >> Am Dienstag, 13. November 2012 15:31:16 UTC+1 schrieb Erwin: >>> >>> I have set >>> >>> match ''/:locale'' => "welcome#home", :as => :root >>> >>> but it doesn''t cover the default case, when user enter the domain url wo >>> locale, http://www.myapp.com >>> >>> Is there any way to default it to the app default locale I18n.locale ?? >>> >>> thanks for feedback >>> >>-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/DLwJBQxQZyEJ. For more options, visit https://groups.google.com/groups/opt_out.
[SOLVED] writing my previous post, make me thinking about ... def default_url_options(options={}) { :locale => I18n.locale } end which was still in in my application controller ..... removed it , now it''s fine.. thanks again !! Le mercredi 14 novembre 2012 11:42:22 UTC+1, Erwin a écrit :> > Thanks Werner, I''m quite there .. I am working as you mentionned .. > but I don''t understand why I still have the locale parameter in my > root_url : > > in the console : > root_url > "http://lvh.me:3000/?locale=en" > root_path > "/?locale=en" > I18n.locale > :en > > I would like to have : > root_url > "http://lvh.me:3000/en" > root_path > "/en" > > as root_url doesn''t pass thru url_for, I cannot play with it ... where > is it generated ? > > erwin > > Le mardi 13 novembre 2012 15:38:55 UTC+1, Werner a écrit : >> >> root :to => ''welcome#index'' >> >> is enough >> >> Am Dienstag, 13. November 2012 15:37:06 UTC+1 schrieb Werner: >>> >>> Hallo Erwin.. >>> >>> When you work with >>> >>> before_filter :set_locale >>> >>> def set_locale >>> # update sessions if passed >>> session[:locale] = params[:locale] if params[:locale] >>> >>> # set locale based on sessions or default >>> I18n.locale = session[:locale] || I18n.default_locale >>> end >>> >>> just create >>> >>> index.html.erb >>> index.en.html.erb >>> >>> ect.. >>> >>> >>> Gruss >>> >>> >>> >>> >>> Am Dienstag, 13. November 2012 15:31:16 UTC+1 schrieb Erwin: >>>> >>>> I have set >>>> >>>> match ''/:locale'' => "welcome#home", :as => :root >>>> >>>> but it doesn''t cover the default case, when user enter the domain url >>>> wo locale, http://www.myapp.com >>>> >>>> Is there any way to default it to the app default locale I18n.locale >>>> ?? >>>> >>>> thanks for feedback >>>> >>>-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/SHgLeDNCxYoJ. For more options, visit https://groups.google.com/groups/opt_out.
Am 14.11.2012 um 11:42 schrieb Erwin <yves_dufour-ee4meeAH724@public.gmane.org>: Hi Erwin.. my be you check This. gem ''i18n_routing'' Gruss> Thanks Werner, I''m quite there .. I am working as you mentionned .. > but I don''t understand why I still have the locale parameter in my root_url : > > in the console : > root_url > "http://lvh.me:3000/?locale=en" > root_path > "/?locale=en" > I18n.locale > :en > > I would like to have : > root_url > "http://lvh.me:3000/en" > root_path > "/en" > > as root_url doesn''t pass thru url_for, I cannot play with it ... where is it generated ? > > erwin > > Le mardi 13 novembre 2012 15:38:55 UTC+1, Werner a écrit : > root :to => ''welcome#index'' > > is enough > > Am Dienstag, 13. November 2012 15:37:06 UTC+1 schrieb Werner: > Hallo Erwin.. > > When you work with > > before_filter :set_locale > > def set_locale > # update sessions if passed > session[:locale] = params[:locale] if params[:locale] > > # set locale based on sessions or default > I18n.locale = session[:locale] || I18n.default_locale > end > > just create > > index.html.erb > index.en.html.erb > > ect.. > > > Gruss > > > > > Am Dienstag, 13. November 2012 15:31:16 UTC+1 schrieb Erwin: > I have set > > match ''/:locale'' => "welcome#home", :as => :root > > but it doesn''t cover the default case, when user enter the domain url wo locale, http://www.myapp.com > > Is there any way to default it to the app default locale I18n.locale ?? > > thanks for feedback > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/DLwJBQxQZyEJ. > For more options, visit https://groups.google.com/groups/opt_out. > >Werner Laude webagentur.laude-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
thanks , helpful Le mercredi 14 novembre 2012 13:33:12 UTC+1, Werner Laude a écrit :> > > Am 14.11.2012 um 11:42 schrieb Erwin <yves_...-ee4meeAH724@public.gmane.org <javascript:>>: > > Hi Erwin.. my be you check This. > > gem ''i18n_routing'' > Gruss > > > Thanks Werner, I''m quite there .. I am working as you mentionned .. > but I don''t understand why I still have the locale parameter in my > root_url : > > in the console : > root_url > "http://lvh.me:3000/?locale=en" > root_path > "/?locale=en" > I18n.locale > :en > > I would like to have : > root_url > "http://lvh.me:3000/en" > root_path > "/en" > > as root_url doesn''t pass thru url_for, I cannot play with it ... where > is it generated ? > > erwin > > Le mardi 13 novembre 2012 15:38:55 UTC+1, Werner a écrit : >> >> root :to => ''welcome#index'' >> >> is enough >> >> Am Dienstag, 13. November 2012 15:37:06 UTC+1 schrieb Werner: >>> >>> Hallo Erwin.. >>> >>> When you work with >>> >>> before_filter :set_locale >>> >>> def set_locale >>> # update sessions if passed >>> session[:locale] = params[:locale] if params[:locale] >>> >>> # set locale based on sessions or default >>> I18n.locale = session[:locale] || I18n.default_locale >>> end >>> >>> just create >>> >>> index.html.erb >>> index.en.html.erb >>> >>> ect.. >>> >>> >>> Gruss >>> >>> >>> >>> >>> Am Dienstag, 13. November 2012 15:31:16 UTC+1 schrieb Erwin: >>>> >>>> I have set >>>> >>>> match ''/:locale'' => "welcome#home", :as => :root >>>> >>>> but it doesn''t cover the default case, when user enter the domain url >>>> wo locale, http://www.myapp.com >>>> >>>> Is there any way to default it to the app default locale I18n.locale >>>> ?? >>>> >>>> thanks for feedback >>>> >>> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:> > . > To unsubscribe from this group, send email to > rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/DLwJBQxQZyEJ. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > Werner Laude > webagent...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:> > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/hMcTkQCyd-8J. For more options, visit https://groups.google.com/groups/opt_out.