Change Language names into Country names for WHMCS

I posted an action hook to do this in the thread below (create new .php file in /hooks/includes, paste code into it, save)...

Method 1:

<?php

/**
* Change Bangla Language Localised Name
* @author Azad!
*/

function locales_hook($vars) {
	$mylocal = $vars['locales'];
	foreach ($mylocal as $key => $value) {
		if ($value["language"] == "bangla") {
			$mylocal[$key]["localisedName"] = "বাংলা";
		}
	}
	$activelocale = $vars['activeLocale'];
		if ($activelocale["language"] == "bangla") {
			$activelocale["localisedName"] = "বাংলা";
		}
   
	return array("locales" => $mylocal, "activeLocale" => $activelocale);
}
add_hook("ClientAreaPage", 1, "locales_hook");
?>

Method 2:

<?php

/**
* Change Bangla Language Localised Name
* @author Azad!
*/

function locales_hook($vars) {
	$mylocal = $vars['locales'];
	foreach ($mylocal as $key => $value) {
		if ($value["language"] == "english") {
			$mylocal[$key]["localisedName"] = "USA";
		}
		if ($value["language"] == "bangla") {
			$mylocal[$key]["localisedName"] = "বাংলা";
		}		
	}
	$activelocale = $vars['activeLocale'];
		if ($activelocale["language"] == "english") {
			$activelocale["localisedName"] = "USA";
		}
		if ($activelocale["language"] == "bangla") {
			$activelocale["localisedName"] = "বাংলা";
		}
	return array("locales" => $mylocal, "activeLocale" => $activelocale);
}
add_hook("ClientAreaPage", 1, "locales_hook");
?>
  • 56 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

 How to use extended HTML tags in WHMCS products description.

When you compile and edit the description of a product in WHMCS, you can use simple HTML tags,...