How to set the default language (using pyxform to convert xlsx to xml)


(Alfonso C) #1

Dear Forum,

I have been testing the output of pyxform, trying to understanding how to "impose" the language I want to use as default. I had the following issue:

  • survey and choices sheet with 2 languages (e.g. Portuguese (pt) and Español (es) ),
  • default_language set to pt,
  • portuguese columns coming first in all sheets.
  • still, xml has the Espanol label first and the phone will take it as default language

(of course you can change it from the Menu, but we wanted to have it automatic)

I realized that pyxform chooses as default language the one whose label come first, i.e., if I have a "calculate" type question with a label in Spanish (second language in my survey), but not in Portuguese (first language in the survey) pyxform will set Spanish as default.

My solution for this is to add a "calculate" variable at the beginning, and put a label only in the column corresponding to the default language that I want.

Did anybody experienced a similar issue or observed a similar behavior? Is there a better solution?

(Yaw Anokwa) #2

@Ukang_a_Dickson I think this might be a bug in pyxform?

(Ukang'a Dickson) #3

We can look into this. I won't mind having an example XLSForm from Alfonso. Has an issue been created?

(Hélène Martin) #4

Have you tried setting default_language to Portuguese (pt) rather than pt? The language code is a convention that can be used by clients but pyxform has no knowledge of it. The value in default_language should match the full language description in the column header.

If that’s still not working, I agree a sample form would help!