Welcome to the LimeSurvey Community Forum

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

Refer to survey language in question

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 11 months ago #196111 by Jmantysalo
Refer to survey language in question was created by Jmantysalo
release_notes.txt says "New feature #4661 : add some placeholder : {SURVEYLANG}, {SURVEYFORMAT}, {SURVEYCONTACT}". If I put "{SURVEYCONTACT}" to a question text, it works, but "{SURVEYLANG}" does not. What is the right variable for survey language?

(Actually I want a logo to depend on language, but this should be a step towards it.)
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #196114 by Joffm
Replied by Joffm on topic Refer to survey language in question
Hi,
For your first question I only know {LANG} which returns the code of the language.

Okay, the second:
In your "custom.css"
Code:
body.lang-en img.logo-de {
  display: none;
}
 
body.lang-de img.logo-en {
  display: none;
}

and in "nav-bar.twig"

{{ image('./files/myLogoForEnglish.png', 'alt-text for my file', {"class": "logo-en"}) }}
{{ image('./files/myLogoForGerman.png', 'alt-text for my file', {"class": "logo-de"}) }}


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 11 months ago #196117 by Jmantysalo
Replied by Jmantysalo on topic Refer to survey language in question
Thanks. {LANG} works.

About logo: is it possible to have default logo (i.e. English) for those languages that have no own logos (in my cases, all others than Finnish).
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 11 months ago #197028 by Jmantysalo
Replied by Jmantysalo on topic Refer to survey language in question
Answering to myself: I end up having

{{ image('./files/tunilogo_fi.png', aSurveyInfo.name, {"class": "logo-fi"}) }}
{{ image('./files/tunilogo_en.png', aSurveyInfo.name, {"class": "logo-en"}) }}

at nav_bar.twig and on custom.css

:not(:lang(fi)) .logo-fi { display: none; }
:lang(fi) .logo-en { display: none; }
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose