Translate actions in articles view (#14911)

* Translate actions in articles view

* Move reactions to core.reactions namespace

* Add quotes to share_to in yml file

* Fix wrong translation in english locale

Co-authored-by: rhymes <github@rhymes.dev>
This commit is contained in:
Tayllan 2021-10-07 02:08:14 -03:00 committed by GitHub
parent 7e947ff2ca
commit fc77376c1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 10 deletions

View file

@ -95,8 +95,9 @@ proceed.
This section provides a high-level quick start guide. If you're looking for a
more thorough installation guide (for example
[with macOS](https://developers.forem.com/getting-started/installation/mac), you'll want to
refer to our complete [Developer Documentation](https://developers.forem.com/).
[with macOS](https://developers.forem.com/getting-started/installation/mac),
you'll want to refer to our complete
[Developer Documentation](https://developers.forem.com/).
We run on a [Rails](https://rubyonrails.org/) backend, and we are currently
transitioning to a [Preact](https://preactjs.com/)-first frontend.

View file

@ -5,7 +5,7 @@
<%= render partial: "articles/reaction_button",
locals: {
category: :like,
description: "Heart",
description: t("core.reactions.heart"),
image_path: "heart.svg",
image_active_path: "heart-filled.svg",
aria_label: "Like"
@ -13,7 +13,7 @@
<%= render partial: "articles/reaction_button",
locals: {
category: :unicorn,
description: "Unicorn",
description: t("core.reactions.unicorn"),
image_path: "unicorn.svg",
image_active_path: "unicorn-filled.svg",
aria_label: "React with unicorn"
@ -21,7 +21,7 @@
<%= render partial: "articles/reaction_button",
locals: {
category: :readinglist,
description: "Save",
description: t("core.reactions.save"),
image_path: "save.svg",
image_active_path: "save-filled.svg",
aria_label: "Add to reading list"
@ -51,35 +51,35 @@
class="crayons-link crayons-link--block"
rel="noopener"
href='https://twitter.com/intent/tweet?text=<%= u "\"#{@article.title.strip}\" by " %><%= u @article.user.twitter_username ? "@#{@article.user.twitter_username}" : @article.user.name %><%= u " #{Settings::General.twitter_hashtag} " %><%= u " #{article_url(@article)}" %>'>
Share to Twitter
<%= t("core.share_to", media: "Twitter") %>
</a>
<a
target="_blank"
class="crayons-link crayons-link--block"
rel="noopener"
href="https://www.linkedin.com/shareArticle?mini=true&url=<%= u article_url(@article) %>&title=<%= u @article.title %>&summary=<%= u @article.description %>&source=<%= u community_name %>">
Share to LinkedIn
<%= t("core.share_to", media: "LinkedIn") %>
</a>
<a
target="_blank"
class="crayons-link crayons-link--block"
rel="noopener"
href="https://www.reddit.com/submit?url=<%= u article_url(@article) %>&title=<%= u @article.title %>">
Share to Reddit
<%= t("core.share_to", media: "Reddit") %>
</a>
<a
target="_blank"
class="crayons-link crayons-link--block"
rel="noopener"
href="https://news.ycombinator.com/submitlink?u=<%= u article_url(@article) %>&t=<%= u @article.title %>">
Share to Hacker News
<%= t("core.share_to", media: "Hacker News") %>
</a>
<a
target="_blank"
class="crayons-link crayons-link--block"
rel="noopener"
href="https://www.facebook.com/sharer.php?u=<%= u article_url(@article) %>">
Share to Facebook
<%= t("core.share_to", media: "Facebook") %>
</a>
</div>

View file

@ -25,11 +25,16 @@ en:
popular_tags: Popular Tags
post: Post
reaction: Reaction
reactions:
heart: Heart
save: Save
unicorn: Unicorn
read_next: Read next
reply: Reply
report_abuse: Report abuse
search: Search
see_all: See all
share_to: Share to %{media}
trending_on: Trending on
view: View
week: Week

View file

@ -25,11 +25,16 @@ fr:
popular_tags: Sujets populaires
post: Publication
reaction: Réaction
reactions:
heart: Coeur
save: Sauver
unicorn: Licorne
read_next: Lire ensuite
reply: Répondre
report_abuse: Signaler un abus
search: Recherche
see_all: Tout voir
share_to: Partager sur %{media}
trending_on: Populaire sur
view: Vue
week: Semaine