mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
I18N
- Localized more files.
This commit is contained in:
parent
3b2e93f1a0
commit
a9a4c1c692
4 changed files with 45 additions and 22 deletions
|
@ -25,6 +25,10 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define L10N // Localization complete.
|
||||
|
||||
#include <text.h>
|
||||
#include <i18n.h>
|
||||
#include <TransportRSYNC.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -37,12 +41,12 @@ TransportRSYNC::TransportRSYNC(const Uri& uri) : Transport(uri)
|
|||
void TransportRSYNC::send(const std::string& source)
|
||||
{
|
||||
if (uri.host == "")
|
||||
throw std::string ("when using the 'rsync' protocol, the uri must contain a hostname.");
|
||||
throw std::string (STRING_TRANSPORT_RSYNC_URI);
|
||||
|
||||
// Is there more than one file to transfer?
|
||||
// Then path has to end with a '/'
|
||||
if (is_filelist(source) && !uri.is_directory())
|
||||
throw std::string ("The uri '") + uri.path + "' does not appear to be a directory.";
|
||||
throw format (STRING_TRANSPORT_URI_NODIR, uri.path);
|
||||
|
||||
// cmd line is: rsync [--port=PORT] source [user@]host::path
|
||||
if (uri.port != "")
|
||||
|
@ -62,19 +66,19 @@ void TransportRSYNC::send(const std::string& source)
|
|||
}
|
||||
|
||||
if (execute())
|
||||
throw std::string ("Could not run rsync. Is it installed, and available in $PATH?");
|
||||
throw std::string (STRING_TRANSPORT_RSYNC_NORUN);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TransportRSYNC::recv(std::string target)
|
||||
{
|
||||
if (uri.host == "")
|
||||
throw std::string ("when using the 'rsync' protocol, the uri must contain a hostname.");
|
||||
throw std::string (STRING_TRANSPORT_RSYNC_URI);
|
||||
|
||||
// Is there more than one file to transfer?
|
||||
// Then target has to end with a '/'
|
||||
if (is_filelist(uri.path) && !is_directory(target))
|
||||
throw std::string ("The uri '") + target + "' does not appear to be a directory.";
|
||||
throw format (STRING_TRANSPORT_URI_NODIR, target);
|
||||
|
||||
// cmd line is: rsync [--port=PORT] [user@]host::path target
|
||||
if (uri.port != "")
|
||||
|
@ -92,7 +96,7 @@ void TransportRSYNC::recv(std::string target)
|
|||
arguments.push_back (target);
|
||||
|
||||
if (execute())
|
||||
throw std::string ("Could not run rsync. Is it installed, and available in $PATH?");
|
||||
throw std::string (STRING_TRANSPORT_RSYNC_NORUN);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue