No translation works

3 views
Skip to first unread message

dregalus

unread,
Aug 26, 2010, 10:25:45 AM8/26/10
to I18n Routing
Hi I18n_routing users,

i have a problem with my translation of routes.
I dont know how i use the localized method in routes.rb.

i have a lot of controllers an actions. I have the translation for the
controllers
in my *.yml files like this

de:
path_names:
flights: "fluege"
flights_from: "fluege-von"
world: "welt"
region: "region"
...

and now i have my localized method in routes.rb.
...
map.localized(I18n.available_locales, :verbose => true) do
#Content
end
...

So in many examples there are rows like this, which obviously
translate controllers.
"map.welcome 'welcome', :controller => 'pages', :action => 'welcome'"
But i dont know how i use this for my purpose. What is in this case
map.welcome?
What is the String 'welcome' ?
I used it like this
map.flights 'flights, :controller => 'fluege', :action => 'index'
but nothing happens :(

I hope anyone can help me!
Thx a lot !

Alexandre Friquet

unread,
Aug 26, 2010, 11:26:37 AM8/26/10
to i18n-r...@googlegroups.com
Hi dregalus,

> de:
> path_names:
> flights: "fluege"
> flights_from: "fluege-von"
> world: "welt"
> region: "region"
> ...

I think that if you want to use named paths, you should have a yml like so :

de:
named_routes_path:


flights: "fluege"
flights_from: "fluege-von"
world: "welt"
region: "region"
...

> So in many examples there are rows like this, which obviously


> translate controllers.
> "map.welcome 'welcome', :controller => 'pages', :action => 'welcome'"
> But i dont know how i use this for my purpose. What is in this case
> map.welcome?
> What is the String 'welcome' ?
> I used it like this
> map.flights 'flights, :controller => 'fluege', :action => 'index'

There is an ' missing after the second flights occurrence, but this may be a typo.
This should work if your flights controller is really named fluege and not flights.

HTH
@lex

Kwi

unread,
Aug 26, 2010, 12:57:32 PM8/26/10
to I18n Routing
Yes, Alex should be right on that :)

Thanks Alex by the way for answering on the group !
Message has been deleted

dregalus

unread,
Aug 27, 2010, 3:36:33 AM8/27/10
to I18n Routing
Hi,
thx for you answer.

Okay have renamed path_names in named_routes_path in my yml file,
but nothing happens and my controller is really named "fluege"

is this the correct structure for the localized method and the entries
in my yml file?
map.localized(I18n.available_locales, :verbose => true) do
map.fluege 'flights', :controller => 'fluege', :action => "index"
map.fluege-von 'flights-from', :controller => 'fluege', :action =>
"fluege-von" <- Its a seperate action in the controller !
map.welt 'world', :controller => 'welt' , action => 'index'
map.region 'region', :controller => 'region' action => 'index'
...
end

For your information, im using Rails 2.3.5 and the i18n_routing gem in
version 0.3.6 and i18n in 0.4.1

Thx!
Message has been deleted
Message has been deleted

Kwi

unread,
Aug 30, 2010, 5:16:29 PM8/30/10
to I18n Routing
Hi,

Have you try to specify manually your locales ? like that :

map.localized(['en', 'fr'], :verbose => true) do

Cheers
Guillaume

dregalus

unread,
Sep 1, 2010, 3:31:07 AM9/1/10
to I18n Routing
Hi,

yes i tried this. But it doesnt work.
I dont know what im doing wrong.
Im a little bit frustrated :-/

Greets
Christian
Reply all
Reply to author
Forward
0 new messages