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
This commit is contained in:
Lewis Sparlin 2021-10-07 22:21:06 -05:00 committed by GitHub
parent 204ca4ae7e
commit 30b36ab014
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 9 deletions

View file

@ -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

View file

@ -1,28 +1,28 @@
<% title "Tags on #{community_name}" %>
<% title t("core.tags") %>
<%= content_for :page_meta do %>
<link rel="canonical" href="<%= app_url("/tags") %>" />
<meta name="description" content="Tags to follow on <%= community_name %>">
<meta name="description" content="<%= t("core.tags_to_follow", community_name: community_name) %>">
<%= meta_keywords_default %>
<meta property="og:type" content="article" />
<meta property="og:url" content="<%= app_url("/tags") %>" />
<meta property="og:title" content="Tags to follow on <%= community_name %>" />
<meta property="og:title" content="<%= t("core.tags_to_follow", community_name: community_name) %>" />
<meta property="og:image" content="<%= Settings::General.main_social_image %>" />
<meta property="og:description" content="<%= community_name %> is great!" />
<meta property="og:description" content="<%= t("core.community_name_is_great", community_name: community_name) %>" />
<meta property="og:site_name" content="<%= community_name %>" />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@<%= Settings::General.social_media_handles["twitter"] %>">
<meta name="twitter:title" content="About <%= community_name %>">
<meta name="twitter:description" content="<%= community_name %> is great!">
<meta name="twitter:description" content="<%= t("core.community_name_is_great", community_name: community_name) %>">
<meta name="twitter:image:src" content="<%= Settings::General.main_social_image %>">
<% end %>
<main id="main-content" class="crayons-layout crayons-layout--1-col">
<header class="px-2 m:px-0 flex items-center justify-between">
<h1>Top tags</h1>
<%= link_to "Following tags", dashboard_following_tags_path, class: "crayons-btn crayons-btn--ghost" %>
<h1><%= t("core.top_tags") %></h1>
<%= link_to t("core.following_tags"), dashboard_following_tags_path, class: "crayons-btn crayons-btn--ghost" %>
</header>
<div class="grid gap-2 m:gap-4 l:gap-6 m:grid-cols-2 l:grid-cols-3 px-2 m:px-0" data-follow-button-container="true">

View file

@ -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

View file

@ -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

View file

@ -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