views/tags etc i18n (#15039)
* views/tags etc i18n * remove ja.yml * YAML reformatting
This commit is contained in:
parent
22d1e6dd83
commit
7504a243fd
8 changed files with 152 additions and 44 deletions
|
|
@ -2,7 +2,8 @@
|
|||
<%= f.label field.attribute %>
|
||||
</div>
|
||||
<div class="field-unit__field">
|
||||
<%= f.text_field field.attribute, value: field.to_s, placeholder: "comma separated, space is optional. Example: 1,2,3" %>
|
||||
<sub>comma separated, space is optional. Example:
|
||||
<code style="background: #D2D2D2; padding: 4px; border-radius: 5px; font-weight: bold;">1,2,3</code></sub>
|
||||
<%= f.text_field field.attribute, value: field.to_s, placeholder: t("views.tags.moderator.placeholder") %>
|
||||
<sub>
|
||||
<%= t("views.tags.moderator.text_html", code: tag.code(t("views.tags.moderator.code"), style: "background: #D2D2D2; padding: 4px; border-radius: 5px; font-weight: bold;")) %>
|
||||
</sub>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
<% if @tag_model && @tag_model.rules_html.present? %>
|
||||
<div class="widget">
|
||||
<header>
|
||||
<h4>submission guidelines</h4>
|
||||
<h4><%= t("views.tags.sidebar.guidelines") %></h4>
|
||||
</header>
|
||||
<div class="widget-body">
|
||||
<%= sanitize @tag_model.rules_html %>
|
||||
<a class="crayons-btn crayons-btn--s" href="/new/<%= @tag %>">
|
||||
Create Post
|
||||
<%= t("views.tags.sidebar.new") %>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<% if @tag_model && @tag_model.wiki_body_html.present? %>
|
||||
<div class="widget">
|
||||
<header>
|
||||
<h4>about #<%= @tag %></h4>
|
||||
<h4><%= t("views.tags.sidebar.about", tag: @tag) %></h4>
|
||||
</header>
|
||||
<div class="widget-body">
|
||||
<%= sanitize @tag_model.wiki_body_html %>
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
<% if @tag_model.sponsorship && @tag_model.sponsorship.status == "live" && @tag_model.sponsorship.expires_at > Time.current %>
|
||||
<div class="widget">
|
||||
<header>
|
||||
<h4><%= @tag %> is sponsored by</h4>
|
||||
<h4><%= t("views.tags.sidebar.sponsor", tag: @tag) %></h4>
|
||||
</header>
|
||||
<div class="widget-body">
|
||||
<%= render "articles/single_sponsor", sponsorship: @tag_model.sponsorship %>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<% if @moderators.present? %>
|
||||
<div class="widget">
|
||||
<header>
|
||||
<h4>tag moderators</h4>
|
||||
<h4><%= t("views.tags.sidebar.mods") %></h4>
|
||||
</header>
|
||||
<div class="widget-body">
|
||||
<% @moderators.each do |user| %>
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
<% end %>
|
||||
<div class="sidebar-data">
|
||||
<div>
|
||||
<%= pluralize @num_published_articles, "Post" %> Published
|
||||
<%= t("views.tags.sidebar.published", count: @num_published_articles) %>
|
||||
</div>
|
||||
<% if user_signed_in? %>
|
||||
<div class="crayons-btn-group mt-3">
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
class="crayons-btn crayons-btn--outlined mod-action-button fs-s"
|
||||
href="<%= tag_url(@tag_model, @page) %>/edit"
|
||||
style="color:<%= @tag_model.text_color_hex %>;background-color:<%= @tag_model.bg_color_hex %>">
|
||||
Edit
|
||||
<%= t("views.tags.sidebar.edit") %>
|
||||
</a>
|
||||
<a style="display:none;"
|
||||
id="tag-admin-button"
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
href="<%= edit_admin_tag_path(@tag_model.id) %>"
|
||||
style="color:<%= @tag_model.text_color_hex %>;background-color:<%= @tag_model.bg_color_hex %>"
|
||||
data-no-instant>
|
||||
Admin
|
||||
<%= t("views.tags.sidebar.admin") %>
|
||||
</a>
|
||||
<a style="display:none;"
|
||||
id="tag-mod-button"
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
class="crayons-btn crayons-btn--outlined mod-action-button fs-s"
|
||||
href="/mod/<%= @tag_model.name %>"
|
||||
style="color:<%= @tag_model.text_color_hex %>;background-color:<%= @tag_model.bg_color_hex %>">
|
||||
Moderate
|
||||
<%= t("views.tags.sidebar.moderate") %>
|
||||
</a>
|
||||
</div>
|
||||
<% else %>
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
<% range = number_of_pages < 10 || @page < 4 ? 1..[number_of_pages, 9].min : [@page - 3, 1].max..[@page + 5, number_of_pages].min %>
|
||||
<% if number_of_pages > 1 %>
|
||||
<hr />
|
||||
<div class="olderposts-header">Older #<%= @tag %> posts</div>
|
||||
<div class="olderposts-header"><%= t("views.tags.sidebar.older", tag: @tag) %></div>
|
||||
<div class="olderposts-links">
|
||||
<% range.each do |n| %>
|
||||
<% if @page == n %>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
<% title "Edit #{@tag.name}" %>
|
||||
<% title t("views.tags.edit.meta.title", tag: @tag.name) %>
|
||||
|
||||
<div style="background-color:<%= @tag.bg_color_hex %>;color:<%= @tag.text_color_hex %>;">
|
||||
<div class="tag-or-query-header-container tag-edit-tag py-8 align-center">
|
||||
<h1> Editing:
|
||||
<a href="<%= URL.tag @tag %>" style="color: <%= @tag.text_color_hex %>;text-decoration: underline;"><%= @tag.name %></a>
|
||||
</h1>
|
||||
<h1><% t("views.tags.edit.heading_html", tag: link_to(@tag.name, URL.tag(@tag), style: "color: #{@tag.text_color_hex};text-decoration: underline;")) %></h1>
|
||||
<p>
|
||||
<code style="background-color: #D2D2D2; color: black; padding: 5px; border-radius: 5px;">#<%= @tag.name %></code> is the name of the tag used in Markdown.
|
||||
<%= t("views.tags.edit.markdown_html", tag: tag.code("##{@tag.name}", style: "background-color: #D2D2D2; color: black; padding: 5px; border-radius: 5px;")) %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -25,13 +23,14 @@
|
|||
<% end %>
|
||||
<h4>
|
||||
<a target="_blank" rel="noopener" href="https://thepracticaldev.s3.amazonaws.com/i/cc8vz48djnhty6c31jog.png">
|
||||
Click here to see an example of attributes.
|
||||
<%= t("views.tags.edit.form.example") %>
|
||||
</a>
|
||||
</h4>
|
||||
<% label_i18n = ->(param) { label_tag param, t("views.tags.edit.form.#{param}.label") } %>
|
||||
<div class="tag-form-field">
|
||||
<%= label_tag :pretty_name %>
|
||||
<br>
|
||||
<%= text_field_tag "tag[pretty_name]", @tag.pretty_name, placeholder: "This is the name at the top of the show page.", class: "tag-form-text-field" %>
|
||||
<%= text_field_tag "tag[pretty_name]", @tag.pretty_name, placeholder: t("views.tags.edit.form.pretty_name.placeholder"), class: "tag-form-text-field" %>
|
||||
</div>
|
||||
<div class="tag-form-field">
|
||||
<%= label_tag :bg_color_hex %>
|
||||
|
|
@ -46,27 +45,27 @@
|
|||
<div class="tag-form-field">
|
||||
<%= label_tag :short_summary %>
|
||||
<br>
|
||||
<%= text_area_tag "tag[short_summary]", @tag.short_summary, placeholder: "Brief overview of what this tag is all about.", class: "tag-form-text-field tag-area-text" %>
|
||||
<%= text_area_tag "tag[short_summary]", @tag.short_summary, placeholder: t("views.tags.edit.form.short_summary.placeholder"), class: "tag-form-text-field tag-area-text" %>
|
||||
</div>
|
||||
<div class="tag-form-field">
|
||||
<%= label_tag :wiki_body_markdown %>
|
||||
<br>
|
||||
<%= text_area_tag "tag[wiki_body_markdown]", @tag.wiki_body_markdown, placeholder: "This is an 'about' section. Feel free to add an FAQ, additional resources, etc.", class: "tag-form-text-field tag-area-text" %>
|
||||
<%= text_area_tag "tag[wiki_body_markdown]", @tag.wiki_body_markdown, placeholder: t("views.tags.edit.form.wiki_body_markdown.placeholder"), class: "tag-form-text-field tag-area-text" %>
|
||||
</div>
|
||||
<div class="tag-form-field">
|
||||
<%= label_tag :rules_markdown %>
|
||||
<br>
|
||||
<%= text_area_tag "tag[rules_markdown]", @tag.rules_markdown, placeholder: "Optional - Can be used for challenges, i.e. submission guidelines.", class: "tag-form-text-field tag-area-text" %>
|
||||
<%= text_area_tag "tag[rules_markdown]", @tag.rules_markdown, placeholder: t("views.tags.edit.form.rules_markdown.placeholder"), class: "tag-form-text-field tag-area-text" %>
|
||||
</div>
|
||||
<div class="tag-form-field">
|
||||
<%= submit_tag "SAVE CHANGES", class: "tag-edit-submit" %>
|
||||
<%= submit_tag t("views.tags.edit.form.submit"), class: "tag-edit-submit" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if current_user.has_role?(:super_admin) || current_user.has_role?(:admin) %>
|
||||
<center>
|
||||
<h1><a href="<%= edit_admin_tag_path(@tag.id) %>" data-no-instant><%= @tag.name %>'s admin page</a></h1>
|
||||
<h1><a href="<%= edit_admin_tag_path(@tag.id) %>" data-no-instant><%= t("views.tags.edit.admin", tag: @tag.name) %></a></h1>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
<% title t("core.tags") %>
|
||||
<% title t("views.tags.meta.title") %>
|
||||
|
||||
<%= content_for :page_meta do %>
|
||||
<link rel="canonical" href="<%= app_url("/tags") %>" />
|
||||
<meta name="description" content="<%= t("core.tags_to_follow", community_name: community_name) %>">
|
||||
<meta name="description" content="<%= t("views.tags.meta.description", community: community_name) %>">
|
||||
<%= meta_keywords_default %>
|
||||
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="<%= app_url("/tags") %>" />
|
||||
<meta property="og:title" content="<%= t("core.tags_to_follow", community_name: community_name) %>" />
|
||||
<meta property="og:title" content="<%= t("views.tags.meta.description", community: community_name) %>" />
|
||||
<meta property="og:image" content="<%= Settings::General.main_social_image %>" />
|
||||
<meta property="og:description" content="<%= t("core.community_name_is_great", community_name: community_name) %>" />
|
||||
<meta property="og:description" content="<%= t("views.tags.meta.og.description", community: 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="<%= t("core.community_name_is_great", community_name: community_name) %>">
|
||||
<meta name="twitter:title" content="<%= t("views.tags.meta.description", community: community_name) %>">
|
||||
<meta name="twitter:description" content="<%= t("views.tags.meta.og.description", community: 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><%= t("core.top_tags") %></h1>
|
||||
<%= link_to t("core.following_tags"), dashboard_following_tags_path, class: "crayons-btn crayons-btn--ghost" %>
|
||||
<h1><%= t("views.tags.heading") %></h1>
|
||||
<%= link_to t("views.tags.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">
|
||||
|
|
@ -38,9 +38,9 @@
|
|||
<p class="mb-2 color-base-70 truncate-at-3"><%= sanitize tag.short_summary %></p>
|
||||
<% end %>
|
||||
<p class="mb-3 fs-s color-base-60">
|
||||
<%= pluralize tag.taggings_count, "post" %> published
|
||||
<%= t("views.tags.published", count: tag.taggings_count) %>
|
||||
<% if tag.sponsorship && tag.sponsorship.status == "live" && tag.sponsorship.expires_at > Time.current %>
|
||||
| Sponsored by <%= tag.sponsorship.organization.name %> ❤️
|
||||
<%= t("views.tags.sponsor", org: tag.sponsorship.organization.name) %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
<button
|
||||
class="crayons-btn crayons-btn--secondary follow-action-button"
|
||||
data-info='{"id":<%= tag.id %>,"className":"Tag", "followStyle":"secondary", "name": "<%= tag.name %>"}'>
|
||||
<%= t("core.follow") %>
|
||||
<%= t("views.tags.follow") %>
|
||||
</button>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ en:
|
|||
follower: Follower
|
||||
followers: Followers
|
||||
following: Following
|
||||
following_tags: Following tags
|
||||
full: Full
|
||||
home: Home
|
||||
infinity: Infinity
|
||||
|
|
@ -63,9 +62,6 @@ en:
|
|||
settings: Settings
|
||||
share_to: Share to %{media}
|
||||
sign_out: Sign Out
|
||||
tags: Tags
|
||||
tags_to_follow: Tags to follow on %{community_name}
|
||||
top_tags: Top tags
|
||||
trending_on: Trending on
|
||||
view: View
|
||||
week: Week
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ fr:
|
|||
follower: Suiveur
|
||||
followers: Suiveurs
|
||||
following: Abonné
|
||||
following_tags: Sujets suivis
|
||||
full: Complet
|
||||
home: Page D'Accueil
|
||||
infinity: Infini
|
||||
|
|
@ -63,9 +62,6 @@ fr:
|
|||
settings: Paramètres
|
||||
share_to: Partager sur %{media}
|
||||
sign_out: Se déconnecter
|
||||
tags: Sujets
|
||||
tags_to_follow: Sujets dans %{community_name}
|
||||
top_tags: Sujets les plus utilisées
|
||||
trending_on: Populaire sur
|
||||
view: Vue
|
||||
week: Semaine
|
||||
|
|
|
|||
58
config/locales/views/tags/en.yml
Normal file
58
config/locales/views/tags/en.yml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
---
|
||||
en:
|
||||
views:
|
||||
tags:
|
||||
meta:
|
||||
title: Tags
|
||||
description: Tags to follow on %{community}
|
||||
og:
|
||||
description: "%{community} is great!"
|
||||
heading: Top tags
|
||||
edit:
|
||||
meta:
|
||||
title: Edit %{tag}
|
||||
heading_html: " Editing: %{tag}"
|
||||
admin: "%{tag}'s admin page"
|
||||
form:
|
||||
example: Click here to see an example of attributes.
|
||||
pretty_name:
|
||||
label: Pretty name
|
||||
placeholder: This is the name at the top of the show page.
|
||||
bg_color_hex:
|
||||
label: Bg color hex
|
||||
text_color_hex:
|
||||
label: Text color hex
|
||||
short_summary:
|
||||
label: Short summary
|
||||
placeholder: Brief overview of what this tag is all about.
|
||||
wiki_body_markdown:
|
||||
label: Wiki body markdown
|
||||
placeholder: This is an 'about' section. Feel free to add an FAQ, additional resources, etc.
|
||||
rules_markdown:
|
||||
label: Rules markdown
|
||||
placeholder: Optional - Can be used for challenges, i.e. submission guidelines.
|
||||
submit: SAVE CHANGES
|
||||
markdown_html: "%{tag} is the name of the tag used in Markdown."
|
||||
follow: Follow
|
||||
following_tags: Following tags
|
||||
moderator:
|
||||
text_html: "comma separated, space is optional. Example: %{code}"
|
||||
code: 123
|
||||
placeholder: "comma separated, space is optional. Example: 1,2,3"
|
||||
published:
|
||||
one: 1 post published
|
||||
other: "%{count} posts published"
|
||||
sidebar:
|
||||
about: 'about #%{tag}'
|
||||
admin: Admin
|
||||
edit: Edit
|
||||
guidelines: submission guidelines
|
||||
moderate: Moderate
|
||||
mods: tag moderators
|
||||
new: Create Post
|
||||
older: 'Older #%{tag} posts'
|
||||
published:
|
||||
one: 1 Post Published
|
||||
other: "%{count} Posts Published"
|
||||
sponsor: "%{tag} is sponsored by"
|
||||
sponsor: "| Sponsored by %{org} ❤️"
|
||||
58
config/locales/views/tags/fr.yml
Normal file
58
config/locales/views/tags/fr.yml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
---
|
||||
fr:
|
||||
views:
|
||||
tags:
|
||||
meta:
|
||||
title: Sujets
|
||||
description: Sujets dans %{community}
|
||||
og:
|
||||
description: "%{community} est super"
|
||||
heading: Sujets les plus utilisées
|
||||
edit:
|
||||
meta:
|
||||
title: Edit %{tag}
|
||||
heading_html: " Editing: %{tag}"
|
||||
admin: "%{tag}'s admin page"
|
||||
form:
|
||||
example: Click here to see an example of attributes.
|
||||
pretty_name:
|
||||
label: Pretty name
|
||||
placeholder: This is the name at the top of the show page.
|
||||
bg_color_hex:
|
||||
label: Bg color hex
|
||||
text_color_hex:
|
||||
label: Text color hex
|
||||
short_summary:
|
||||
label: Short summary
|
||||
placeholder: Brief overview of what this tag is all about.
|
||||
wiki_body_markdown:
|
||||
label: Wiki body markdown
|
||||
placeholder: This is an 'about' section. Feel free to add an FAQ, additional resources, etc.
|
||||
rules_markdown:
|
||||
label: Rules markdown
|
||||
placeholder: Optional - Can be used for challenges, i.e. submission guidelines.
|
||||
submit: SAVE CHANGES
|
||||
markdown_html: "%{tag} is the name of the tag used in Markdown."
|
||||
follow: Suivre
|
||||
following_tags: Sujets suivis
|
||||
moderator:
|
||||
text_html: "comma separated, space is optional. Example: %{code}"
|
||||
code: 123
|
||||
placeholder: "comma separated, space is optional. Example: 1,2,3"
|
||||
published:
|
||||
one: 1 post published
|
||||
other: "%{count} posts published"
|
||||
sidebar:
|
||||
about: 'about #%{tag}'
|
||||
admin: Admin
|
||||
edit: Edit
|
||||
guidelines: submission guidelines
|
||||
moderate: Moderate
|
||||
mods: tag moderators
|
||||
new: Create Post
|
||||
older: 'Older #%{tag} posts'
|
||||
published:
|
||||
one: 1 Post Published
|
||||
other: "%{count} Posts Published"
|
||||
sponsor: "%{tag} is sponsored by"
|
||||
sponsor: "| Sponsored by %{org} ❤️"
|
||||
Loading…
Add table
Reference in a new issue