Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Switch templates for different languages

Switch templates for different languages 4 years 11 months ago #71187

  • socius
  • socius's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
Hi,

I'd like to switch templates according to the (by languageswitch) chosen survey language, to show different pictures, layout, or an imprint outside the standard-texts in the correct language. I didn't find an "easy" solution for this - I hope I didn't miss the answer searching this forum and the workarounds. (I'm not a programmer, unfortunately - so if this is just trivial or impossible, I didn't know :)

thank you very much for help!
g
The administrator has disabled public write access.

Switch templates for different languages 4 years 11 months ago #71196

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6571
  • Thank you received: 1477
  • Karma: 579
You can't switch templates dynamically but the <body> element is given a class depending on the language (.lang-en, .lang-nl, .lang-fr...).

In template.css, you can apply rules based on these classes to hide or show elements as desired.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: socius

Switch templates for different languages 4 years 11 months ago #71281

  • bwoo5
  • bwoo5's Avatar
  • Offline
  • Expert Lime
  • Posts: 80
  • Thank you received: 4
  • Karma: 0
You could make a one question survey asking the language, then based on the language choice use some code that will populate the load url at end of survey (then use the option to auto load url on survey completion) with the link to survey in different languages. Each of the different surveys can then have their own template.

Your other choice is just to have a simple html page that says "Please choose your language". Then have the languages listed and hyperlinks that link to each of the individual surveys in the language of choice with the different templates.
The administrator has disabled public write access.
The following user(s) said Thank You: socius

Switch templates for different languages 4 years 11 months ago #71282

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1894
  • Thank you received: 469
  • Karma: 118
Hi,

for media=screen:

1) Set a basic template.css more or less valid for all languages.
2) and link to a complementary stylesheet, for example using the source of the survey description for each language:
<link rel="stylesheet" type="text/css" href="{TEMPLATEURL}lang/en.css" />
<link rel="stylesheet" type="text/css" href="{TEMPLATEURL}lang/es.css" />
etc.

BTW, have a look here
Ben
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.
The following user(s) said Thank You: socius

Switch templates for different languages 4 years 11 months ago #71308

  • socius
  • socius's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
Great - thank you for your help! I'll try both solutions.

Thanks!
g
The administrator has disabled public write access.

Switch templates for different languages 4 years 10 months ago #71833

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
socius, if you succeeded to set this up, please document your solution at manual -> workarounds.

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

Switch templates for different languages 4 years 10 months ago #72521

  • socius
  • socius's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
Hi mazi,

I couldn't check the css-version yet, but probably will in may. workaround comes then.

thanks!
g
The administrator has disabled public write access.

Switch templates for different languages 4 years 10 months ago #72523

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
Thanks for your feedback, I'm looking forward to your solutuion.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.
Time to create page: 0.262 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form