From: Adam Hoyle Date: Tue, 10 Aug 2021 09:13:24 +0000 (+0100) Subject: add route to pass locale X-Git-Tag: live~999^2~48 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/26aecfb2bf75c68ab7e396011662bf6c55057f77?ds=sidebyside add route to pass locale --- diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 2eb084f91..73e4ef51d 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -107,7 +107,7 @@ class SiteController < ApplicationController end def communities - @locale = I18n.locale + @locale = params[:communities_locale] || I18n.locale @local_chapters = Communities.local_chapters end diff --git a/config/routes.rb b/config/routes.rb index aff5126f8..1295772f1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -148,6 +148,7 @@ OpenStreetMap::Application.routes.draw do get "/about/:about_locale" => "site#about" get "/about" => "site#about" get "/communities" => "site#communities" + get "/communities/:communities_locale" => "site#communities" get "/history" => "changesets#index" get "/history/feed" => "changesets#feed", :defaults => { :format => :atom } get "/history/comments/feed" => "changeset_comments#index", :as => :changesets_comments_feed, :defaults => { :format => "rss" }