Check out the LimeSurvey source code on GitHub!

Limit the Language Options

More
5 years 3 months ago #68269 by mavituna
Hi;

Is there a way to limit the available languages two languages?
In the pull down menu there is plenty of language choices, but I want only the Turkish and English to be visible.

Please Log in to join the conversation.

More
5 years 3 months ago #68276 by nico_8it
You can delete the sholders of the languages in the files of installation

Please Log in to join the conversation.

More
5 years 3 months ago #68277 by Mazi
I think this list is hardcoded at the source code somewhere, so without editing a source file this isn't possible.

Maybe some CSS would do the trick?


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'"

Please Log in to join the conversation.

More
5 years 3 months ago - 5 years 3 months ago #68283 by DenisChenu

Mazi wrote: Maybe some CSS would do the trick?

I think of js ( jquery )

Some
$("#languagechanger option[value='/index.php?lang=sq']").remove();
:ohmy: There a lot of langage to do ;).

But maybe the best is : Feature request .

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
Last Edit: 5 years 3 months ago by DenisChenu. Reason: Feature request link

Please Log in to join the conversation.

More
5 years 3 months ago - 5 years 3 months ago #68284 by c_schmitz
Version 2.0 has this feature. Don't you guys read the change log? :P

Best regards

Carsten Schmitz
LimeSurvey project leader
Last Edit: 5 years 3 months ago by c_schmitz.

Please Log in to join the conversation.

More
5 years 3 months ago #68285 by mavituna
We are using 1.9*

As I investigated, it requires recode somewhere.
but where?
this is my question.

Please Log in to join the conversation.

More
5 years 3 months ago #68296 by tpartner

There a lot of langage to do

Yeah, it may be easier to:
- clone the options you want to keep
- remove all options
- insert the cloned options

To only show English and Turkish, add the following to the end of admin/scripts/admin_core.js:
$(document).ready(function(){
 
	// Create survey 
	if($('#language').length > 0) {
		var optEn = $('#language option[value="en"]').clone();
		var optTr = $('#language option[value="tr"]').clone();
		$('#language option').remove();
		$(optEn).appendTo('#language');
		$(optTr).appendTo('#language');
	}
 
	// Edit survey
	if($('#available_languages').length > 0) {
		var optEn = $('#available_languages option[value="en"]').clone();
		var optTr = $('#available_languages option[value="tr"]').clone();
		$('#available_languages option').remove();
		$(optEn).appendTo('#available_languages');
		$(optTr).appendTo('#available_languages');
	}
});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 3 months ago #68308 by Mazi

c_schmitz wrote: Version 2.0 has this feature. Don't you guys read the change log? :P

Where can I read more about this new feature at the docs :P ?


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'"

Please Log in to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #70901 by dynosure
Hi,

I just did it by deleting the hard code in {limesurvey_folder}/classes/core/surveytranlator.php

For more detailed steps, you can check out my first review of LimeSurvey

I also fixed the bug that it will always show English as the first language at dropdown when you choose another language. And there is a duplicated English option down there which is really annoying for me.

Best,
Dezhi
Last Edit: 5 years 2 months ago by dynosure.
The following user(s) said Thank You: SoFi

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form