Non-question texts
All text that appears in the metadata section of the questionnaire (that is, questions, responses, shared lists, and information texts) can be translated. Text that appears in the routing section (for example, error texts and insert values) cannot be translated and is always displayed as it has been entered in the routing statements.
If you need to used fixed texts in the routing section and you want them to be translated, move the texts into
info items in the metadata section and then refer to them in the routing section using
ItemName.Label.Text. For examples, see the code samples in
Adding banners to questions and pages and
Using a custom validation function. Compare these examples with the routing code for the error handler in
Programmatically inserting text into labels. Although this example is generally translatable, the word “Unavailable” is hard-coded into the routing code and cannot be translated:
If (IOM.Info.RespondentID = "") Then
ErrorDisplay.Label.Inserts["RespId"].Text = "Unavailable"
Else
ErrorDisplay.Label.Inserts["RespId"].Text =
IOM.Info.RespondentID
End If
To make this example fully translatable, you could put “Unavailable” in an info item of that name and change the routing to refer to that item:
If (IOM.Info.RespondentID = "") Then
ErrorDisplay.Label.Inserts["RespId"].Text =
Unavailable.Label.Text
Else
ErrorDisplay.Label.Inserts["RespId"].Text =
IOM.Info.RespondentID
End If
Templates can sometimes contain text that needs translating. You can create different language versions of a template and, provided that you put them in the correct locations, the interviewing program will pick up the template that matches the interview language. See
Template types for details.
See also