/** * Translate notifications. * * @param array $notification * @param array $form * * @return array */ function gform_notification($notification, $form) { if ($form['notifications'][$notification['id']]['toType'] === 'email' || $form['notifications'][$notification['id']]['toType'] === 'field') { $snh = new GFML_String_Name_Helper(); $snh->notification = $notification; $st_context = $this->get_st_context($form['id']); $notification['subject'] = icl_t($st_context, $snh->get_form_notification_subject(), $notification['subject']); $notification['message'] = icl_t($st_context, $snh->get_form_notification_message(), $notification['message']); } return $notification; }
protected function register_form_notifications($form_package, $form) { if (isset($form['notifications']) && $form['notifications']) { $snh = new GFML_String_Name_Helper(); foreach ($form['notifications'] as $notification) { $snh->notification = $notification; $string_title = 'Notification: ' . $notification['name'] . ' - subject'; $this->register_gf_string($notification['subject'], $snh->get_form_notification_subject(), $form_package, $string_title); $string_title = 'Notification: ' . $notification['name'] . ' - message'; $this->register_gf_string($notification['message'], $snh->get_form_notification_message(), $form_package, $string_title, 'AREA'); } } }