Create, re-arrange and use some shared translation keys

Shared keys are used for greetings, signoffs, order confirmation string (incl. order number), contact distributor note and order edit note

Remaining translation keys for emails will be re-organized in a separate commit
This commit is contained in:
drummer83
2024-01-21 21:01:00 +01:00
parent fc8331e78b
commit 64fed25d9d
23 changed files with 83 additions and 75 deletions

View File

@@ -14,6 +14,6 @@
%p
= t('invite_email.mistakenly_sent', owner_email: @enterprise.owner.email)
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'
= render 'shared/mailers/social_and_contact'

View File

@@ -13,6 +13,6 @@
%p
= t(".email_community_html", link: link_to(t(".join_community"), ContentConfig.community_forum_url))
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'
= render 'shared/mailers/social_and_contact'

View File

@@ -107,20 +107,5 @@
= line_item[:last_name]
%p
= t :producer_mail_text_after
%p
= t(:producer_mail_signoff)
,
%em
%p
= @coordinator.name
%p
%br
= @coordinator.address.address1
%br
= @coordinator.address.city
%br
= @coordinator.address.zipcode
%p
= @coordinator.phone
%p
= @coordinator.contact.email
= render 'shared/mailers/signoff_enterprise'

View File

@@ -1,8 +0,0 @@
%p  
%p
= t :email_signoff
%br
= t :email_signature, sitename: Spree::Config[:site_name]
%p  

View File

@@ -1,6 +1,6 @@
%br
%p.callout
= t :email_confirm_customer_signoff
= t('.signoff')
%br
#{@order.distributor.contact_name}
%br

View File

@@ -0,0 +1,16 @@
%p
= t('.signoff')
%em
%p
= @coordinator.name
%p
%br
= @coordinator.address.address1
%br
= @coordinator.address.city
%br
= @coordinator.address.zipcode
%p
= @coordinator.phone
%p
= @coordinator.contact.email

View File

@@ -0,0 +1,8 @@
%p  
%p
= t('.signoff')
%br
= t('.signature', sitename: Spree::Config[:site_name])
%p  

View File

@@ -6,7 +6,7 @@
%tr
%td
%h5
= t :email_social
= t('.social')
%p.social-icons
- if ContentConfig.footer_facebook_url.present?
%a.soc-btn.fb{href: ContentConfig.footer_facebook_url}
@@ -25,7 +25,7 @@
%td
- if ContentConfig.footer_email.present?
%h5
= t :email_contact
= t('.contact')
%strong
= mail_to ContentConfig.footer_email
%span.clear

View File

@@ -6,15 +6,15 @@
%strong= @order.display_outstanding_balance
- else
- if @order.paid?
= t :email_payment_paid
= t 'spree.shared.payment.email_paid'
- else
= t :email_payment_not_paid
= t 'spree.shared.payment.email_not_paid'
%strong
= t :email_payment_summary
= t 'spree.shared.payment.email_summary'
- if @order.payments.any?
= render partial: 'spree/admin/orders/_invoice/payments_list', locals: { payments: @order.payments }
- if @order.last_payment_method
%p.callout{style: "margin-top: 40px"}
%strong
= t :email_payment_description
= t 'spree.shared.payment.email_description'
%p{style: "margin: 5px"}= @order.last_payment_method.description

View File

@@ -26,4 +26,4 @@
- else
= t(".unpaid_order")
= render 'signoff'
= render 'shared/mailers/signoff_distributor'

View File

@@ -10,7 +10,7 @@
enterprise_for_logo: @enterprise_for_logo }
%h4
= t :email_confirm_customer_number_html, number: @order.number
= t('mailers_shared.order_confirmation_html', number: @order.number)
%p
= t :email_confirm_customer_details_html, distributor: @order.distributor.name
@@ -18,4 +18,4 @@
= render 'spree/shared/payment'
= render 'shipping'
= render 'special_instructions'
= render 'signoff'
= render 'shared/mailers/signoff_distributor'

View File

@@ -10,7 +10,7 @@
enterprise_for_logo: @enterprise_for_logo }
%h4
= t :email_confirm_shop_number_html, number: @order.number
= t('mailers_shared.order_confirmation_html', number: @order.number)
%h5
%strong= "#{@order.bill_address.firstname} #{@order.bill_address.lastname}"
= " <#{@order.email}>" if @order.email
@@ -22,5 +22,5 @@
= render 'special_instructions'
%p &nbsp;
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'
= render 'shared/mailers/social_and_contact'

View File

@@ -9,4 +9,4 @@
intro: t(intro_key, distributor: @order.distributor.name),
enterprise_for_logo: @enterprise_for_logo }
= render 'signoff'
= render 'shared/mailers/signoff_distributor'

View File

@@ -5,4 +5,4 @@
locals: { greeting: t(greeting_key),
intro: t(intro_key) }
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'

View File

@@ -13,7 +13,7 @@
%strong
= link_to t(:email_confirmation_link_label), spree.spree_user_confirmation_url(:confirmation_token => @user.confirmation_token)
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'
%p.notice
= t :email_confirmation_notice_unexpected, sitename: @instance, contact: @contact

View File

@@ -18,6 +18,6 @@
%p
= t :email_signup_help_html, email: mail_to(ContentConfig.footer_email)
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'
= render 'shared/mailers/social_and_contact'

View File

@@ -12,14 +12,14 @@
%p.callout
= t("email_so_confirmation_explainer_html")
- if @order.user.present?
= t("email_so_edit_false_html",
= t("subscription_mailer.shared.edit_false_html",
orders_close_at: l(@order.order_cycle.orders_close_at, format: mail_long_datetime_format),
order_url: order_url(@order))
= t("email_so_contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email)
= t("subscription_mailer.shared.contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email)
%p &nbsp;
%h4
= t :email_confirm_customer_number_html, number: @order.number
= t("mailers_shared.order_confirmation_html", number: @order.number)
%p
= t("email_so_confirmation_details_html", distributor: @order.distributor.name)
@@ -29,4 +29,4 @@
= render 'spree/order_mailer/shipping'
= render 'spree/order_mailer/special_instructions'
= render 'spree/order_mailer/signoff'
= render 'shared/mailers/signoff_distributor'

View File

@@ -13,4 +13,4 @@
= render 'summary_detail', summary: @summary
%p &nbsp;
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'

View File

@@ -11,14 +11,14 @@
%p.callout
= t("email_so_empty_explainer_html")
= t("email_so_contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email)
= t("subscription_mailer.shared.contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email)
%p &nbsp;
%h4
= t :email_confirm_customer_number_html, number: @order.number
= t("mailers_shared.order_confirmation_html", number: @order.number)
%p
= t("email_so_empty_details_html", distributor: @order.distributor.name)
= render 'spree/order_mailer/order_summary'
= render 'spree/order_mailer/signoff'
= render 'shared/mailers/signoff_distributor'

View File

@@ -12,19 +12,19 @@
%p.callout
= t("email_so_failed_payment_explainer_html", distributor: @order.distributor.name)
- if @order.user.present?
= t("email_so_edit_false_html",
= t("subscription_mailer.shared.edit_false_html",
orders_close_at: l(@order.order_cycle.orders_close_at, format: mail_long_datetime_format),
order_url: order_url(@order))
= t("email_so_contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email)
= t("subscription_mailer.shared.contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email)
- if @order.errors.any?
%p &nbsp;
%h4
= t :email_confirm_customer_number_html, number: @order.number
= t("mailers_shared.order_confirmation_html", number: @order.number)
%p
= t("email_so_failed_payment_details_html", distributor: @order.distributor.name)
- @order.errors.full_messages.each do |message|
= message
%br
= render 'spree/order_mailer/signoff'
= render 'shared/mailers/signoff_distributor'

View File

@@ -14,10 +14,10 @@
- if @order.user.present?
- allow_changes = !!@order.distributor.allow_order_changes?
= t("email_so_edit_#{allow_changes}_html",
= t("subscription_mailer.shared.edit_#{allow_changes}_html",
orders_close_at: l(@order.order_cycle.orders_close_at, format: mail_long_datetime_format),
order_url: order_url(@order))
= t("email_so_contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email)
= t("subscription_mailer.shared.contact_distributor_html", distributor: @order.distributor.name, email: @order.distributor.contact.email)
- else
= t("email_so_contact_distributor_to_change_order_html",
orders_close_at: l(@order.order_cycle.orders_close_at, format: mail_long_datetime_format),
@@ -26,7 +26,7 @@
%p &nbsp;
%h4
= t :email_confirm_customer_number_html, number: @order.number
= t("mailers_shared.order_confirmation_html", number: @order.number)
%p
= t("email_so_placement_details_html", distributor: @order.distributor.name)
@@ -40,4 +40,4 @@
= render 'spree/order_mailer/shipping'
= render 'spree/order_mailer/special_instructions'
= render 'spree/order_mailer/signoff'
= render 'shared/mailers/signoff_distributor'

View File

@@ -13,4 +13,4 @@
= render 'summary_detail', summary: @summary
%p &nbsp;
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'

View File

@@ -371,6 +371,7 @@ en:
customer_greeting: "Dear %{name},"
enterprise_greeting: "Dear %{name},"
general_greeting: "Hello!"
order_confirmation_html: "Order confirmation <strong>#%{number}</strong>"
enterprise_mailer:
confirmation_instructions:
subject: "Please confirm the email address for %{enterprise}"
@@ -412,6 +413,10 @@ en:
track_information: "Tracking Information: %{tracking}"
track_link: "Tracking Link: %{url}"
subscription_mailer:
shared:
edit_true_html: "You can <a href='%{order_url}'>make changes</a> until orders close on %{orders_close_at}."
edit_false_html: "You can <a href='%{order_url}'>view details of this order</a> at any time."
contact_distributor_html: "If you have any questions you can contact <strong>%{distributor}</strong> via %{email}."
placement_email:
intro_html: "You have a new order with <strong>%{distributor}</strong>."
placement_summary_email:
@@ -453,6 +458,18 @@ en:
intro_html: "We tried to place a new order with <strong>%{distributor}</strong>, but had some problems..."
failed_payment_email:
intro_html: "We tried to process a payment for <strong>%{distributor}</strong>, but had some problems..."
shared:
mailers:
signoff_distributor:
signoff: "Kind regards,"
signoff_enterprise:
signoff: "Thanks and best wishes,"
signoff_instance:
signoff: "Cheers,"
signature: "%{sitename} Team"
social_and_contact:
social: "Connect with Us:"
contact: "Email us:"
provider_settings: "Provider settings"
@@ -2427,15 +2444,8 @@ To activate your Profile we need to confirm this email address."
email_confirmation_help_html: "After confirming your email you can access your administration account for this enterprise.
See the %{link} to find out more about %{sitename}'s features and to start using your profile or online store."
email_confirmation_notice_unexpected: "You received this message because you signed up on %{sitename}, or were invited to sign up by someone you probably know. If you don't understand why you are receiving this email, please write to %{contact}."
email_social: "Connect with Us:"
email_contact: "Email us:"
email_signoff: "Cheers,"
email_signature: "%{sitename} Team"
email_confirm_customer_number_html: "Order confirmation <strong>#%{number}</strong>"
email_confirm_customer_details_html: "Here are your order details from <strong>%{distributor}</strong>:"
email_confirm_customer_signoff: "Kind regards,"
email_confirm_shop_number_html: "Order confirmation <strong>#%{number}</strong>"
email_order_summary_item: "Item"
email_order_summary_quantity: "Qty"
email_order_summary_sku: "SKU"
@@ -2443,17 +2453,10 @@ See the %{link} to find out more about %{sitename}'s features and to start using
email_order_summary_subtotal: "Subtotal:"
email_order_summary_total: "Total:"
email_order_summary_includes_tax: "(includes tax):"
email_payment_paid: PAID
email_payment_not_paid: NOT PAID
email_payment_description: Payment Description at Checkout
email_payment_summary: Payment summary
email_payment_method: "Paying via:"
email_so_placement_details_html: "Here are the details of your order for <strong>%{distributor}</strong>:"
email_so_placement_changes: "Unfortunately, not all products that you requested were available. The original quantities that you requested appear crossed-out below."
email_so_placement_explainer_html: "This order was automatically created for you."
email_so_edit_true_html: "You can <a href='%{order_url}'>make changes</a> until orders close on %{orders_close_at}."
email_so_edit_false_html: "You can <a href='%{order_url}'>view details of this order</a> at any time."
email_so_contact_distributor_html: "If you have any questions you can contact <strong>%{distributor}</strong> via %{email}."
email_so_contact_distributor_to_change_order_html: "This order was automatically created for you. You can make changes until orders close on %{orders_close_at} by contacting <strong>%{distributor}</strong> via %{email}."
email_so_confirmation_explainer_html: "This order was automatically placed for you, and it has now been finalised."
email_so_confirmation_details_html: "Here's everything you need to know about your order from <strong>%{distributor}</strong>:"
@@ -2485,7 +2488,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using
producer_mail_order_text: "Here is a summary of the orders for your products:"
producer_mail_delivery_instructions: "Stock pickup/delivery instructions:"
producer_mail_text_after: ""
producer_mail_signoff: "Thanks and best wishes"
producer_mail_order_customer_text: "Here is a summary of the orders grouped by customers"
shopping_oc_closed: Orders are closed
@@ -4201,6 +4203,11 @@ See the %{link} to find out more about %{sitename}'s features and to start using
update: "Update"
cancel: "Cancel"
shared:
payment:
email_paid: "PAID"
email_not_paid: "NOT PAID"
email_summary: "Payment summary"
email_description: "Payment Description at Checkout"
error_messages:
errors_prohibited_this_record_from_being_saved:
one: "1 error prohibited this record from being saved:"