Jump to content
Sign in to follow this  
jeebee123

Disable certain languages

Recommended Posts

Hi,

Is it possible to disable cartain languages in WHMCS? I just wan't to show a few language options to my clients. Where can I select which languages they can choose?

Share this post


Link to post
Share on other sites
4 minutes ago, jeebee123 said:

Nevermind... just delete the language files. Logic haha

that would work for now (and used to be the way to do this), but next time you run a WHMCS update, you will find that WHMCS will restore all those language files that you've just deleted - so if you're going down this road, you're going to have to remember to delete them again after every update.

alternatively, there was a hook I posted almost 4 years ago that allowed you to specify the languages to include in the header dropdown and won't necessarily be affected by a WHMCS update.

<?php

# Specify Valid Languages for Language Chooser Hook
# Written by brian! 

function locales_hook($vars) {
	$mylocal = $vars['locales'];
	$validlanguages = array("english","french","dutch");
	foreach ($mylocal as $key => $value) {
		if (!in_array($value["language"],$validlanguages)) {
			unset($mylocal[$key]);
		}
	}
	return array("locales" => $mylocal);
}
add_hook("ClientAreaPage", 1, "locales_hook");

O22AcX3.png

a user could still change their language via the URL, but there would be other solutions if you needed to ensure that they couldn't do that - though frankly, they'd only know how if they knew WHMCS.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated