davidslvto / ShopTranslator-Theme

This theme is for your reference for translating
http://thinkorange.pt
3 stars 1 forks source link

Feature Request: Form #7

Open variousauthors opened 11 years ago

variousauthors commented 11 years ago

Translating forms using the current "block" setup is time consuming. It would be great if you could provide a GUI tailor made for localizing forms, including labels and placeholder text, as well as error messages. For example, localizing the following with the current setup is going to be a challenge:

<!-- TODO: think of a clever way to localize this -->
{% for field in form.errors %}
  <p>{{ form.errors.messages[field] }}.</p>
{% endfor %}

Thanks!

psousa commented 11 years ago

Could you elaborate? What would be the expected result from a gui interface?

variousauthors commented 11 years ago

I think it is a matter of logical grouping. Consider this flow:

Then, when creating a form on their shop they include the following:

{% assign form_h = "book-eye-exam" %}
<form>
  {% assign field_h = "name" %}
  <label>{% include 'translations' %}</label>
  <input type="text" name="contact[name]" placeholder="{% include 'translations' with 'placeholder' %}" />
  {% assign field_h = null %}
</form>
{% assign form_h = null %}

You could do something similar for filling in all the options in a select. This is not a form builder: it just allows the user to group "blocks" logically into a form, rather than having to have a few dozen blocks with names like "form-eye-exam-name-placeholder".

Thanks!