Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Automating .LSS Survey Translation to Multiple Languages (German, French, etc.)

  • danielaarias25
  • danielaarias25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 5 days ago #270588 by danielaarias25
Hi all,I'm working on a LimeSurvey project and need to translate a full
Code:
.lss
file into six languages that go beyond the Quick Translation tool's default capabilities. The goal is to automate the translation process and re-import the survey with the new language versions included.🧩 My Setup:
  • I have exported the
    Code:
    .lss
    file.
  • The base language is English.
  • I need to add the following target languages:
    • German (Germany)
    • German (Austria)
    • French
    • Dutch (Netherlands)
    • Hungarian
    • Dutch (Belgium/Flemish)
💡 Workflow I’d like to automate:
  1. Extract all translatable strings from the
    Code:
    .lss
    XML (questions, subquestions, labels, help texts, etc.).
  2. Send them to an AI translation engine (like DeepL or ChatGPT API).
  3. Generate translated text for each language.
  4. Insert those translations back into the correct XML structure under the appropriate
    Code:
    <questiontext lang="xx">
    ,
    Code:
    <answer lang="xx">
    , etc.
  5. Re-import the updated
    Code:
    .lss
    into LimeSurvey.
❓Questions:
  • Has anyone successfully built or used a script (Python, Node, etc.) to do this?
  • Is there a best practice for safely injecting multilingual content into
    Code:
    .lss
    without breaking the file?
  • Any tips for managing languages like Flemish separately from Dutch in LimeSurvey?
I’m happy to share a sample
Code:
.lss
if that helps. Any guidance, code examples, or tool recommendations are greatly appreciated!Thanks in advance 🙏
— Daniela

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 5 days ago #270589 by holch

file into six languages that go beyond the Quick Translation tool's default capabilities. The goal is to automate the translation process and re-import the survey with the new language versions included.


This won't work for a couple of reasons:

AI translation tools are incredibly bad at translating stuff they don't have context for. My suspiscion is that the errors for the normal GUI text strings would be pretty bad.

But, and this is the main issue here: Not all texts used in the respondent facing part of the survey is included in the LSS files. Basically everything that is NOT included in the quick translation is part of the language files of Limesurvey and Limesurvey substitutes the string based on the chosen language for the survey, drawing not from the LSS, but from the language files.

So the standard help texts from Limesurvey (not your individual ones, but the standard ones that come from Limesurvey are not included in the LSS files.

and another point: The LSS file includes all languages in one file (if you run 1 survey, you could also run x surveys, one for each language / location, then you need one LSS file for all.

So overall, I think it would be a lot more effort to create a script that does that for you, than to do it on your own.

Let's see if someone else has a good idea that I am not aware of.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 5 days ago #270593 by holch
Regarding Flemish: So far no Flemish language option exists in Limesurvey ( translate.limesurvey.org/projects/limesurvey-6/ )

So what you would need to do is basically create your 'own' language file for flemish. However, you did not answer the initial questions about Limesurvey version, where it is hosted, which theme is used, etc. that show up when you start a new topic.

Because to be able to upload your own language file you most probably need to have access to the server Limesurvey is installed on (self hosted basically). If it is hosted by your University or by Limesurvey GmbH, you depend on others, which is often complicated in the case of the university and in the case of Limesurvey Pro hosting through the Limesurvey GmbH will most probably charge something on a hourly basis for making those adaptions.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 5 days ago - 2 weeks 5 days ago #270595 by Joffm
If you really want to do this, I'd recommend a *.txt export.
In my opinion a simple small Excel Makro is sufficient to translate and add the translated phrases.
 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 weeks 5 days ago by Joffm.

Please Log in to join the conversation.

  • danielaarias25
  • danielaarias25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 4 days ago #270609 by danielaarias25
I have this: 
Version:  LimeSurvey Community Edition  Version 6.5.3+240415  
Host: BOKU universty Vienna
Theme: inherit (BOKU) 
And in "Theme options" it show: 
 

Please Log in to join the conversation.

  • danielaarias25
  • danielaarias25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 4 days ago #270610 by danielaarias25
I also noticed that for version after 6.x it should be available these languages:  translate.limesurvey.org/projects/limesurvey-6/  but actually...when I try to add a new languages...I cannot add for exmaple HUngarian or Dutch I only see these available languages....only french and german...I am still lacking: dutch hungarian 

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 4 days ago #270611 by holch
The admin of the installation can decide which languages are available to their users. So you would need to take this up with the admin responsible at the university.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • danielaarias25
  • danielaarias25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 days 12 hours ago #270688 by danielaarias25
I have manage to include the languges needed: Dutch, German, French and Hungarian (Flemish not possible). 

But the thing is...my survey is very big: is two surveys in one. One part is general questions for six cities and then choice experiment for each city different. So I have more than 347 questions because I have 240 choice cards for choice experiments. 

I cannot handle this manually in excel. I have the PDF of the survey already translated into the languages needed using the piad version of Deepl...I have attached the german PDF translated survey file for you to see....But now I need a python code or a IA tool that help me to put this PDF into a (.LSS) or (.TXT) that LIme can import. I need something that helps me to put the pdf translations into the .lss/.txt files automatic so I can import the translated suvrey into Lime...Because manually it will take forver and I need to launch the survey soon. 

I have attached the .lss, .txt file of the survey and the german PDF translation.

Thanks in advance  

File Attachment:

File Name: limesurvey..._LSS.zip
File Size:758 KB

File Attachment:

File Name: german_pdf.zip
File Size:1,823 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 days 10 hours ago #270690 by Joffm
Hi,
as far as I can see your pdf file doesn't contain any structure.
Furthermore missing linefeeds.
How do you imagine a program can analyse this?
How can you know which English question is translated?

What is 
  • question text
  • requirement of condition
  • help text
  • subquestion text
  • answer option text

Here I showed something similar - how an other commercial tool handles text files to create a survey
[url] forums.limesurvey.org/forum/can-i-do-thi...imesurvey-lss#270659 [/url]

Did you open the *.txt export in Excel.
Here you see the structure.
So it should be possible to loop through this file (language by language, in column I)
Read the English phrase, let it be translated, and write back the translated phrase.
So if there is a Python library to access, read and write Excel files, there shouldn't be a problem.
Unfortunarely I have no clue about python, but in php there are these things.

I saw that there seems to be a direct "Translate" function in Excel.
[url] www.youtube.com/watch?v=VMR2oa9pTxQ [/url]

Maybe it's helpful.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 days 7 hours ago - 5 days 7 hours ago #270694 by holch

I cannot handle this manually in excel.


Of course you can. You created the survey, now you need to translate the little monster into the languages you want. It might be tedious and time consuming, yes, but it is definitely possible.

I don't see any AI solution for this within Limesurvey, but you can certainly make your life easier by using an excel file.

However, the translation solution in Excel isn't the best. It is not bad, but it is not very automatic.

Google Sheets is far better, there is a formula that let's you translate automatically.

However, if your survey is important, automatic translations, while they have come a long way, they're are now in a phase where they are really, really dangerous. What do I mean with that?
They are so good, that you trust them. But you can't. I am working with all kinds of translation tools on a daily basis. They are good for two things:
  1. For languages you don't know, it can help you to get a ROUGH idea what is being said. But nothing more! Just for rough translations, nothing for production. Believe me, some of my clients try to save some money and do the translations themselves. Sometimes the translations are OK, but often I need to charge extra to correct the translations. You don't know the language you are translating to? Use AI and automatic translation tools like Deepl and Google Translate only for rough translations.
  2. You know the language. Here you can use AI and the automatic tools to speed up your translation. However, you still need to double check in detail, because I had the tools and Ai translate the total opposite what was said.

So, I use it, to speed up my work, but only for languages that I know. It helps me to translate things a lot quicker, yet from time to time I catch the translations being really, really wrong.

Especially in a self administered online questionnaire it is important that the translation is correct and good. Otherwise you can't trust the data afterwards. At least, let someone native read over it. I am sure at your university you'll find an Erasmus student for each of these languages and let them check the translation.

Just a little real life anectode. About 20 years ago i was responsible for a multi country and multi client study that ran every year in multiple countries.

One day our Italian intern decided that a word in the questionnaire was not necessary. When we got the results back and analyzed them, the specific item where the text was changed jumped 10% in importance compared to the past waves of the survey. And only in Italy, but not for the other 8 or so countries.

So, turns out that that little word the intern deleted made me have to appoligize personally to about a dozen clients, because I was the responsible project manager and I should have caught that.

Luckily we noticed the difference and investigated the reason behind it and did not just sell it to the clients as a rise in importance for this item.

The next year, with the little word back in, results where back to "normal".

By the way: The intern wasn't fired, because otherwise she was really good. But she definitely learned a valuable lesson for her future professional life I think.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
Last edit: 5 days 7 hours ago by holch.

Please Log in to join the conversation.

  • danielaarias25
  • danielaarias25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 days 12 hours ago #270706 by danielaarias25
I have the languages correctors (we called them translators) to check the translations we do automatically...so...then the best solution to automatically do it via excel right?

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 days 7 hours ago #270713 by holch
Well, as far as I know, Excel doesn't do it "automatically", but you need to do it cell by cell, but in Google Sheets you can create a formula, that takes a text in a cell and translates it from language A to language B.

However, be alert, because in my experience, those tools translate far better when you have a larger context than single strings. This is also the case for human translators. We can often see this with the translations of the LImesurvey GUI. You just have a shorte string and you don't know where this string is in the GUI. There are often several ways to translate it, which can all be correct, depending on the context.

But yeah, I would try to follow Joffm's instructions with the .txt export, which seems to be a better format. You can then import it into Excel / Google Sheets. I haven't done this, because I feel it is way quicker to do it by hand, which includes already a certain control, that you will have to do after importing anyway, so Joffm might have more knowledge about this workflow.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose