DIRKMJK / limepy

Download and summarise LimeSurvey data
MIT License
24 stars 8 forks source link

Survey in multiple languages #9

Closed amyisard closed 4 years ago

amyisard commented 4 years ago

I'm using LimeSurvey version 2.62. with two languages. If I create a Question object my_question and then print my_question.question and my_question.summary I get the question title only in one language, and the answers for each language. Is there a way to access the languages explicitly?

Mussten Sie Informationen angeben, um Zugriff auf das Korpus zu erhalten?

      Count  Percent  Valid Percent
Yes    11.0     30.6           73.3
No      4.0     11.1           26.7
Ja     11.0     30.6           73.3
Nein    4.0     11.1           26.7

The beginning of my survey.lss file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Survey</LimeSurveyDocType>
 <DBVersion>261</DBVersion>
 <languages>
  <language>de</language>
  <language>en</language>
 </languages>
 <answers>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>code</fieldname>
   <fieldname>answer</fieldname>
   <fieldname>assessment_value</fieldname>
   <fieldname>sortorder</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[501861]]></qid>
    <code><![CDATA[A1]]></code>
    <answer><![CDATA[Yes]]></answer>
    <assessment_value><![CDATA[0]]></assessment_value>
    <sortorder><![CDATA[1]]></sortorder>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
   <row>
    <qid><![CDATA[501861]]></qid>
    <code><![CDATA[A1]]></code>
    <answer><![CDATA[Ja]]></answer>
    <assessment_value><![CDATA[0]]></assessment_value>
    <sortorder><![CDATA[1]]></sortorder>
    <language><![CDATA[de]]></language>
    <scale_id><![CDATA[0]]></scale_id>
   </row>
DIRKMJK commented 4 years ago

Hi, I hadn’t thought of this. I’ll try and take a look this weekend whether this is something that can be fixed easily.

DIRKMJK commented 4 years ago

I’ve added the option to specify which language you want to use (I tried to make this work for older versions of LimeSurvey as well). Hopefully this will solve your problem

amyisard commented 4 years ago

Thanks for your quick response! I'll check that out.