0

I'm trying to create multilingual questionnaire based on SharePoint list. Our first idea was to use column display names for english text and column description for other language. But SharePoint displays column description not under column name, but under input field.

Is it possible to change rendering layout of new/edit/view forms and put description just under the column name?

At the moment we trying another approach - name all the questions like Q1..Qn and use javascript to put actual text to the forms.

<script type='text/javascript' language='javascript'>
function Translate()
{
var TranslateEn={};
TranslateEn['Q1']='English text for Question 1?';
TranslateEn['Q2']='English text for Question 2?';
TranslateEn['Q3']='English text for Question 3?';

var labels=document.querySelectorAll("td.ms-formlabel > h3");
for (i = 0; i < labels.length; ++i) {
  var txt = labels[i].children[0].innerText;
  if (txt in TranslateEn)
{
  labels[i].appendChild(document.createElement('div')).innerHTML = "<nobr>" + TranslateEn[txt] + "</nobr>";
}
}
}
_spBodyOnLoadFunctionNames.push("insertLineBreaks");
</script>

It works, but with a delay so users can see how texts are replaced, and it has a problem if we use popup dialogs for new/edit form - size of form is not recalculated to the new text length.

Could someone recommend more correct solution?

1 Answer 1

1

In 2013 its all done with CSR and much easier.

For 2010 you are on the right track, but have to program around the issues you experience.

You can prevent the flash by making the default Form display='none' and make it visible after your Translation processing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.