From 84a1d8a05a22244dd0e94586a0eeb84b0935b263 Mon Sep 17 00:00:00 2001 From: James Rose Date: Sat, 24 Nov 2012 03:05:51 +0000 Subject: [PATCH] App->Settings, added initial support for translations. --- app/settings/app_languages.php | 50 ++++++++++++++++++++++++++++++++++ app/settings/settings_edit.php | 45 +++++++++++++++++------------- 2 files changed, 76 insertions(+), 19 deletions(-) create mode 100644 app/settings/app_languages.php diff --git a/app/settings/app_languages.php b/app/settings/app_languages.php new file mode 100644 index 0000000000..002d7bcf1b --- /dev/null +++ b/app/settings/app_languages.php @@ -0,0 +1,50 @@ + + 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['title-settings']['en-us'] = 'Setting Update'; + $text['label-event-socket-ip']['en-us'] = 'Event Socket IP Address:'; + $text['description-event-socket-ip']['en-us'] = 'Enter the event socket IP address. default: 127.0.0.1'; + $text['label-event-socket-port']['en-us'] = 'Event Socket Port:'; + $text['description-event-socket-port']['en-us'] = 'Enter the event socket port. default: 8021'; + + $text['label-event-socket-pw']['en-us'] = 'Event Socket Password:'; + $text['description-event-socket-pw']['en-us'] = 'Enter the event socket password.'; + + $text['label-xml-rpc-port']['en-us'] = 'XML RPC HTTP Port:'; + $text['description-xml-rpc-port']['en-us'] = 'Enter the XML RPC HTTP Port. default: 8787'; + $text['label-xml-rpc-realm']['en-us'] = 'XML RPC Auth Realm:'; + $text['description-xml-rpc-realm']['en-us'] = 'Enter the XML RPC Auth Realm. default: freeswitch'; + $text['label-xml-rpc-user']['en-us'] = 'XML RPC Auth User:'; + $text['description-xml-rpc-user']['en-us'] = 'Enter the XML RPC Auth User. default: xmlrpc'; + $text['label-xml-rpc-pw']['en-us'] = 'XML RPC Auth Password:'; + $text['description-xml-rpc-pw']['en-us'] = 'Enter the XML RPC Auth Password.'; + + $text['label-shout-decoder']['en-us'] = 'Mod Shout Decoder:'; + $text['description-shout-decoder']['en-us'] = 'Ender the Decoder. default: i386'; + $text['label-shout-volume']['en-us'] = 'Mod Shout Volume:'; + $text['description-shout-volume']['en-us'] 'Enter Mod Shout Volume.'; + +?> \ No newline at end of file diff --git a/app/settings/settings_edit.php b/app/settings/settings_edit.php index ef80adf6e4..61c8414c48 100644 --- a/app/settings/settings_edit.php +++ b/app/settings/settings_edit.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -34,6 +35,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //get the number of rows in v_extensions $sql = " select count(*) as num_rows from v_settings "; $prep_statement = $db->prepare(check_sql($sql)); @@ -230,85 +237,85 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "Setting Add\n"; } if ($action == "update") { - echo "Setting Update\n"; + echo "".$text['title-settings']."\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Event Socket IP Address:\n"; + echo " ".$text['label-event-socket-ip']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the event socket IP address. default: 127.0.0.1\n"; + echo $text['description-event-socket-ip']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Event Socket Port:\n"; + echo " ".$text['label-event-socket-port']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the event socket port. default: 8021\n"; + echo $text['description-event-socket-port']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Event Socket Password:\n"; + echo " ".$text['label-event-socket-pw']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the event socket password. \n"; + echo $text['description-event-socket-pw']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " XML RPC HTTP Port:\n"; + echo " ".$text['label-xml-rpc-port']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the XML RPC HTTP Port. default: 8787\n"; + echo $text['description-xml-rpc-port']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " XML RPC Auth Realm:\n"; + echo " ".$text['label-xml-rpc-realm']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the XML RPC Auth Realm. default: freeswitch\n"; + echo $text['description-xml-rpc-realm']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " XML RPC Auth User:\n"; + echo " ".$text['label-xml-rpc-user']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the XML RPC Auth User. default: xmlrpc\n"; + echo $text['description-xml-rpc-user']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " XML RPC Auth Password:\n"; + echo " ".$text['label-xml-rpc-pw']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the XML RPC Auth Password. \n"; + echo $text['description-xml-rpc-pw']." \n"; echo "\n"; echo "\n"; @@ -427,23 +434,23 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo " Mod Shout Decoder:\n"; + echo " ".$text['label-shout-decoder']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the Decoder. default: i386\n"; + echo $text['description-shout-decoder']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Mod Shout Volume:\n"; + echo " ".$text['label-shout-volume']."\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter Mod Shout Volume.\n"; + echo $text['description-shout-volume']."\n"; echo "\n"; echo "\n"; if (permission_exists('settings_edit')) {