Have your say in Community Polls: What was/is your greatest motivation to start your own business?

How can I fix the 'Translation Missing' error in my contact form?

Solved

How can I fix the 'Translation Missing' error in my contact form?

Limes
Tourist
3 0 0

Hey Guys, 

 

I added in some code to put into an additional Subject Line text field in my contact form - but it's coming up as Translation Missing as shown in the image. 

I've gone into the "edit default theme content" section to try and find the missing translation or add a new translation link in but I couldn't find anything / know how to do this. 

 

Could someone help me out? 

 

LiamSt_0-1698494870706.png

 

 

Accepted Solution (1)

fadi_yousif
Shopify Partner
345 43 67

This is an accepted solution.

Add the translation in locales/en.default.json. Use Ctrl+F or Cmd+F on macOS, type in "form": { (including the quotes) and hit enter. That's where you need to add the "subject" key-value pair.

Freelance Shopify Developer


Did I help? Leave a tip!

View solution in original post

Replies 3 (3)

fadi_yousif
Shopify Partner
345 43 67

This is an accepted solution.

Add the translation in locales/en.default.json. Use Ctrl+F or Cmd+F on macOS, type in "form": { (including the quotes) and hit enter. That's where you need to add the "subject" key-value pair.

Freelance Shopify Developer


Did I help? Leave a tip!

Limes
Tourist
3 0 0

Legend it works thanks Fadi

One additional question I did a test contact form run and I get this label (New customer message on %{creation_date}:) for where the subject line should be: 

Limes_0-1698536124885.png

Any idea where the code is to change that?

CalvinOU812
Excursionist
12 2 2

Change everything except one to "Subject-2" instead of "Subject".  Otherwise it uses the Subject line for the email you receive from the form.

 

In locales/en.default.json:

 

"contact": {
"form": {
"name": "Name",
"email": "Email",
"phone": "Phone Number",
"subject-2": "Subject",
"message": "Message",
"send": "Send",
"post_success": "Thanks for contacting us. We'll get back to you as soon as possible."
}

 

 

In page.contact.liquid:

 

{% include 'breadcrumb' %}

<div class="grid">

<div class="grid-item large--two-thirds push--large--one-sixth">

<h2>{{ page.title }}</h2>

<div class="rte">
{{ page.content }}
</div>

<div>
{% form 'contact' %}

{% if form.posted_successfully? %}
<p class="note form-success">
{{ 'contact.form.post_success' | t }}
</p>
{% endif %}

{% include 'form-errors-custom' %}

<div id="contactFormWrapper">

<label for="contactFormName" class="hidden-label">{{ 'contact.form.name' | t }}</label>
<input type="text" id="contactFormName" name="contact[name]" placeholder="{{ 'contact.form.name' | t }}" value="{% if form.name %}{{ form.name }}{% elsif customer %}{{ customer.name }}{% endif %}">

<label for="contactFormEmail" class="hidden-label">{{ 'contact.form.email' | t }}</label>
<input type="email" id="contactFormEmail" name="contact[email]" placeholder="{{ 'contact.form.email' | t }}" autocorrect="off" autocapitalize="off" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}">

<label for="contactFormPhone" class="hidden-label">{{ 'contact.form.phone' | t }}</label>
<input type="tel" id="contactFormPhone" name="contact[phone]" placeholder="{{ 'contact.form.phone' | t }}" value="{% if form.phone %}{{ form.phone }}{% elsif customer %}{{ customer.phone }}{% endif %}">

<label for="contactFormSubject-2" class="hidden-label">{{ 'contact.form.subject-2' | t }}</label>
<input type="text" id="contactFormSubject-2" name="contact[subject-2]" placeholder="{{ 'contact.form.subject-2' | t }}" value="{% if form.subject-2 %}{{ form.subject-2 }}{% elsif customer %}{{ customer.subject-2 }}{% endif %}">


<label for="contactFormMessage" class="hidden-label">{{ 'contact.form.message' | t }}</label>
<textarea rows="10" id="contactFormMessage" name="contact[body]" placeholder="{{ 'contact.form.message' | t }}">{% if form.body %}{{ form.body }}{% endif %}</textarea>

<input type="submit" class="btn right" value="{{ 'contact.form.send' | t }}">
</div>

{% endform %}
</div>

</div>

</div>