From 9ec7d19d36f29d60da30cdd7de1a1ba58552cc96 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Tue, 14 Mar 2017 06:31:30 +0000 Subject: [PATCH] First steps to internationalization - not finally all files modified! --- ajax.php | 26 +- include/disk.php | 14 +- include/lh_ajax.php | 22 +- include/localtx_ajax.php | 30 +-- include/modes.php | 2 +- include/repeaterinfo.php | 36 +-- include/sysinfo_ajax.php | 2 +- include/tools.php | 4 +- include/txinfo.php | 20 +- include/ysfgatewayinfo.php | 18 +- index.php | 40 ++-- locale/de_DE/LC_MESSAGES/messages.mo | Bin 0 -> 3811 bytes locale/de_DE/LC_MESSAGES/messages.po | 343 +++++++++++++++++++++++++++ locale/de_DE/settings.php | 6 + locale/en_GB/LC_MESSAGES/messages.mo | Bin 0 -> 490 bytes locale/en_GB/LC_MESSAGES/messages.po | 78 ++++++ locale/en_GB/settings.php | 6 + messages.pot | 343 +++++++++++++++++++++++++++ setup.php | 4 + version.php | 2 +- 20 files changed, 899 insertions(+), 97 deletions(-) create mode 100644 locale/de_DE/LC_MESSAGES/messages.mo create mode 100644 locale/de_DE/LC_MESSAGES/messages.po create mode 100644 locale/de_DE/settings.php create mode 100644 locale/en_GB/LC_MESSAGES/messages.mo create mode 100644 locale/en_GB/LC_MESSAGES/messages.po create mode 100644 locale/en_GB/settings.php create mode 100644 messages.pot diff --git a/ajax.php b/ajax.php index 2710513..4e330d4 100644 --- a/ajax.php +++ b/ajax.php @@ -3,6 +3,16 @@ header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); include "config/config.php"; + +include "locale/".LOCALE."/settings.php"; +$codeset = "UTF8"; +putenv('LANG='.LANG_LOCALE.'.'.$codeset); +putenv('LANGUAGE='.LANG_LOCALE.'.'.$codeset); +bind_textdomain_codeset('messages', $codeset); +bindtextdomain('messages', dirname(__FILE__).'/locale/'); +setlocale(LC_ALL, LANG_LOCALE.'.'.$codeset); +textdomain('messages'); + include "include/tools.php"; include "include/functions.php"; @@ -201,30 +211,30 @@ if ($_GET['section'] == "sysinfo") { - Power + - CPU-Temperature + - CPU-Frequency + - System-Load - CPU-Usage - Uptime - Idle + + + + - + -
Disk Use
+
- - - - - - + + + + + + diff --git a/include/lh_ajax.php b/include/lh_ajax.php index 7150b88..1f10a66 100644 --- a/include/lh_ajax.php +++ b/include/lh_ajax.php @@ -3,29 +3,29 @@ $totalLH = count($lastHeard); ?>
-
Last Heard List of today's callsigns.
+
File SystemMount PointUseFreeUsedTotal
- - - + + + - + - - - - - - + + + + + +
Time ()ModeCallsign () Name DSTAR-IDTargetSourceDur (s)LossBER
diff --git a/include/localtx_ajax.php b/include/localtx_ajax.php index 9f67a93..aa2f618 100644 --- a/include/localtx_ajax.php +++ b/include/localtx_ajax.php @@ -3,34 +3,34 @@ $totalLH = count($lastHeard); ?>
-
Today's local transmissions
+
- - - + + + - + - - - - - - + + + + + + RSSI (min)"; - else if (constant("RSSI") == "max") echo ""; - else if (constant("RSSI") == "avg") echo ""; - else echo ""; + if (constant("RSSI") == "min") echo ""; + else if (constant("RSSI") == "max") echo ""; + else if (constant("RSSI") == "avg") echo ""; + else echo ""; ?> diff --git a/include/modes.php b/include/modes.php index 2d27430..323cc04 100644 --- a/include/modes.php +++ b/include/modes.php @@ -1,6 +1,6 @@
-
Enabled Modes
+
diff --git a/include/repeaterinfo.php b/include/repeaterinfo.php index c22f999..061db46 100644 --- a/include/repeaterinfo.php +++ b/include/repeaterinfo.php @@ -1,27 +1,27 @@
-
Repeater Info
+
Time ()ModeCallsign () Name DSTAR-IDTargetSourceDur (s)LossBER RSSI (max)RSSI (avg)RSSI (avg)"._("RSSI (min)").""._("RSSI (max)").""._("RSSI (avg)").""._("RSSI (avg)")."
- + - + - + - - + + @@ -45,24 +45,24 @@
Current Mode D-Star linked to YSF linked to DMR TS1 last linked toDMR TS2 last linked to - - - + + + - + - + - - - + + + -
System Info
+
diff --git a/include/tools.php b/include/tools.php index 7d723f8..ed6eff8 100644 --- a/include/tools.php +++ b/include/tools.php @@ -70,13 +70,13 @@ function checkSetup() { error_reporting(E_ERROR | E_WARNING | E_PARSE); if (defined(DISTRIBUTION)) { ?> - + - + -
Currently TXing
+
LocationTX-Freq.RX-Freq. YSFGateway DMR CC DMR-MasterTS1TS2 enabled'; + echo 'label-success">'._("enabled"); } else { - echo 'label-default">disabled'; + echo 'label-default">'._("disabled"); } ?> enabled'; + echo 'label-success">'._("enabled"); } else { - echo 'label-default">disabled'; + echo 'label-default">'._("disabled"); } ?>
- - - + + + - + - + - - - - + + + + diff --git a/include/ysfgatewayinfo.php b/include/ysfgatewayinfo.php index 68d5372..a16d151 100644 --- a/include/ysfgatewayinfo.php +++ b/include/ysfgatewayinfo.php @@ -2,7 +2,7 @@ ?>
-
YSFGateway-Infos
+
Time ()ModeCallsign () Name Talker Alias DSTAR-IDTargetSourceTX-Time
@@ -10,10 +10,10 @@ ">">YSFGateway Process is down!"> @@ -22,7 +22,7 @@
-
YSFReflectors reported active
+
@@ -34,11 +34,11 @@ ?>
- - - - - + + + + + diff --git a/index.php b/index.php index 6d08fb8..73c931f 100644 --- a/index.php +++ b/index.php @@ -9,6 +9,16 @@ header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // do not touch this includes!!! Never ever!!! include "config/config.php"; + +include "locale/".LOCALE."/settings.php"; +$codeset = "UTF8"; +putenv('LANG='.LANG_LOCALE.'.'.$codeset); +putenv('LANGUAGE='.LANG_LOCALE.'.'.$codeset); +bind_textdomain_codeset('messages', $codeset); +bindtextdomain('messages', dirname(__FILE__).'/locale/'); +setlocale(LC_ALL, LANG_LOCALE.'.'.$codeset); +textdomain('messages'); + include "include/tools.php"; startStopwatch(); showLapTime("Start of page"); @@ -45,17 +55,19 @@ include "version.php";
">YSFGateway Process is running
No.NameDescriptionIDConnections