Actions

Multilingual survey: Difference between revisions

From LimeSurvey Manual

mNo edit summary
m (Text replacement - " enclose="div"" to "")
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages />
<translate>
<!--T:1-->
__TOC__
__TOC__




=Introduction=
=Introduction= <!--T:2-->




LimeSurvey provides the feature of running one survey in several translations at the same time without the need to copy it.  
<!--T:3-->
LimeSurvey contains a built-in facility that enables quick and easy translation of surveys. This facility is designed to make it easy for a human translator to translate a survey from the base language into any specified target language.


<!--T:4-->
This wiki section quickly covers how a multilingual survey can be created. The guide covers topics such as:
This wiki section quickly covers how a multilingual survey can be created. The guide covers topics such as:


<!--T:5-->
* [[Multilingual survey#Adding additional languages|the addition of a second language]]
* [[Multilingual survey#Adding additional languages|the addition of a second language]]


<!--T:6-->
* [[Multilingual survey#Translating strings|string translation]]
* [[Multilingual survey#Translating strings|string translation]]


<!--T:7-->
* [[Multilingual survey#Quick-translation tool|quick-translation tool]]
* [[Multilingual survey#Quick-translation tool|quick-translation tool]]


* [[Multilingual survey|Multilingual survey overview|multilingual survey overview]]
<!--T:8-->
* [[Multilingual survey#Multilingual survey overview|multilingual survey overview]]


The example analysed throughout the wiki section can be downloaded from here: [[Media:Ls3 sample survey multilingual fr de en it.zip|LS3 multilingual survey sample]]. To import it, unzip it and [[Surveys_-_introduction#Import_a_survey|import]] the .lss file into your LimeSurvey instance.


<!--T:9-->
The example analysed throughout the wiki section can be downloaded from here: [[Media:Ls3 sample survey multilingual fr de en it.zip|LS3 multilingual survey sample]]. Unzip it and [[Surveys_-_introduction#Import_a_survey|import]] the .lss file into your LimeSurvey instance.


==Adding additional languages==


==Adding additional languages== <!--T:10-->


<!--T:11-->
The default language of the survey is the one you selected in the [[General_settings#Base_language|base language field]]. By default, it is the language configured in the [[Global_settings#Language|global settings]] of your instance.
The default language of the survey is the one you selected in the [[General_settings#Base_language|base language field]]. By default, it is the language configured in the [[Global_settings#Language|global settings]] of your instance.


To check which language is the base one, access the general survey settings panel and see the base language field. In our example, the base language is "English". To start adding new languages in which you wish to translate the survey to, see the additional languages field. In our example, four other languages have been selected: French, German, and Italian:
<!--T:12-->
To check which language is the base one, access the [[General settings|general survey settings panel]] and look for the base language field. In our example, the base language is "English". To start adding new languages in which you wish to translate the survey into, see the additional languages field. In our example, three other languages have been selected: French, German, and Italian.




<!--T:13-->
<center>[[File:Multilinguar survey - add additional language.png]]</center>
<center>[[File:Multilinguar survey - add additional language.png]]</center>




<!--T:14-->
Once done, do not forget to click on the '''"Save"''' button located in the upper right side of the screen.
Once done, do not forget to click on the '''"Save"''' button located in the upper right side of the screen.


Now, if you check the top toolbar, you can observe that a small arrow appeared next to "Preview survey". This means that the survey can be previewed in four different languages:
<!--T:15-->
Now, if you check the top toolbar, you can observe that a small arrow appeared next to "Preview survey". This means that the survey can be previewed in different languages:




<!--T:16-->
<center>[[File:Multilingual survey - preview.png]]</center>
<center>[[File:Multilingual survey - preview.png]]</center>




<!--T:17-->
If you access the [[Overview#Introduction|overview]] panel, four extra survey links are displayed. They correspond to the recently added languages:
If you access the [[Overview#Introduction|overview]] panel, four extra survey links are displayed. They correspond to the recently added languages:




<!--T:18-->
<center>[[File:Multilingual survey - four links.png]]</center>
<center>[[File:Multilingual survey - four links.png]]</center>


 
==Translating strings== <!--T:19-->
==Translating strings==




<!--T:20-->
To start translating strings, access the editor panel of each of your question. You can observe in the below screenshot that three additional languages are displayed above the question code field:
To start translating strings, access the editor panel of each of your question. You can observe in the below screenshot that three additional languages are displayed above the question code field:




<!--T:21-->
<center>[[File:Multilingual survey - languages bar .png]]</center>
<center>[[File:Multilingual survey - languages bar .png]]</center>




<!--T:22-->
Click on any of them and start translating the question field.
Click on any of them and start translating the question field.


<!--T:23-->
The same type of "language bar" is located in many other places such as in the text elements and data policy settings panels, answer and subquestion text fields, and so on. However, translating fields using this method can get tricky if your survey is long and you wish not to miss anything. That is why we heavily recommend our users to use the quick translation tool. To access it, click on any survey-related setting (such as "Overview") -> [[Tools]] -> [[Quick-translation]]
The same type of "language bar" is located in many other places such as in the text elements and data policy settings panels, answer and subquestion text fields, and so on. However, translating fields using this method can get tricky if your survey is long and you wish not to miss anything. That is why we heavily recommend our users to use the quick translation tool. To access it, click on any survey-related setting (such as "Overview") -> [[Tools]] -> [[Quick-translation]]




<!--T:24-->
<center>[[File:Quick-translation tool - location.png]]</center>
<center>[[File:Quick-translation tool - location.png]]</center>




===Quick-translation tool===
===Quick-translation tool=== <!--T:25-->




<!--T:26-->
The quick-translation tool has been specifically designed for those that work with multilingual surveys. Once accessed, the following panel will be loaded:
The quick-translation tool has been specifically designed for those that work with multilingual surveys. Once accessed, the following panel will be loaded:




<!--T:27-->
<center>[[File:Multilingual survey - translate survey.png]]</center>
<center>[[File:Multilingual survey - translate survey.png]]</center>




The first option, '''translate to''' gives you the possibility to select the language you wish to translate into from your base language.
<!--T:28-->
The first option, '''translate to''', gives you the possibility to select the language you wish to translate into from your base language.


<!--T:29-->
The next options refer to the translation of your survey content. They refer to:
The next options refer to the translation of your survey content. They refer to:


*[[Text_elements#Survey_title|Survey title]] and [Text_elements#Description|description]]
<!--T:30-->
*[[Text_elements#Survey_title|Survey title]] and [[Text_elements#Description|description]]
*[[Text_elements#Welcome_message|Welcome and end texts]]
*[[Text_elements#Welcome_message|Welcome and end texts]]
*[[Question groups - introduction|Question groups]]
*[[Question groups - introduction|Question groups]]
Line 86: Line 115:
*[[Email_templates#Registration|Registration email subject]]
*[[Email_templates#Registration|Registration email subject]]


<!--T:31-->
{{Note|Please note that at the moment of writing this section (LimeSurvey 3.16.0), the following sections are translatable but not displayed in this panel:
{{Note|Please note that at the moment of writing this section (LimeSurvey 3.16.0), the following sections are translatable but not displayed in this panel:


<!--T:32-->
*[[Data policy settings|Data policy text]]
*[[Data policy settings|Data policy text]]
*[[Assessments|Assessment text]]
*[[Assessments|Assessment text]]
*[[Survey quotas|Quota text]]
*[[Survey quotas|Quota text]]


<!--T:33-->
To translate them, please access each option and follow the steps described in the previous wiki subsection.}}
To translate them, please access each option and follow the steps described in the previous wiki subsection.}}




<!--T:34-->
Once you are done translating these fields, do not forget to click on the '''"Save"''' button located in the upper right part of the panel.
Once you are done translating these fields, do not forget to click on the '''"Save"''' button located in the upper right part of the panel.




==Multilingual survey overview==
==Multilingual survey overview== <!--T:35-->




<!--T:36-->
To check your work, use the preview button. The welcome page will look like this:
To check your work, use the preview button. The welcome page will look like this:




<!--T:37-->
<center>[[File:Multilingual survey - Italian.png]]</center>
<center>[[File:Multilingual survey - Italian.png]]</center>




<!--T:38-->
Two language switcher can be observed once the welcome page is loaded. LimeSurvey offers the possibility to your respondents to change the language of instructions even though you shared with them the corresponding link for a specific language. A language switcher will also be located on the top right-side of your survey.  
Two language switcher can be observed once the welcome page is loaded. LimeSurvey offers the possibility to your respondents to change the language of instructions even though you shared with them the corresponding link for a specific language. A language switcher will also be located on the top right-side of your survey.  


In the case in which you wish to hide the two Language switcher buttons, edit the theme of your survey. For more details, see the [[Multilingual survey#Hints & tips|hints & tips wiki subsection]].
<!--T:39-->
In the case in which you wish to hide the two "language switcher" buttons, edit the theme of your survey. For more details, see the [[Multilingual survey#Hints & tips|hints & tips wiki subsection]].




=Hints & tips=
<!--T:40-->
{{Note|In the case in which a string is not translated, the respective string will be displayed in the base language of your survey.}}




==How to hide the language switcher from the welcome page==
=Hints & tips= <!--T:41-->




<!--T:42-->
* If you wish to grant users translation permissions to access the quick-translation tool, check the following [[Quick-translation#Requirements|wiki subsection]].
<!--T:43-->
* The "Auto-translate" feature makes use of the Google translate web service for automatic translation of a survey. You must enter your Google Translate API Key under global settings to access this feature. Google currently charges $20 US per 1 million characters submitted for translation.
==How to hide the language switcher from the welcome page== <!--T:44-->
<!--T:45-->
In the case in which you decide to launch a multilingual survey, you will observe on the welcome page a drop-down menu that permits your respondents to select the language in which they wish to fill in your survey:
In the case in which you decide to launch a multilingual survey, you will observe on the welcome page a drop-down menu that permits your respondents to select the language in which they wish to fill in your survey:




<!--T:46-->
<center>[[File:Language switcher show languages.png]]</center>
<center>[[File:Language switcher show languages.png]]</center>
   
   


However, in certain scenarios you wish to hide the respective option. There are many ways in which you can hide the language switcher. The "twig" way is displayed below.
<!--T:47-->
However, in certain scenarios you wish to hide the respective option. There are many ways in which you can hide the language switcher. The '''"twig"''' way is displayed below.


Access [[Themes]] from the global [[Administering LimeSurvey|Configuration menu]].
<!--T:48-->
Access [[Themes]] from the global [[Administering LimeSurvey|Configuration menu]]:




<!--T:49-->
<center>[[File:Language switcher themes.png]]</center>
<center>[[File:Language switcher themes.png]]</center>




Click on the ''Theme editor'' button to edit the desired theme:
<!--T:50-->
Click on the '''Theme editor''' button to edit the desired theme:




<!--T:51-->
<center>[[File:Language switcher theme editor.png]]</center>
<center>[[File:Language switcher theme editor.png]]</center>




{{Note|LimeSurvey does not allow you to edit the standard themes! If you wish to add changes to a standard team, click on the ''Extend'' button located on the top bar to create a copy of the standard theme.}}
<!--T:52-->
{{Note|LimeSurvey does not allow you to edit the standard themes! If you wish to add changes to a standard theme, click on the '''Extend''' button located on the top bar to create an editable copy of it.}}




Look on the left side of the screen for the language_changer.twig file.
<!--T:53-->
Look on the left side of the screen for the '''language_changer.twig''' file.




<!--T:54-->
<center>[[File:Location language switcher twig.png]]</center>
<center>[[File:Location language switcher twig.png]]</center>




<!--T:55-->
Go to the line that contains the following function:  
Go to the line that contains the following function:  


<syntaxhighlight lang="php" enclose="div">
<!--T:56-->
<syntaxhighlight lang="php">
{% if aSurveyInfo.alanguageChanger.show == true %}
{% if aSurveyInfo.alanguageChanger.show == true %}
</syntaxhighlight>
</syntaxhighlight>


<!--T:57-->
Comment it out (replace "%" with "#") and copy the following line below it:
Comment it out (replace "%" with "#") and copy the following line below it:


<syntaxhighlight lang="php" enclose="div">
<!--T:58-->
<syntaxhighlight lang="php">
{% if false == true %}
{% if false == true %}
</syntaxhighlight>
</syntaxhighlight>




<!--T:59-->
The line should look like this in the end:
The line should look like this in the end:




<!--T:60-->
<center>[[File:Language switcher code replacement.png]]</center>
<center>[[File:Language switcher code replacement.png]]</center>




<!--T:61-->
Click on "Copy to local theme and save changes".
Click on "Copy to local theme and save changes".




<!--T:62-->
Access your survey and select the edited theme from the [[General settings|general settings]] panel. Now, the welcome page should look like this:
Access your survey and select the edited theme from the [[General settings|general settings]] panel. Now, the welcome page should look like this:




<!--T:63-->
<center>[[File:Hide language switcher twig.png]]</center>
<center>[[File:Hide language switcher twig.png]]</center>




==How to hide the language switcher located on the top menu==
==How to hide the language switcher located on the top menu== <!--T:64-->




<!--T:65-->
To hide the top language switcher, we will follow pretty much the same steps as described above. We just have to access the right twig file to edit it. Access again the theme you wish to change, and then go to '''Screen''' which is located in the upper-right part of the window and select '''Navigation''' from the dropdown list. Now, look on the left side of the window for "language_changer_top_menu.twig". Click on it and comment out:
To hide the top language switcher, we will follow pretty much the same steps as described above. We just have to access the right twig file to edit it. Access again the theme you wish to change, and then go to '''Screen''' which is located in the upper-right part of the window and select '''Navigation''' from the dropdown list. Now, look on the left side of the window for "language_changer_top_menu.twig". Click on it and comment out:


<syntaxhighlight lang="php" enclose="div">
<!--T:66-->
<syntaxhighlight lang="php">
{% if aSurveyInfo.alanguageChanger.show == true %}
{% if aSurveyInfo.alanguageChanger.show == true %}
</syntaxhighlight>
</syntaxhighlight>


<!--T:67-->
Add the following line below it:
Add the following line below it:


<syntaxhighlight lang="php" enclose="div">
<!--T:68-->
<syntaxhighlight lang="php">
{% if false == true %}
{% if false == true %}
</syntaxhighlight>
</syntaxhighlight>


<!--T:69-->
No language switcher will be displayed on the right side of the screen:
No language switcher will be displayed on the right side of the screen:




<!--T:70-->
<center>[[File:Language switcher hide top menu.png]]</center>
<center>[[File:Language switcher hide top menu.png]]</center>
</translate>

Latest revision as of 15:11, 16 February 2022


Introduction

LimeSurvey contains a built-in facility that enables quick and easy translation of surveys. This facility is designed to make it easy for a human translator to translate a survey from the base language into any specified target language.

This wiki section quickly covers how a multilingual survey can be created. The guide covers topics such as:


The example analysed throughout the wiki section can be downloaded from here: LS3 multilingual survey sample. Unzip it and import the .lss file into your LimeSurvey instance.


Adding additional languages

The default language of the survey is the one you selected in the base language field. By default, it is the language configured in the global settings of your instance.

To check which language is the base one, access the general survey settings panel and look for the base language field. In our example, the base language is "English". To start adding new languages in which you wish to translate the survey into, see the additional languages field. In our example, three other languages have been selected: French, German, and Italian.



Once done, do not forget to click on the "Save" button located in the upper right side of the screen.

Now, if you check the top toolbar, you can observe that a small arrow appeared next to "Preview survey". This means that the survey can be previewed in different languages:



If you access the overview panel, four extra survey links are displayed. They correspond to the recently added languages:


Translating strings

To start translating strings, access the editor panel of each of your question. You can observe in the below screenshot that three additional languages are displayed above the question code field:



Click on any of them and start translating the question field.

The same type of "language bar" is located in many other places such as in the text elements and data policy settings panels, answer and subquestion text fields, and so on. However, translating fields using this method can get tricky if your survey is long and you wish not to miss anything. That is why we heavily recommend our users to use the quick translation tool. To access it, click on any survey-related setting (such as "Overview") -> Tools -> Quick-translation



Quick-translation tool

The quick-translation tool has been specifically designed for those that work with multilingual surveys. Once accessed, the following panel will be loaded:



The first option, translate to, gives you the possibility to select the language you wish to translate into from your base language.

The next options refer to the translation of your survey content. They refer to:

Please note that at the moment of writing this section (LimeSurvey 3.16.0), the following sections are translatable but not displayed in this panel: To translate them, please access each option and follow the steps described in the previous wiki subsection.


Once you are done translating these fields, do not forget to click on the "Save" button located in the upper right part of the panel.


Multilingual survey overview

To check your work, use the preview button. The welcome page will look like this:



Two language switcher can be observed once the welcome page is loaded. LimeSurvey offers the possibility to your respondents to change the language of instructions even though you shared with them the corresponding link for a specific language. A language switcher will also be located on the top right-side of your survey.

In the case in which you wish to hide the two "language switcher" buttons, edit the theme of your survey. For more details, see the hints & tips wiki subsection.


In the case in which a string is not translated, the respective string will be displayed in the base language of your survey.


Hints & tips

  • If you wish to grant users translation permissions to access the quick-translation tool, check the following wiki subsection.
  • The "Auto-translate" feature makes use of the Google translate web service for automatic translation of a survey. You must enter your Google Translate API Key under global settings to access this feature. Google currently charges $20 US per 1 million characters submitted for translation.


How to hide the language switcher from the welcome page

In the case in which you decide to launch a multilingual survey, you will observe on the welcome page a drop-down menu that permits your respondents to select the language in which they wish to fill in your survey:



However, in certain scenarios you wish to hide the respective option. There are many ways in which you can hide the language switcher. The "twig" way is displayed below.

Access Themes from the global Configuration menu:



Click on the Theme editor button to edit the desired theme:



LimeSurvey does not allow you to edit the standard themes! If you wish to add changes to a standard theme, click on the Extend button located on the top bar to create an editable copy of it.


Look on the left side of the screen for the language_changer.twig file.



Go to the line that contains the following function:

{% if aSurveyInfo.alanguageChanger.show == true %}

Comment it out (replace "%" with "#") and copy the following line below it:

{% if false == true %}


The line should look like this in the end:



Click on "Copy to local theme and save changes".


Access your survey and select the edited theme from the general settings panel. Now, the welcome page should look like this:



How to hide the language switcher located on the top menu

To hide the top language switcher, we will follow pretty much the same steps as described above. We just have to access the right twig file to edit it. Access again the theme you wish to change, and then go to Screen which is located in the upper-right part of the window and select Navigation from the dropdown list. Now, look on the left side of the window for "language_changer_top_menu.twig". Click on it and comment out:

{% if aSurveyInfo.alanguageChanger.show == true %}

Add the following line below it:

{% if false == true %}

No language switcher will be displayed on the right side of the screen: