Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
routing issue on match '/:locale'
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Erwin  
View profile  
 More options Nov 13 2012, 9:31 am
From: Erwin <yves_duf...@mac.com>
Date: Tue, 13 Nov 2012 06:31:16 -0800 (PST)
Local: Tues, Nov 13 2012 9:31 am
Subject: routing issue on match '/:locale'

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Werner  
View profile  
 More options Nov 13 2012, 9:37 am
From: Werner <webagentur.la...@googlemail.com>
Date: Tue, 13 Nov 2012 06:37:06 -0800 (PST)
Local: Tues, Nov 13 2012 9:37 am
Subject: Re: routing issue on match '/:locale'

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Werner  
View profile  
 More options Nov 13 2012, 9:38 am
From: Werner <webagentur.la...@googlemail.com>
Date: Tue, 13 Nov 2012 06:38:55 -0800 (PST)
Local: Tues, Nov 13 2012 9:38 am
Subject: Re: routing issue on match '/:locale'

root :to => 'welcome#index'

is enough

Am Dienstag, 13. November 2012 15:37:06 UTC+1 schrieb Werner:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erwin  
View profile  
 More options Nov 14 2012, 5:42 am
From: Erwin <yves_duf...@mac.com>
Date: Wed, 14 Nov 2012 02:42:21 -0800 (PST)
Local: Wed, Nov 14 2012 5:42 am
Subject: Re: routing issue on match '/:locale'

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 :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erwin  
View profile  
 More options Nov 14 2012, 6:10 am
From: Erwin <yves_duf...@mac.com>
Date: Wed, 14 Nov 2012 03:10:06 -0800 (PST)
Local: Wed, Nov 14 2012 6:10 am
Subject: Re: routing issue on match '/:locale'

[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 :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Werner Laude  
View profile  
 More options Nov 14 2012, 7:33 am
From: Werner Laude <webagentur.la...@googlemail.com>
Date: Wed, 14 Nov 2012 13:31:24 +0100
Local: Wed, Nov 14 2012 7:31 am
Subject: Re: [Rails] routing issue on match '/:locale'

Am 14.11.2012 um 11:42 schrieb Erwin <yves_duf...@mac.com>:

Hi Erwin.. my be you check This.

gem 'i18n_routing'
Gruss

Werner Laude
webagentur.la...@gmail.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erwin  
View profile  
 More options Nov 15 2012, 2:37 am
From: Erwin <yves_duf...@mac.com>
Date: Wed, 14 Nov 2012 23:37:50 -0800 (PST)
Local: Thurs, Nov 15 2012 2:37 am
Subject: Re: [Rails] routing issue on match '/:locale'

thanks , helpful

Le mercredi 14 novembre 2012 13:33:12 UTC+1, Werner Laude a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »