From 909cc1fb946df581846451ecee9aff9d298c6f8c Mon Sep 17 00:00:00 2001 From: James Rose Date: Sat, 24 Nov 2012 22:51:28 +0000 Subject: [PATCH] click to call, added preliminary support for translations. --- app/click_to_call/app_languages.php | 56 ++++++++++++++++++++++ app/click_to_call/click_to_call.php | 72 ++++++++++++++++------------- 2 files changed, 95 insertions(+), 33 deletions(-) create mode 100644 app/click_to_call/app_languages.php diff --git a/app/click_to_call/app_languages.php b/app/click_to_call/app_languages.php new file mode 100644 index 0000000000..90856c17dd --- /dev/null +++ b/app/click_to_call/app_languages.php @@ -0,0 +1,56 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane + James Rose +*/ + + + $text['label-click2call']['en-us'] = 'Click to Call'; + $text['desc-click2call']['en-us'] = 'Provide the following information to make a call from the source number to the destination number.'; + $text['label-src-caller-id-nam']['en-us'] = 'Source Caller ID Name'; + $text['desc-src-caller-id-nam']['en-us'] = 'Enter the Caller ID name to send to your phone.'; + $text['label-src-caller-id-num']['en-us'] = 'Source Caller ID Number'; + $text['desc-src-caller-id-num']['en-us'] = 'Enter the Caller ID number to send to your phone (you probably want this to be the same as the destination number).'; + $text['label-dest-caller-id-nam']['en-us'] = 'Destination Caller ID Name'; + $text['desc-dest-caller-id-nam']['en-us'] = 'Enter the Caller ID name to send to the destination number.'; + $text['label-dest-caller-id-num']['en-us'] = 'Destination Caller ID Number'; + $text['desc-dest-caller-id-num']['en-us'] = 'Enter the Caller ID number to send to the destination number (you probably want this to be your phone number).'; + $text['label-src-num']['en-us'] = 'Source Number'; + $text['desc-src-num']['en-us'] = 'Enter your phone number. This can be an extension on the system, or another number (eg: mobile phone).'; + $text['label-dest-num']['en-us'] = 'Destination Number'; + $text['desc-dest-num']['en-us'] = "Enter the number to call. This can be an extension on the system, another number, or a sip uri. Sip URI's are of the form 5551234567@voip.example.com:5080 (5080 for freeswitch, or 5060 for other systems)."; + $text['label-record']['en-us'] = 'Record'; + $text['label-true']['en-us'] = 'true'; + $text['label-false']['en-us'] = 'false'; + $text['desc-record']['en-us'] = 'Select whether to record the call.'; + $text['label-ringback']['en-us'] = 'Ring Back'; + $text['desc-ringback']['en-us'] = 'Defines what the you will hear while destination is being called. The choices are music (music on hold) ring (ring tone.)'; + $text['opt-usring']['en-us'] = 'us-ring'; + $text['opt-frring']['en-us'] = 'fr-ring'; + $text['opt-ukring']['en-us'] = 'uk-ring'; + $text['opt-rsring']['en-us'] = 'rs-ring'; + $text['opt-moh']['en-us'] = 'music'; + $text['button-call']['en-us'] = 'Call'; + +?> \ No newline at end of file diff --git a/app/click_to_call/click_to_call.php b/app/click_to_call/click_to_call.php index c4715ed99e..99bea9c0d5 100644 --- a/app/click_to_call/click_to_call.php +++ b/app/click_to_call/click_to_call.php @@ -43,6 +43,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + require_once "includes/header.php"; if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest'])) { @@ -211,7 +217,7 @@ if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest']) echo " \n"; echo " \n"; echo " \n"; - echo " Click to Call\n"; + echo " ".$text['label-click2call']."\n"; echo " \n"; echo " \n"; echo " \n"; @@ -221,7 +227,7 @@ if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest']) echo " \n"; echo " \n"; echo " \n"; - echo " Provide the following information to make a call from the source number to the destination number.\n"; + echo " ".$text['desc-click2call']."\n"; echo " \n"; echo " \n"; echo "\n"; @@ -233,130 +239,130 @@ if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest']) echo "
\n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "
Source Caller ID Name:".$text['label-src-caller-id-nam'].":\n"; echo " \n"; echo "
\n"; - echo " Enter the Caller ID name to send to your phone.\n"; + echo " ".$text['desc-src-caller-id-nam']."\n"; echo "
Source Caller ID Number:".$text['label-src-caller-id-num'].":\n"; echo " \n"; echo "
\n"; - echo " Enter the Caller ID number to send to your phone (you probably want this to be the same as the destination number).\n"; + echo " ".$text['desc-src-caller-id-num']."\n"; echo "
Destination Caller ID Name:".$text['label-dest-caller-id-nam'].":\n"; echo " \n"; echo "
\n"; - echo " Enter the Caller ID name to send to the destination number.\n"; + echo " ".$text['desc-dest-caller-id-nam']."\n"; echo "
Destination Caller ID Number:".$text['label-dest-caller-id-num'].":\n"; echo " \n"; echo "
\n"; - echo " Enter the Caller ID number to send to the destination number (you probably want this to be your phone number).\n"; + echo " ".$text['desc-dest-caller-id-num']."\n"; echo "
Source Number:".$text['label-src-num'].":\n"; echo " \n"; echo "
\n"; - echo " Enter your phone number. This can be an extension on the system, or another number (eg: mobile phone).\n"; + echo " ".$text['desc-src-num']."\n"; echo "
Destination Number:".$text['label-dest-num'].":\n"; echo " \n"; echo "
\n"; - echo " Enter the number to call. This can be an extension on the system, another number, or a sip uri. Sip URI's are of the form 5551234567@voip.example.com:5080 (5080 for freeswitch, or 5060 for other systems).\n"; + echo " ".$text['desc-dest-num']."\n"; echo "
\n"; - echo " Record:\n"; + echo " ".$text['label-record'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Select whether to record the call.\n"; + echo $text['desc-record']."\n"; echo "
\n"; - echo " Ring Back:\n"; + echo " ".$text['label-ringback'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Defines what the you will hear while destination is being called. The choices are music (music on hold) ring (ring tone.)\n"; + echo $text['desc-ringback']."\n"; echo "
\n"; - echo " \n"; + echo " \n"; echo "
\n";