From 30b36ab0147af679a2ecf359c5a55299f209508a Mon Sep 17 00:00:00 2001 From: Lewis Sparlin Date: Thu, 7 Oct 2021 22:21:06 -0500 Subject: [PATCH] I18n copy on Tags index page (#14891) * Move hard-coded Tags index copy to [en,fr] locale files * Use tags.pluralize for a better page title implementation * Add better french translations * Once more fr translation fix * Remove .pluralize from title i18n --- app/controllers/sitemaps_controller.rb | 2 +- app/views/tags/index.html.erb | 14 +++++++------- config/locales/en.yml | 5 +++++ config/locales/fr.yml | 5 +++++ spec/requests/pages_spec.rb | 2 +- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/controllers/sitemaps_controller.rb b/app/controllers/sitemaps_controller.rb index e9f296b4a..59e34f39a 100644 --- a/app/controllers/sitemaps_controller.rb +++ b/app/controllers/sitemaps_controller.rb @@ -81,7 +81,7 @@ class SitemapsController < ApplicationController end def resource_string - params[:sitemap].gsub(".xml","").split("-")[1] + params[:sitemap].gsub(".xml", "").split("-")[1] end def offset diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 6788d9c23..50ed26380 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -1,28 +1,28 @@ -<% title "Tags on #{community_name}" %> +<% title t("core.tags") %> <%= content_for :page_meta do %> " /> - + "> <%= meta_keywords_default %> " /> - + " /> - + " /> "> - + "> <% end %>
-

Top tags

- <%= link_to "Following tags", dashboard_following_tags_path, class: "crayons-btn crayons-btn--ghost" %> +

<%= t("core.top_tags") %>

+ <%= link_to t("core.following_tags"), dashboard_following_tags_path, class: "crayons-btn crayons-btn--ghost" %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 41aab0f84..4c0524b2b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5,6 +5,7 @@ en: all: All comment: Comment copy_link: Copy link + community_name_is_great: "%{community_name} is great!" create_account: Create account create_post: Create Post discussion: Discussion @@ -13,6 +14,7 @@ en: follow: Follow follow_back: Follow back following: Following + following_tags: "Following tags" full: Full home: Home infinity: Infinity @@ -36,6 +38,9 @@ en: search: Search see_all: See all share_to: Share to %{media} + tags: "Tags" + tags_to_follow: "Tags to follow on %{community_name}" + top_tags: "Top tags" trending_on: Trending on view: View week: Week diff --git a/config/locales/fr.yml b/config/locales/fr.yml index b3b68db1c..2ba83a9ab 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -4,6 +4,7 @@ fr: add_comment: Ajouter un commentaire all: Tout comment: Commentaire + community_name_is_great: "%{community_name} est super" copy_link: Copier le lien create_account: Créer un profil create_post: Créer une publication @@ -13,6 +14,7 @@ fr: follow: Suivre follow_back: Suivre aussi following: Abonné + following_tags: Sujets suivis full: Complet home: Page D'Accueil infinity: Infini @@ -36,6 +38,9 @@ fr: search: Recherche see_all: Tout voir share_to: Partager sur %{media} + tags: Sujets + tags_to_follow: Sujets dans %{community_name} + top_tags: Sujets les plus utilisées trending_on: Populaire sur view: Vue week: Semaine diff --git a/spec/requests/pages_spec.rb b/spec/requests/pages_spec.rb index f4748947d..e98f08047 100644 --- a/spec/requests/pages_spec.rb +++ b/spec/requests/pages_spec.rb @@ -231,7 +231,7 @@ RSpec.describe "Pages", type: :request do it "has proper text" do get "/robots.txt" - text = "Sitemap: #{URL.url("sitemap-index.xml")}" + text = "Sitemap: #{URL.url('sitemap-index.xml')}" expect(response.body).to include(text) end end