Welcome, Guest
Username: Password: Remember me

TOPIC: Switch templates for different languages

Switch templates for different languages 2 years 10 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.

Re: Switch templates for different languages 2 years 10 months ago #71196

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4297
  • Thank you received: 811
  • Karma: 374
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: socius

Re: Switch templates for different languages 2 years 10 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

Re: Switch templates for different languages 2 years 10 months ago #71282

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1125
  • Thank you received: 259
  • Karma: 79
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

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.
The following user(s) said Thank You: socius

Re: Switch templates for different languages 2 years 10 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.

Re: Switch templates for different languages 2 years 9 months ago #71833

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5351
  • Thank you received: 299
  • Karma: 250
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)limesurvey.org'"
The administrator has disabled public write access.

Re: Switch templates for different languages 2 years 9 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.

Re: Switch templates for different languages 2 years 9 months ago #72523

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5351
  • Thank you received: 299
  • Karma: 250
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)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.118 seconds
Donation Image