From bfd9756647a6d1e15b7f5c85e4a5fd69f46009fe Mon Sep 17 00:00:00 2001 From: James Rose Date: Sat, 24 Nov 2012 02:45:39 +0000 Subject: [PATCH] App->Sip_status, added initial support for translations. --- app/sip_status/app_languages.php | 32 ++++++++++++++++++++++++++++++++ app/sip_status/sip_status.php | 17 +++++++++++------ 2 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 app/sip_status/app_languages.php diff --git a/app/sip_status/app_languages.php b/app/sip_status/app_languages.php new file mode 100644 index 0000000000..40a3e0c10c --- /dev/null +++ b/app/sip_status/app_languages.php @@ -0,0 +1,32 @@ + + 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['error-event-socket']['en-us'] = 'Connection to Event Socket failed.'; + $text['label-message']['en-us'] = 'Message'; + $text['title-sofia-status']['en-us'] = 'sofia status'; + $text['title-sofia-status-profile']['en-us'] = 'sofia status profile'; + $text['title-status']['en-us'] = 'status'; +?> \ No newline at end of file diff --git a/app/sip_status/sip_status.php b/app/sip_status/sip_status.php index b2f8f1f6d4..a2d073b824 100644 --- a/app/sip_status/sip_status.php +++ b/app/sip_status/sip_status.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -36,7 +37,11 @@ else { echo "access denied"; exit; } - +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } //define variables $c = 0; $row_style["0"] = "row_style0"; @@ -71,13 +76,13 @@ require_once "includes/header.php"; $msg = $_GET["savemsg"]; $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if (!$fp) { - $msg = "
Connection to Event Socket failed.
"; + $msg = "
".$text['error-event-socket']."
"; } if (strlen($msg) > 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -100,7 +105,7 @@ if (strlen($msg) > 0) { echo "
Message".$text['label-message']."
$msg
\n"; echo "\n"; echo "\n"; echo "
\n"; - echo " sofia status \n"; + echo " ".$text['title-sofia-status']." \n"; echo "\n"; echo " \n"; @@ -174,7 +179,7 @@ if (strlen($msg) > 0) { echo "\n"; echo "\n"; echo "\n"; echo "
\n"; - echo " sofia status profile $sip_profile_name \n"; + echo " ".$text['title-sofia-status-profile']." $sip_profile_name \n"; echo "\n"; echo " \n"; @@ -246,7 +251,7 @@ if (strlen($msg) > 0) { if ($fp && permission_exists('sip_status_switch_status')) { $cmd = "api status"; $response = event_socket_request($fp, $cmd); - echo "status
\n"; + echo "".$text['title-status']."
\n"; echo "
";
 		echo trim($response);
 		echo "
\n";