Welcome to the LimeSurvey Community Forum

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

Redirect participant to language version of survey based on browser settings

More
2 weeks 6 days ago #274436 by superuser_does
We have self-hosted LimeSurvey CE. We want to route our users to take the survey in the language they've chosen for the website (e.g. de for German). We can do that easily if they have chosen a language...
However, sometimes they haven't chosen a language, which we store as null.

Where the participant's language is null on our website, we'd like to direct them automatically to the appropriate language version of our survey, based on their browser preferences (this is usually what the Accept-Language header of their browser reports).

I haven't found a way to do this within LimeSurvey. If I give the URL to the survey itself, it seems it just goes to the default language of the survey, which is English.
Is there a built-in way to redirect users based on how the language & locale settings are configured in their browser?

Please Log in to join the conversation.

More
2 weeks 5 days ago #274442 by holch
As someone who is using 4 languages on a regular basis, I find automatic redirection (at least if there is no way to change it after the redirect) as extremely annoying.

Unfortunately I have to choose one language my browser is installed to. This is sometimes based on the language of the OS. In my case for example, my OS is in Portuguese, based on the country where the computer was bought from. But I often want to read things in English, German or Spanish rather than Portuguese, based on the origin of the website, etc.

I don't think there is currently a way for Limesurvey to be redirected directly.

But in which language is your website presented to them, if they don't choose a language? In case of "null" I would redirect them to this default language of your website. But give the user the chance to change if they want to.

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.

More
2 weeks 5 days ago #274446 by superuser_does
We want to give an equal experience to all languages so there is no "default" as such. On our website, we show you what is best according to your preferences, and you can switch it if you want.
For background, it is essentially a multilingual webapp and we have roughly several million MAU across a number of languages.

Appreciate your response either way - we will have to build a language router for these cases which adds some complexity but not too much. It would be nice if LimeSurvey supported that in the future.

There is a language selection dropdown in case people do want to change their language (and it wasn't included as a URL parameter) so I don't think it would be excessive to ask.

Please Log in to join the conversation.

More
2 weeks 5 days ago #274449 by holch
I understand that there is no default as such. But for those where the language is stored as "null", which language did they see? You must know which language version they got presented with, right? There must be some kind of rule to which language they see, or am I totally understanding this wrong?

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.

More
2 weeks 5 days ago #274452 by superuser_does
No, I mean we don't store the user's preference at all, because they have not given us one.

More accurately, that datapoint does not exist for their user records. Our Mongo database returns "null" if we query for the user's language.

We simply give them the site in whatever language is prescribed in their HTTP request header.

Think of it like the "System default" option for language that you find in a lot of Android apps.

You can explicitly set your language of course... and only THEN would we have a language code for that specific user. Otherwise, we simply don't know.

Please Log in to join the conversation.

More
2 weeks 5 days ago #274454 by holch
OK, but couldn't you take "whatever language is prescribed in their HTTP request header" and save it into the database? And then overwrite it, when they set another language?

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.

More
2 weeks 5 days ago #274455 by superuser_does
That's beyond what I can influence I'm afraid! And I'm not sure it would be desirable. I can ask our developers though. Ultimately it is a scenario LS is not meeting, and from the conversation I had with our sysadmin, it would be better to work around it by influencing the URL.

So that'd mean sending users through a language-router interstitial page, instead of changing how our webapp sets & stores the language.

Please Log in to join the conversation.

More
2 weeks 5 days ago #274456 by holch
I have no insights on how your system works, but I would imagine that making changes to YOUR system is a lot easier for your team than to make changes to Limesurvey, just because you can control the whole system and they have experience with it.

The infrastructure to store the language is there, it is done already if the person makes changes.

And somehow the web app also knows the default language of the users device to show them this language as a default. So they basically need to take this language (which needs to be accessible somehow, as the initial language before any user changes is based on this) and store it in the database, just as if it was set by the user.

As I said, not an expert on your system, but from my point of view, sounds like the simplest solution and possibly helps you guys in other cases, where you might need the language the app was used in.

But of course, I have no deeper insights and there might be barriers that do not allow this. Who knows.

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