article editor and manager i18n (#15070)

* article editor, manager i18n

* PR key name changes

* remove ja.yml
This commit is contained in:
yheuhtozr 2021-10-21 10:18:48 +09:00 committed by GitHub
parent 55a6bc3644
commit 7eea2b6a22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 134 additions and 29 deletions

View file

@ -49,7 +49,7 @@
</span>
<div class="crayons-field__label">
<span class="hidden s:inline-block mr-2">Create Post</span>
<span class="hidden s:inline-block mr-2"><%= t("views.editor.create") %></span>
<% if organizations && organizations.size > 0 %>
<select name="article[organization_id]" id="article_publish_under_org" class="crayons-select w-auto mt-0">
<%= options_for_select({ "Personal" => "" }.merge(organizations.pluck(:name, :id).to_h), article.organization_id || "") %>
@ -57,20 +57,20 @@
<% end %>
</div>
<nav class="crayons-article-form__tabs crayons-tabs ml-auto" aria-label="View post modes">
<nav class="crayons-article-form__tabs crayons-tabs ml-auto" aria-label="<%= t("views.editor.modes") %>">
<ul class="crayons-tabs__list">
<li>
<button data-text="Edit" class="crayons-tabs__item crayons-tabs__item--current" type="button" aria-current="page">Edit</button>
<button data-text="Edit" class="crayons-tabs__item crayons-tabs__item--current" type="button" aria-current="page"><%= t("views.editor.edit") %></button>
</li>
<li>
<button data-text="Preview" class="crayons-tabs__item " type="button">Preview</button>
<button data-text="Preview" class="crayons-tabs__item " type="button"><%= t("views.editor.preview") %></button>
</li>
</ul>
</nav>
<div class="crayons-article-form__close">
<a href="/" class="crayons-btn crayons-btn--ghost-dimmed crayons-btn--icon" title="Close the editor">
<%= inline_svg_tag("x.svg", aria: true, class: "crayons-icon", title: "Close") %>
<a href="/" class="crayons-btn crayons-btn--ghost-dimmed crayons-btn--icon" title="<%= t("views.editor.close.title") %>">
<%= inline_svg_tag("x.svg", aria: true, class: "crayons-icon", title: t("views.editor.close.icon")) %>
</a>
</div>
</div>
@ -84,13 +84,13 @@
<% end %>
<button class="crayons-btn crayons-btn--outlined mr-2">
<label for="cover-image-input">
<% if article.main_image.present? %>Change<% else %>Add a cover image<% end %>
<% if article.main_image.present? %><%= t("views.editor.cover_image.change") %><% else %><%= t("views.editor.cover_image.add") %><% end %>
</label>
<input id="cover-image-input" type="file" accept="image/*" class="w-100 h-100 absolute left-0 right-0 top-0 bottom-0 overflow-hidden opacity-0 cursor-pointer" data-max-file-size-mb="25">
</button>
</div>
<div class="crayons-article-form__title">
<textarea class="crayons-textfield crayons-textfield--ghost fs-3xl m:fs-4xl l:fs-5xl fw-bold s:fw-heavy lh-tight" type="text" id="article-form-title" placeholder="New post title here..." autocomplete="off"><%= article.title %></textarea>
<textarea class="crayons-textfield crayons-textfield--ghost fs-3xl m:fs-4xl l:fs-5xl fw-bold s:fw-heavy lh-tight" type="text" id="article-form-title" placeholder="<%= t("views.editor.new_title") %>" autocomplete="off"><%= article.title %></textarea>
</div>
</div>
<% end %>

View file

@ -1,17 +1,16 @@
<% title "Edit Post" %>
<% title t("views.editor.meta.title") %>
<% if @article.video.present? %>
<div class="article-form-video-preview">
<% if @article.video_state == "PROGRESSING" %>
<h1 style="color:#062144;margin-top:1.1em">⏳ Video Transcoding In Progress ⏳</h1>
<h1 style="color:#062144;margin-top:1.1em"><%= t("views.editor.video.progress.heading") %></h1>
<img src="https://media.giphy.com/media/tXL4FHPSnVJ0A/giphy.gif" style="border-radius:12px;height:317px" alt="Bored kid incessantly tapping his fingers">
<div style="max-width:500px;margin:18px auto 0px;font-size:0.8em;">
<p>
<strong>You'll get an email when this process finishes.</strong>
<strong><%= t("views.editor.video.progress.notice_1") %></strong>
</p>
<p>
<em>This is an ordinary unpublished post. Add title/tags/body/etc, and then mark as published after the video
is done processing.</em>
<em><%= t("views.editor.video.progress.notice_2") %></em>
</p>
</div>
<% elsif @article.video_state == "COMPLETED" %>
@ -19,8 +18,8 @@
<%= render "articles/video_player", meta_tags: false, article: @article %>
<div class="article-form-video-image-url">
<%= form_for(@article) do |f| %>
Preview Image URL: <%= f.text_field :video_thumbnail_url, placeholder: "New Thumbnail URL" %>
<%= f.submit "Submit Change", class: "crayons-btn" %>
<%= t("views.editor.video.submit_image.text") %><%= f.text_field :video_thumbnail_url, placeholder: t("views.editor.video.submit_image.placeholder") %>
<%= f.submit t("views.editor.video.submit_image.button"), class: "crayons-btn" %>
<% end %>
</div>
<% end %>

View file

@ -1,13 +1,13 @@
<% title "Manage #{@article.title}" %>
<% title t("views.manager.meta.title", title: @article.title) %>
<main id="main-content">
<div class="dashboard-manage-header">
<div class="dashboard-manage-header-inner-container">
<div class="dashboard-manage-nav">
<a href="/dashboard">Dashboard</a> 👉 Manage Your Post
<a href="/dashboard"><%= t("views.manager.nav.dashboard") %></a><%= t("views.manager.nav.text") %>
</div>
<% if flash[:error] %>
<div role="alert">
<h3 class="manage-page-error">Uh Oh! <%= flash[:error] %> 😬</h3>
<h3 class="manage-page-error"><%= t("views.manager.error.pins", error: flash[:pins_error]) %></h3>
</div>
<% end %>
<% if flash[:success] %>
@ -15,18 +15,18 @@
<h3 class="manage-page-success"><%= flash[:success] %></h3>
</div>
<% end %>
<h2>Tools:</h2>
<p><strong>Experience Level of Post:</strong> Is your post written more for a beginner or an advanced audience? Adjust this level as a <em>gentle</em> indicator which will help show the post to the people who will benefit the most.
<h2>Tips:</h2>
<h2><%= t("views.manager.tools.heading") %></h2>
<p><strong><%= t("views.manager.tools.subtitle") %></strong><%= t("views.manager.tools.text_html") %>
<h2><%= t("views.manager.tips.heading") %></h2>
<ol>
<li>
Write your own tweet about the post, describing personally why you wrote it or why people might find it useful. We may retweet you.
<%= t("views.manager.tips.text_1") %>
</li>
<li>
Share to link aggregators such as <a href="https://www.reddit.com">Reddit</a>. Try to choose the most topic-specific subreddits, such as <a href="https://www.reddit.com/r/javascript">/r/javascript</a> or <a href="https://www.reddit.com/r/python">/r/python</a>, etc. <em>Warning: jerks and trolls may be lurking.</em>
<%= t("views.manager.tips.text_2_html") %>
</li>
<li>
Share with your co-workers or local communities. Ask people to leave questions for you in the comments. It's a great way to spark additional discussion.
<%= t("views.manager.tips.text_3") %>
</li>
</ol>
</div>
@ -36,7 +36,7 @@
<%= render "dashboards/dashboard_article", article: @article, discussion_lock: @discussion_lock, organization: @article.organization, org_admin: @user.org_admin?(@article.organization), manage_view: true %>
<div class="single-article single-article-manage-form-wrapper">
<%= form_for(RatingVote.new) do |f| %>
<h2>Experience Level of Post</h2>
<h2><%= t("views.manager.rating.heading") %></h2>
<%= f.hidden_field :article_id, value: @article.id %>
<%= f.hidden_field :group, value: "experience_level" %>
<span class="button-section button-section-newbie">
@ -55,8 +55,8 @@
<button value="9" name="rating_vote[rating]" class="level-rating-button <%= "selected" if @rating_vote&.rating.to_d == 9.0.to_d %>">9</button>
<button value="10" name="rating_vote[rating]" class="level-rating-button <%= "selected" if @rating_vote&.rating.to_d == 10.0.to_d %>">10</button>
</span>
<p>Who is this post most relevant for?</p>
<p><span class="scale-pod">👈 Beginner</span><span class="scale-pod">Expert 👉</span></p>
<p><%= t("views.manager.rating.text") %></p>
<p><span class="scale-pod"><%= t("views.manager.rating.lower") %></span><span class="scale-pod"><%= t("views.manager.rating.higher") %></span></p>
<% end %>
</div>
</div>

View file

@ -1,4 +1,4 @@
<% title "New Post" %>
<% title t("views.editor.heading.new") %>
<%= content_for :page_meta do %>
<link rel="canonical" href="<%= app_url("/new") %>" />
<% end %>

View file

@ -75,7 +75,7 @@
<% end %>
<% if @article.video_state == "PROGRESSING" %>
<div class="crayons-notice crayons-notice--warning mb-4" aria-live="polite">⏳ Video Transcoding In Progress ⏳</div>
<div class="crayons-notice crayons-notice--warning mb-4" aria-live="polite"><%= t("views.editor.video.progress.heading") %></div>
<% end %>
<article class="crayons-card crayons-article mb-4"

View file

@ -0,0 +1,28 @@
---
en:
views:
editor:
meta:
title: Edit Post
heading:
new: New Post
create: Create Post
close:
icon: Close
title: Close the editor
cover_image:
add: Add a cover image
change: Change
edit: Edit
modes: View post modes
new_title: New post title here...
preview: Preview
video:
progress:
heading: "⏳ Video Transcoding In Progress ⏳"
notice_1: You'll get an email when this process finishes.
notice_2: This is an ordinary unpublished post. Add title/tags/body/etc, and then mark as published after the video is done processing.
submit_image:
button: Submit Change
text: 'Preview Image URL: '
placeholder: New Thumbnail URL

View file

@ -0,0 +1,28 @@
---
fr:
views:
editor:
meta:
title: Edit Post
heading:
new: New Post
create: Create Post
close:
icon: Close
title: Close the editor
cover_image:
add: Add a cover image
change: Change
edit: Edit
modes: View post modes
new_title: New post title here...
preview: Preview
video:
progress:
heading: "⏳ Video Transcoding In Progress ⏳"
notice_1: You'll get an email when this process finishes.
notice_2: This is an ordinary unpublished post. Add title/tags/body/etc, and then mark as published after the video is done processing.
submit_image:
button: Submit Change
text: 'Preview Image URL: '
placeholder: New Thumbnail URL

View file

@ -0,0 +1,25 @@
---
en:
views:
manager:
meta:
title: Manage %{title}
error:
pins: "Uh Oh! %{error} 😬"
tools:
heading: 'Tools:'
subtitle: 'Experience Level of Post:'
text_html: " Is your post written more for a beginner or an advanced audience? Adjust this level as a <em>gentle</em> indicator which will help show the post to the people who will benefit the most."
nav:
dashboard: Dashboard
text: " 👉 Manage Your Post"
rating:
heading: Experience Level of Post
text: Who is this post most relevant for?
lower: "👈 Beginner"
higher: "Expert 👉"
tips:
heading: 'Tips:'
text_1: Write your own tweet about the post, describing personally why you wrote it or why people might find it useful. We may retweet you.
text_2_html: 'Share to link aggregators such as <a href="https://www.reddit.com">Reddit</a>. Try to choose the most topic-specific subreddits, such as <a href="https://www.reddit.com/r/javascript">/r/javascript</a> or <a href="https://www.reddit.com/r/python">/r/python</a>, etc. <em>Warning: jerks and trolls may be lurking.</em>'
text_3: Share with your co-workers or local communities. Ask people to leave questions for you in the comments. It's a great way to spark additional discussion.

View file

@ -0,0 +1,25 @@
---
fr:
views:
manager:
meta:
title: Manage %{title}
error:
pins: "Uh Oh! %{error} 😬"
tools:
heading: 'Tools:'
subtitle: 'Experience Level of Post:'
text_html: " Is your post written more for a beginner or an advanced audience? Adjust this level as a <em>gentle</em> indicator which will help show the post to the people who will benefit the most."
nav:
dashboard: Dashboard
text: " 👉 Manage Your Post"
rating:
heading: Experience Level of Post
text: Who is this post most relevant for?
lower: "👈 Beginner"
higher: "Expert 👉"
tips:
heading: 'Tips:'
text_1: Write your own tweet about the post, describing personally why you wrote it or why people might find it useful. We may retweet you.
text_2_html: 'Share to link aggregators such as <a href="https://www.reddit.com">Reddit</a>. Try to choose the most topic-specific subreddits, such as <a href="https://www.reddit.com/r/javascript">/r/javascript</a> or <a href="https://www.reddit.com/r/python">/r/python</a>, etc. <em>Warning: jerks and trolls may be lurking.</em>'
text_3: Share with your co-workers or local communities. Ask people to leave questions for you in the comments. It's a great way to spark additional discussion.