Configure the query for multi-language surveys
The individual JavaScript files must be correctly integrated into the index file so that the survey can be displayed correctly in the WebApp in all languages created. Additional icons may also need to be integrated for newly created languages.
- Go to the
Home tab and click on
Start job, then select the export job „Feedback_V2_Export_00_Start“ to generate the .js files for the new feedback form. This creates another file with the new language code for each existing JavaScript file.
Example: "Feedback_Template_Feedback_NewYearsEve.js" is supplemented by "Feedback_Template_Feedback_NewYearsEve-pt.js" - Go to the
Configurations tab and select
Web >
Web Folder Administration, then open the folder
Feedback_V2 >
Templates. All existing JS files should be stored in this folder. - In the
Feedback_V2 folder, select the
HTML-file "Demo_Mulit-Lanuage", click on
Save to hard drive in the toolbar and select a filing location. - Copy the file and Save it under a new name.
Example: Feedback_NewYearsEve.html - Open the new file in an editor.
- Replace the name of the old JavaScript file with the name of the new JavaScript file in three places in the HTML file. The prefix remains the same, it is sufficient to replace the name of the new feedback.
Example: the old survey is called "Demo_Mehrsprachig", the new survey is called "Feedback_NewYearsEve"- in line 44: document.getElementById("Language").setAttribute("data-bpWebApp-templateDataSrc", "templates/Feedback_Template_Feedback_Silvesterball.js")
- in Zeile 48: document.getElementById("Sprache").setAttribute("data-bpWebApp-templateDataSrc", "templates/Feedback_Template_Feedback_NewYearsEve_"+lang+".js");
- All settings are included for the standard languages English and French. For newly created languages, some of the buttons, flags, IDs, classes or HTML tags must be added individually.
- button, e.g. <button title="Portuguese" onclick="startBpWebApp('pt');" id="PT"><img src="images/portugal_24.png" alt=""></button>
Note: Save the new icon to a suitable location and reference it correctly in the HTML or Css file. -
document.getElementById("PT").setAttribute("title", bpWebApp.localeObj[locale].Portuguese)
- button, e.g. <button title="Portuguese" onclick="startBpWebApp('pt');" id="PT"><img src="images/portugal_24.png" alt=""></button>
- In order NOT to use languages that have already been created in a survey, the corresponding lines in the HTML file MUST be deleted or commented out (<! -->).
Save the new index file locally under the name "Feedback_NewYearsEve.html".- Click on
Add in the
Web Folder and select
Upload files, then select the new HTML file.
Confirm the new file and close the
Web Folder.