From 9f7ec064e448a745e0ea2615a089f0988215dec6 Mon Sep 17 00:00:00 2001 From: Mayank Tankhiwale Date: Sat, 23 Nov 2019 20:26:19 +0530 Subject: [PATCH 1/1] Fix #2402 1. Modified about routes 2. Accept the new params in site#about 3. Update about.html.erb --- app/controllers/site_controller.rb | 4 +++- app/views/site/about.html.erb | 32 +++++++++++++++--------------- config/routes.rb | 1 + 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 57ac07501..f57bb7c25 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -108,7 +108,9 @@ class SiteController < ApplicationController def help; end - def about; end + def about + @locale = params[:about_locale] || I18n.locale + end def export; end diff --git a/app/views/site/about.html.erb b/app/views/site/about.html.erb index 886aaf006..cf596cf59 100644 --- a/app/views/site/about.html.erb +++ b/app/views/site/about.html.erb @@ -1,41 +1,41 @@
- <%= t ".copyright_html" %> + <%= t ".copyright_html", :locale => @locale %>
-

<%= raw t ".used_by", :name => "OpenStreetMap" %>

+

<%= raw t ".used_by", :name => "OpenStreetMap", :locale => @locale %>

-

<%= t ".lede_text" %>

-

<%= t ".local_knowledge_title" %>

-

<%= t ".local_knowledge_html" %>

+

<%= t ".lede_text", :locale => @locale %>

+

<%= t ".local_knowledge_title", :locale => @locale %>

+

<%= t ".local_knowledge_html", :locale => @locale %>

-

<%= t ".community_driven_title" %>

-

<%= t ".community_driven_html", :diary_path => diary_entries_path %>

+

<%= t ".community_driven_title", :locale => @locale %>

+

<%= t ".community_driven_html", :locale => @locale, :diary_path => diary_entries_path %>

-

<%= t ".open_data_title" %>

-

<%= t ".open_data_html", :copyright_path => copyright_path %>

+

<%= t ".open_data_title", :locale => @locale %>

+

<%= t ".open_data_html", :locale => @locale, :copyright_path => copyright_path %>

-

<%= t ".partners_title" %>

-

<%= t "layouts.hosting_partners_html", - :ucl => link_to(t("layouts.partners_ucl"), "https://www.ucl.ac.uk"), - :bytemark => link_to(t("layouts.partners_bytemark"), "https://www.bytemark.co.uk"), - :partners => link_to(t("layouts.partners_partners"), "https://hardware.openstreetmap.org/thanks/") %> +

<%= t ".partners_title", :locale => @locale %>

+

<%= t "layouts.hosting_partners_html", :locale => @locale, + :ucl => link_to(t("layouts.partners_ucl", :locale => @locale), "https://www.ucl.ac.uk"), + :bytemark => link_to(t("layouts.partners_bytemark", :locale => @locale), "https://www.bytemark.co.uk"), + :partners => link_to(t("layouts.partners_partners", :locale => @locale), "https://hardware.openstreetmap.org/thanks/") %>

diff --git a/config/routes.rb b/config/routes.rb index 58c05da17..2c904fc48 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -146,6 +146,7 @@ OpenStreetMap::Application.routes.draw do get "/welcome" => "site#welcome" get "/fixthemap" => "site#fixthemap" get "/help" => "site#help" + get "/about/:about_locale" => "site#about" get "/about" => "site#about" get "/history" => "changesets#index" get "/history/feed" => "changesets#feed", :defaults => { :format => :atom } -- 2.45.2