$tsLocale = CRM_Core_I18n::getLocale();
$config = CRM_Core_Config::singleton();
$json = $jsonDecode = NULL;
- $domain = new CRM_Core_DAO_Domain();
- $domain->find(TRUE);
+ $multilingual = CRM_Core_I18n::isMultilingual();
$moduleDataFormat = [
'soft_credit' => [
if ($setDefault) {
$jsonDecode = json_decode($params);
$jsonDecode = (array) $jsonDecode->$module;
- if (!$domain->locales && !empty($jsonDecode['default'])) {
+ if (!$multilingual && !empty($jsonDecode['default'])) {
//monolingual state
$jsonDecode += (array) $jsonDecode['default'];
unset($jsonDecode['default']);
}
//check and handle multilingual honoree params
- if (!$domain->locales) {
+ if (!$multilingual) {
//if in singlelingual state simply return the array format
$json = [$module => NULL];
foreach ($moduleDataFormat[$module] as $key => $attribute) {
$json = [$module => NULL];
foreach ($moduleDataFormat[$module] as $key => $attribute) {
if ($key === 'multilingual') {
- $json[$module][$config->lcMessages] = [];
+ $json[$module][$tsLocale] = [];
foreach ($attribute as $attr) {
- $json[$module][$config->lcMessages][$attr] = $params[$attr];
+ $json[$module][$tsLocale][$attr] = $params[$attr];
}
}
else {