From 83251502e97eb1d990d07cf758aa9818d6197f74 Mon Sep 17 00:00:00 2001
From: Jan Dittberner <jan@dittberner.info>
Date: Mon, 26 Nov 2007 09:56:48 +0000
Subject: [PATCH] fixes #8  * mark all translatable strings with {{{_()}}}

---
 admin/common.inc.php  | 33 +++++++++++++++++++--------------
 admin/directories.php |  2 +-
 admin/getgroups.php   |  4 +---
 3 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/admin/common.inc.php b/admin/common.inc.php
index e9e1305..3b9949e 100644
--- a/admin/common.inc.php
+++ b/admin/common.inc.php
@@ -31,11 +31,10 @@ if (!isset($_SERVER['DavAdminConfDir'])) {
   header('HTTP/1.0 500 Internal Server Error');
   header('Status: 500 Internal Server Error');
   header('Content-Type: text/plain;charset=utf8');
-  print("The Server is not configured correctly. " .
-        "Please tell your Administrator to set the " .
-        "DavAdminConfDir environment variable.");
+  print(_("The Server is not configured correctly. Please tell your Administrator to set the DavAdminConfDir environment variable."));
   exit();
 }
+
 /** Include configuration information. */
 require_once($_SERVER['DavAdminConfDir'] . '/config.inc.php');
 
@@ -52,7 +51,7 @@ $smarty->compile_dir = $davconfig['compile_dir'];
 /** Handle invalid requests to the application. */
 function invalidCall() {
   header("Content-Type: text/plain; charset=UTF-8");
-  print("Ungültiger Aufruf!");
+  print(_("Invalid call!"));
   die();
 }
 
@@ -79,39 +78,45 @@ function getFullPath($dirname) {
 // check configuration
 $errmsgs = array();
 if (!isset($davconfig['digest.file'])) {
-  array_push($errmsgs, 'digest.file is not defined.');
+  array_push($errmsgs,
+             _("digest.file is not defined."));
 } elseif (!is_readable($davconfig['digest.file']) ||
           !is_writable($davconfig['digest.file'])) {
   array_push($errmsgs,
-             'The specified digest file is not readable and writable.');
+             _("The specified digest file is not readable and writable."));
 }
 if (!isset($davconfig['group.file'])) {
-  array_push($errmsgs, 'group.file is not defined.');
+  array_push($errmsgs,
+             _("group.file is not defined."));
 } elseif (!is_readable($davconfig['group.file']) ||
           !is_writable($davconfig['group.file'])) {
   array_push($errmsgs,
-             'The specified group file is not readable and writable.');
+             _("The specified group file is not readable and writable."));
 }
 if (!isset($davconfig['namemap.file'])) {
-  array_push($errmsgs, 'namemap.file is not defined.');
+  array_push($errmsgs,
+             _("namemap.file is not defined."));
 } elseif (!is_readable($davconfig['namemap.file']) ||
           !is_writable($davconfig['namemap.file'])) {
   array_push($errmsgs,
-             'The specified name mapping file is not readable and writable.');
+             _("The specified name mapping file is not readable and writable."));
 }
 if (!isset($davconfig['dav.dir'])) {
-  array_push($errmsgs, 'dav.dir is not defined.');
+  array_push($errmsgs,
+             _("dav.dir is not defined."));
 } elseif (!is_dir($davconfig['dav.dir']) ||
           !is_readable($davconfig['dav.dir']) ||
           !is_writable($davconfig['dav.dir'])) {
   array_push($errmsgs,
-             'The specified DAV directory is no directory or not accessable.');
+             _("The specified DAV directory is no directory or not accessable."));
 }
 if (empty($davconfig['dav.realm'])) {
-  array_push($errmsgs, 'dav.realm is not defined.');
+  array_push($errmsgs,
+             _("dav.realm is not defined."));
 }
 if (empty($davconfig['dav.uri'])) {
-  array_push($errmsgs, 'dav.uri is not defined.');
+  array_push($errmsgs,
+             _("dav.uri is not defined."));
 }
 if (!empty($errmsgs)) {
   errorAsHtml(implode("<br />", $errmsgs));
diff --git a/admin/directories.php b/admin/directories.php
index c4821ef..d143b6a 100644
--- a/admin/directories.php
+++ b/admin/directories.php
@@ -111,7 +111,7 @@ function getDirectoryData($dirname) {
   $dir['groups'] = getDirGroupsFromHtaccess($dirname);
   list($dir['filecount'], $dir['filesize']) = countFilesRecursive(getFullPath($dirname));
   $dir['maydelete'] = ($dir['filecount'] == 0) ? 1 : 0;
-  $dir['filesize'] = sprintf("%d kBytes", $dir['filesize'] / 1024);
+  $dir['filesize'] = sprintf(_("%d kBytes"), $dir['filesize'] / 1024);
   return $dir;
 } 
 
diff --git a/admin/getgroups.php b/admin/getgroups.php
index 18c776b..1690d12 100644
--- a/admin/getgroups.php
+++ b/admin/getgroups.php
@@ -31,9 +31,7 @@ if (!isset($_SERVER['DavAdminConfDir'])) {
   header('HTTP/1.0 500 Internal Server Error');
   header('Status: 500 Internal Server Error');
   header('Content-Type: text/plain;charset=utf8');
-  print("The Server is not configured correctly. " .
-        "Please tell your Administrator to set the " .
-        "DavAdminConfDir environment variable.");
+  print(_("The Server is not configured correctly. Please tell your Administrator to set the DavAdminConfDir environment variable."));
   exit();
 }
 /** Include configuration information. */