We have 2 possible layouts of forms, that have translatable fields on them:
1. show all fields on all languages at once
- getting very large form, when there are a lot of translatable fields on it
+ no need to refresh form to enter field value on other language
2. only field on current language is visible
+ small form
- need to refresh form and validate all data to enter value from other language
We need to invent something new, that will allow to enter field values on different languages without form refresh and that doesn't make forms bigger, when new languages are added to the site.
In 2nd approach errors from translatable field on any language are redirected back to field on primary language.
- you have l1_Name and l2_Name fields on form;
- 2nd language is primary;
- in case of error in l1_Name field it will be shown under l2_Name field.
So here is the solution, that should fit our needs without even requiring extra space for additional controls. No new controls added only existing controls will work a bit different:
1. each translatable field will have input controls on all languages, but only one control per field will be visible at a time;
2. dropdown on top (with language list) will affect all translatable fields and will make controls on new selected language become visible (instead of previous current language) without form refresh;
3. top dropdown name will be "m_lang", so it will be remembered as form language once form is submitted;
4. translatable fields should use "inp_edit_box_ml" and "inp_edit_textarea_ml" blocks for this to work;
5. mentioned above blocks needs to be rewritten to support such behavior.