Internationalization - single questionnaire method

In ViewsFlash 8.1, a new method for constructing and delivering multiple-language questionnaires is available. This method is not available in Portlets; use the older method in that case.

The steps to follow, in summary, are as follows:

  1. Create a questionnaire in the original language using a special naming convention: add "_i18n_xx" to the questionnaire's name, where xx is the original language's code, such as "en" for English. For example, "Practice!environment_i18n_en". The original language does not have to be English.
  2. In the General page's description field, describe the languages that the questionnaire will be translated into by putting at the end of the description the following: locales:en,es,fr,it
    In this example, the questionnaire will be translated into English, Spanish, French and Italian.
  3. Test the questionnaire thoroughly in the original language until it works as intended in every respect.
  4. On the Publish page, check [x] Extract keys and create questionnaire and publish again. This creates another questionnaire, with the same name but the "_18n_xx" removed from its name, such as "Practice!environment". This questionnaire, referred to as the "production questionnaire", is used to collect responses. The questionnaire is locked and should not be changed. To make any changes, change the original _i18n_ questionnaire and use [x] Extract again, which will transfer all changes to the production questionnaire.
  5. In this questionnaire, all text is replaced by "keys", such as [/i18n,-header], and the removed text is stored in a Translations table, VWF_I18N, which contains the keys, the text, and the language. The original questionnaire's language is left blank and becomes the default language.
  6. To Translate the questionnaire, use the "Translations" link on the left side menu.This opens up a Translations page that allows entering translations of all the text extracted to the translations table.
  7. Participants who fill out the questionnaire use it normally, using the generated questionnaire's id, such as "Practice!environment". The participant will see the questionnaire in the preferred language of their browser. This can be overridden by adding a parameter to the questionnaire's URL: &use.locale=fr. If the requrested translation is not avaiable, the participant is redirected to a language selection page that allows chosing among the available languages.
  8. All data is collected as specified in the production questionnaire's Data settings page.

Translations can be revised any time by using the Translations page.Changes made are live immediately.

In addition to editing translations using the Translation page, it is possible to use properties files as follows.

  1. In the Translations page, use the Download tool to extract all the keys and text as a properties file.
  2. A translator, using a copy of the original survey generated by Preview, creates a new properties file for a new language by replacing the text and keeping the keys the same.
  3. In the Translations page, use the Upload tool to upload the translated properties file to the appropriate language.

It is also possible to deploy an internationalized questionnaire and all of its translations by including all the components inside a customized ViewsFlash.war file as follows:

  1. Stage the questionnaire with the _i18n_xx suffis, and include its .definition.ser, .poll.cnf.ser, and .spot.ser files in the WEB-INF/classes/com/cogix/vwfdata directory, and list the surveys in the xx.properties file in that directory.
  2. When these questionnaires are loaded, properties files for the questionnaires will be loaded from WEB-INF/classes/com/cogix/i18n directory. The property file names should be environment_en.properties, environment_fr,properties, and so on.
  3. Note that text from these properties files only inserts keys and text into the the Translations table; it never updates it. If an updated version of the properties files is used, only items with keys that hadn't been loaded before will be inserted.

Note: if all multi-lingual surveys are to be avaialable in the same set of languages, use a servlet property to set them as default:
i18nlanguages=en,fr,it,es
These languages will be merged with any languages listed in the questionnaire description's locales: list, if any.

To turn a questionnaire that has been used in production already into a questionnaire in multiple languages using this technique, create a copy of the questionnaire and add " _i18n_xx" to its name. Make any further changes in the i18n questionnaire and use it as described above. If that name is too long, the survey cannot be used with this technique.

Once a questionnaire has been published and data has been gathered, it is possible to modify the original questionnaire as follows. Make the changes (adding questions, changing text) in the _i18n_xx questionnaire. Test it until satisfied. Then use [x] Extract keys in the Publish page and use Translate to download and uploaded property files. It is only necessary to translate and upload those that have changed. The UI can also be used to translate what is new without using properties iles. Data in the production survey will be preserved; any changes that need to be made to the database tables will also be made.

The Messages option cannot be used with i18n questionnaires and is not available in the menu options.

HTML used in questions, headers or footers is copied to the extracted properties files and must be respected when translating the text. For example, a <b>bold</b> tag must be preserved in translation. If the HTML is complex, try to simplify it so that it won't be cumbersome for the translators. If it is still too complex, then follow these instructions to break up the question into pieces and generate multiple keys manually.

  1. Insert the tag [/no-i18n] at the very beginning of the question text, header or footer. This prevents the normal key and text extraction from taking place.
  2. Scan the text and replace segements of text with your own tags, as in this example:[/i18n,~firstpartoftext] Note that this uses the "`" tilde character rather than a dash. As you are doing this, prepare a properties file that contains the key and the text, such as: ~firstpartoftext=The original text
  3. Extract the keys in the Publish page as usual. Then use the uplload option in the Translations page to add these keys and text to the translations table. After that, the downloaded prooperties files will contain all they keys and text. Note that these keys can ony be translated with properties files.

 

Next:  Installation