From ac94e22a1d496ce1f9731edf5233c94a94333e13 Mon Sep 17 00:00:00 2001 From: fusionate Date: Thu, 22 Aug 2024 17:20:36 -0600 Subject: [PATCH] Fax Server: Pull in language file for email template replacements. --- app/fax/app_languages.php | 53 ++++++++++++++++++++++++++++++++++++++- secure/fax_to_email.php | 16 +++++++----- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/app/fax/app_languages.php b/app/fax/app_languages.php index f2f1de8994..1c03b0a929 100644 --- a/app/fax/app_languages.php +++ b/app/fax/app_languages.php @@ -5174,7 +5174,6 @@ $text['label-email_fax_file']['zh-cn'] = "传真文件"; $text['label-email_fax_file']['ja-jp'] = "ファックスファイル"; $text['label-email_fax_file']['ko-kr'] = "팩스 파일"; - $text['description-email_fax_file']['en-us'] = "Select a fax file option."; $text['description-email_fax_file']['en-gb'] = "Select a fax file option."; $text['description-email_fax_file']['ar-eg'] = "حدد خيار ملف الفاكس."; @@ -5201,4 +5200,56 @@ $text['description-email_fax_file']['zh-cn'] = "选择传真文件选项。"; $text['description-email_fax_file']['ja-jp'] = "FAX ファイル オプションを選択します。"; $text['description-email_fax_file']['ko-kr'] = "팩스 파일 옵션을 선택하세요."; +$text['label-fax_attached']['en-us'] = "Fax Attached"; +$text['label-fax_attached']['en-gb'] = "Fax Attached"; +$text['label-fax_attached']['ar-eg'] = "الفاكس المرفق"; +$text['label-fax_attached']['de-at'] = "Fax angehängt"; +$text['label-fax_attached']['de-ch'] = "Fax angehängt"; +$text['label-fax_attached']['de-de'] = "Fax angehängt"; +$text['label-fax_attached']['el-gr'] = "Fax angehängt"; +$text['label-fax_attached']['es-cl'] = "Fax adjunto"; +$text['label-fax_attached']['es-mx'] = "Fax adjunto"; +$text['label-fax_attached']['fr-ca'] = "Fax ci-joint"; +$text['label-fax_attached']['fr-fr'] = "Fax ci-joint"; +$text['label-fax_attached']['he-il'] = "מצורף פקס"; +$text['label-fax_attached']['it-it'] = "Fax allegato"; +$text['label-fax_attached']['nl-nl'] = "Fax bijgevoegd"; +$text['label-fax_attached']['pl-pl'] = "Faks dołączony"; +$text['label-fax_attached']['pt-br'] = "Fax anexado"; +$text['label-fax_attached']['pt-pt'] = "Fax anexado"; +$text['label-fax_attached']['ro-ro'] = "Fax atasat"; +$text['label-fax_attached']['ru-ru'] = "Факс прилагается"; +$text['label-fax_attached']['sv-se'] = "Fax bifogat"; +$text['label-fax_attached']['uk-ua'] = "Факс додається"; +$text['label-fax_attached']['tr-tr'] = "Faks Ekli"; +$text['label-fax_attached']['zh-cn'] = "附有传真"; +$text['label-fax_attached']['ja-jp'] = "FAX添付"; +$text['label-fax_attached']['ko-kr'] = "팩스 첨부"; + +$text['label-fax_download']['en-us'] = "Download Fax"; +$text['label-fax_download']['en-gb'] = "Download Fax"; +$text['label-fax_download']['ar-eg'] = "تنزيل الفاكس"; +$text['label-fax_download']['de-at'] = "Fax herunterladen"; +$text['label-fax_download']['de-ch'] = "Fax herunterladen"; +$text['label-fax_download']['de-de'] = "Fax herunterladen"; +$text['label-fax_download']['el-gr'] = "Λήψη φαξ"; +$text['label-fax_download']['es-cl'] = "Descargar Fax"; +$text['label-fax_download']['es-mx'] = "Descargar Fax"; +$text['label-fax_download']['fr-ca'] = "Télécharger le fax"; +$text['label-fax_download']['fr-fr'] = "Télécharger le fax"; +$text['label-fax_download']['he-il'] = "הורד פקס"; +$text['label-fax_download']['it-it'] = "Scarica Fax"; +$text['label-fax_download']['nl-nl'] = "Fax downloaden"; +$text['label-fax_download']['pl-pl'] = "Pobierz faks"; +$text['label-fax_download']['pt-br'] = "Baixar Fax"; +$text['label-fax_download']['pt-pt'] = "Baixar fax"; +$text['label-fax_download']['ro-ro'] = "Descărcați Fax"; +$text['label-fax_download']['ru-ru'] = "Скачать факс"; +$text['label-fax_download']['sv-se'] = "Ladda ner fax"; +$text['label-fax_download']['uk-ua'] = "Завантажити факс"; +$text['label-fax_download']['tr-tr'] = "Faks İndir"; +$text['label-fax_download']['zh-cn'] = "下载传真"; +$text['label-fax_download']['ja-jp'] = "ファックスをダウンロード"; +$text['label-fax_download']['ko-kr'] = "팩스 다운로드"; + ?> \ No newline at end of file diff --git a/secure/fax_to_email.php b/secure/fax_to_email.php index 185459126b..3825711ee1 100644 --- a/secure/fax_to_email.php +++ b/secure/fax_to_email.php @@ -334,6 +334,13 @@ if (!function_exists('fax_split_dtmf')) { //now that we have the domain_name and uuid, create a settings object for the domain $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]); +//get the language code + $language_code = $settings->get('domain', 'language', 'en-us'); + +//add multi-lingual support + $language = new text; + $text = $language->get($language_code, 'app/fax'); + //prepare smtp server settings $email_from_address = $settings->get('fax','smtp_from', $settings->get('email', 'smtp_from', '')); $email_from_name = $settings->get('fax', 'smtp_from_name', $settings->get('email', 'smtp_from_name', $email_from_address)); @@ -441,9 +448,6 @@ if (!function_exists('fax_split_dtmf')) { //send the email if (!empty($fax_email) && file_exists($fax_file)) { - //get the language code - $language_code = $settings->get('domain', 'language', 'en-us'); - //get the template subcategory if (!empty($fax_relay) && $fax_relay == 'true') { $template_subcategory = 'relay'; @@ -489,10 +493,10 @@ if (!function_exists('fax_split_dtmf')) { $email_body = str_replace('${fax_file_warning}', $fax_file_warning, $email_body); $email_body = str_replace('${fax_subject_tag}', $fax_email_inbound_subject_tag, $email_body); if ($fax_email_file == 'link') { - $email_body = str_replace('${fax_file_message}', "".($text['label-fax_download'] ?? 'Download Fax')."", $email_body); + $email_body = str_replace('${fax_file_message}', "".$text['label-fax_download']."", $email_body); } else { - $email_body = str_replace('${fax_file_message}', ($text['label-fax_attached'] ?? 'Fax Attached'), $email_body); + $email_body = str_replace('${fax_file_message}', $text['label-fax_attached'], $email_body); } //debug info @@ -585,4 +589,4 @@ function shutdown() { } } -?> +?> \ No newline at end of file