- Posts: 168
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Hiding language that is not yet translated
- ymca
- Topic Author
- Offline
- Elite Member
Can I hide a language that is not yet translated or that is not finished yet?
So survey that has full translation in first and second languages, will not show the third language that is not fully translated.
Or that is a feature to ask?
LS Version 4.2+
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13648
- Thank you received: 2491
github.com/LimeSurvey/LimeSurvey/blob/ma...anguage_changer.twig
github.com/LimeSurvey/LimeSurvey/blob/ma...nger_first_page.twig
github.com/LimeSurvey/LimeSurvey/blob/ma...hanger_top_menu.twig
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
- ymca
- Topic Author
- Offline
- Elite Member
- Posts: 168
- Thank you received: 2
I know, but I think it's problematic.DenisChenu wrote: You can udate the mlanguage changer in theme and create your own.
github.com/LimeSurvey/LimeSurvey/blob/ma...anguage_changer.twig
github.com/LimeSurvey/LimeSurvey/blob/ma...nger_first_page.twig
github.com/LimeSurvey/LimeSurvey/blob/ma...hanger_top_menu.twig
Because, when I have some surveys that have all translation, when I make a new survey that has less translations, then it will hide all surveys languages and not specific survey translation.
LS Version 4.2+
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10109
- Thank you received: 3595
<body style="padding-top: 90px;" class=" {{ aSurveyInfo.class.body }} font-{{ aSurveyInfo.options.font }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {% if( aSurveyInfo.options.brandlogo == "on") %}brand-logo{%endif%}" {{ aSurveyInfo.attr.body }} data-sid="{{ aSurveyInfo.sid }}">
Then you can target the language link(s) by survey ID and language.
Either hide it with CSS - something like this in your custom.css file:
body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"] { display: none; }
Or remove it with JavaScript - something like this in your custom.js file:
$(document).on('ready pjax:scriptcomplete',function(){ $('body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"]').closest('li').remove(); });
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- ymca
- Topic Author
- Offline
- Elite Member
- Posts: 168
- Thank you received: 2
It's all about "Reading comprehension".
I saw it like you writing to me 3 options instead of first doing the "layout_global.twig".
So I've tried to first do the "js" and then tried "css". :laugh:
Then I read it again and understood that I first need the "twig".
Now it's working perfectly
Good feature for noobs/translators.
p.s.
What is best place to use for the function?
css or js?
LS Version 4.2+
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10109
- Thank you received: 3595
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- ymca
- Topic Author
- Offline
- Elite Member
- Posts: 168
- Thank you received: 2
If site is in English:
1. starting survey
2. No "pt-BR"
If site is in "pt-BR"
1. Starting survey
2. survey is in "pt-BR"
LS Version 4.2+
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13648
- Thank you received: 2491
tpartner wrote: I would prefer to use the JS as it completely removes the link so it would not be available even to keyboard navigation.
body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"] { display: none; }
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10109
- Thank you received: 3595
This workaround only removes the link from the language selector (per your original post) it does not disable the language so, of course, you will be able to access it with a URL parameter.If site is in English:
1. starting survey
2. No "pt-BR"
If site is in "pt-BR"
1. Starting survey
2. survey is in "pt-BR"
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10109
- Thank you received: 3595
I need to learn more about keyboard navigation.DenisChenu wrote:
tpartner wrote: I would prefer to use the JS as it completely removes the link so it would not be available even to keyboard navigation.
diable keyboard navigation to lang fr tooCode:body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"] { display: none; }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13648
- Thank you received: 2491
With boostraptpartner wrote: ...
I need to learn more about keyboard navigation.
sr-only : keyboard access
hidden : no keyboard access
hidden-md : no keyboard access on Desktops (≥992px) (<1200px)
display : none => no keyboard access
visibility : hidden => no keyboard access
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
- ymca
- Topic Author
- Offline
- Elite Member
- Posts: 168
- Thank you received: 2
tpartner wrote: If you need it to be survey-specific, edit layout_global.twig to add a survey ID attribute to the <body> tag.
Code:<body style="padding-top: 90px;" class=" {{ aSurveyInfo.class.body }} font-{{ aSurveyInfo.options.font }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {% if( aSurveyInfo.options.brandlogo == "on") %}brand-logo{%endif%}" {{ aSurveyInfo.attr.body }} data-sid="{{ aSurveyInfo.sid }}">
Then you can target the language link(s) by survey ID and language.
Either hide it with CSS - something like this in your custom.css file:
Code:body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"] { display: none; }
Or remove it with JavaScript - something like this in your custom.js file:
Code:$(document).on('ready pjax:scriptcomplete',function(){ $('body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"]').closest('li').remove(); });
I have been able to hide the Portuguese language from the main site (top right) language chooser, but now I see that the Portuguese language is visible in the left (inner) chooser.
Does this code suppose to hide also the language from the inner language chooser?
LS Version 4.2+