From 824397b93fd3a30da6284af0350d4e7beedd89ef Mon Sep 17 00:00:00 2001 From: yheuhtozr <84892012+yheuhtozr@users.noreply.github.com> Date: Thu, 28 Oct 2021 00:37:29 +0900 Subject: [PATCH] views/listings etc i18n (#15040) * views/listings etc i18n * helper labels * remove ja.yml * Update edit.html.erb * Apply suggestions from code review Co-authored-by: Michael Kohl * Update delete_confirm.html.erb * Update edit.html.erb * Update fr.yml * Update edit.html.erb Co-authored-by: Michael Kohl --- app/views/listings/_form.html.erb | 48 ++++++------- app/views/listings/_form_errors.html.erb | 2 +- app/views/listings/_liquid.html.erb | 2 +- app/views/listings/delete_confirm.html.erb | 14 ++-- app/views/listings/edit.html.erb | 60 ++++++++-------- app/views/listings/index.html.erb | 14 ++-- app/views/listings/new.html.erb | 18 ++--- app/views/listings/show.html.erb | 4 +- app/views/social_previews/listing.html.erb | 2 +- config/locales/en.yml | 76 ++++++++++++++++++++ config/locales/fr.yml | 76 ++++++++++++++++++++ config/locales/helpers/en.yml | 7 ++ config/locales/helpers/fr.yml | 7 ++ config/locales/views/listings/en.yml | 83 ++++++++++++++++++++++ config/locales/views/listings/fr.yml | 83 ++++++++++++++++++++++ 15 files changed, 412 insertions(+), 84 deletions(-) create mode 100644 config/locales/views/listings/en.yml create mode 100644 config/locales/views/listings/fr.yml diff --git a/app/views/listings/_form.html.erb b/app/views/listings/_form.html.erb index 5ca953621..47a661a05 100644 --- a/app/views/listings/_form.html.erb +++ b/app/views/listings/_form.html.erb @@ -10,27 +10,27 @@
<%= form.label "title", class: "crayons-label" %> - <%= form.text_field "title", placeholder: "128 characters max, plain text", class: "crayons-textfield" %> + <%= form.text_field "title", placeholder: t("views.listings.form.title.placeholder"), class: "crayons-textfield" %>
- <%= form.label "body_markdown", "Body Markdown", class: "crayons-field__label" %> - <%= form.text_area "body_markdown", placeholder: "...", class: "crayons-textfield" %> -

400 characters max, 12 line break max, no images allowed, *markdown is encouraged*

+ <%= form.label "body_markdown", class: "crayons-field__label" %> + <%= form.text_area "body_markdown", placeholder: t("views.listings.form.body_markdown.placeholder"), class: "crayons-textfield" %> +

<%= t("views.listings.form.body_markdown.description") %>

- +
- Category details/rules + <%= t("views.listings.form.category.summary") %>
<%# The following tag_list field is overriden by the Tags JS component @@ -39,15 +39,15 @@ we prevent the screen from "jumping" once the deferred JS is loaded and executed. %>
- <%= form.label "tag_list", "Tags", class: "crayons-field__label" %> - <%= form.text_field "tag_list", placeholder: "Add up to 8 tags...", class: "crayons-textfield" %> + <%= form.label "tag_list", class: "crayons-field__label" %> + <%= form.text_field "tag_list", placeholder: t("views.listings.form.tags.placeholder"), class: "crayons-textfield" %>
0 %>
- <%= form.label "organization_id", "Post under an organization", class: "crayons-field__label" %> - <%= form.select :organization_id, { "None" => "None" }, {}, { class: "crayons-select m:max-w-50" } %> -

Posting on behalf of an organization spends the organization's credits.

+ <%= form.label "organization_id", class: "crayons-field__label" %> + <%= form.select :organization_id, { t("views.listings.form.organization.none") => "None" }, {}, { class: "crayons-select m:max-w-50" } %> +

<%= t("views.listings.form.organization.description") %>

<% end %> @@ -72,8 +72,8 @@ checked=true />
@@ -84,25 +84,25 @@ <% end %>
- <%= form.label "location", "Location (If applicable for events, etc.)", class: "crayons-field__label" %> - <%= form.text_field "location", placeholder: "New York", class: "crayons-textfield m:max-w-50" %> -

32 characters max, plain text

+ <%= form.label "location", t("views.listings.form.location.label"), class: "crayons-field__label" %> + <%= form.text_field "location", placeholder: t("views.listings.form.location.placeholder"), class: "crayons-textfield m:max-w-50" %> +

<%= t("views.listings.form.location.description") %>

<% unless @credits.size > 0 || (@organizations.present? && @organizations.sum(:unspent_credits_count) > 0) %> -
You need at least one credit to create a listing.
+
<%= t("views.listings.form.no_credit") %>
<% end %>
<% if @credits.size > 0 || (@organizations.present? && @organizations.sum(:unspent_credits_count) > 0) %> - <%= form.submit "Publish listing", class: "crayons-btn mr-2" %> + <%= form.submit t("views.listings.form.publish"), class: "crayons-btn mr-2" %> <% else %> - Purchase credits + <%= t("views.listings.form.purchase") %> <% end %> - <%= form.button "Save draft", type: "submit", name: "listing[action]", class: "crayons-btn crayons-btn--secondary", value: "draft" %> + <%= form.button t("views.listings.form.save"), type: "submit", name: "listing[action]", class: "crayons-btn crayons-btn--secondary", value: "draft" %>
-

You will not be charged credits to save a draft.

+

<%= t("views.listings.form.save_notice") %>

<% end %> diff --git a/app/views/listings/_form_errors.html.erb b/app/views/listings/_form_errors.html.erb index fbd7b28c8..b4aa669d8 100644 --- a/app/views/listings/_form_errors.html.erb +++ b/app/views/listings/_form_errors.html.erb @@ -1,6 +1,6 @@ <% if listing.errors.any? %>