mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 05:25:58 +08:00
better localization for exporters
This commit is contained in:
parent
a16a6415dd
commit
fd8df90ad0
@ -79,17 +79,13 @@ bool AstroBox::test(wxString &msg) const
|
||||
return res;
|
||||
}
|
||||
|
||||
wxString AstroBox::get_test_ok_msg () const
|
||||
{
|
||||
return _(L("Connection to AstroBox works correctly."));
|
||||
}
|
||||
|
||||
wxString AstroBox::get_test_failed_msg (wxString &msg) const
|
||||
{
|
||||
return GUI::from_u8((boost::format("%s: %s\n\n%s")
|
||||
% _utf8(L("Could not connect to AstroBox"))
|
||||
% (boost::format(_u8L("Could not connect to %s")) % get_name())
|
||||
% std::string(msg.ToUTF8())
|
||||
% _utf8(L("Note: AstroBox version at least 1.1.0 is required."))).str());
|
||||
% _u8L("Note: AstroBox version at least 1.1.0 is required.")
|
||||
).str());
|
||||
}
|
||||
|
||||
bool AstroBox::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const
|
||||
|
@ -21,7 +21,6 @@ public:
|
||||
const char* get_name() const override;
|
||||
|
||||
bool test(wxString &curl_msg) const override;
|
||||
wxString get_test_ok_msg () const override;
|
||||
wxString get_test_failed_msg (wxString &msg) const override;
|
||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||
bool has_auto_discovery() const override { return true; }
|
||||
|
@ -42,18 +42,6 @@ bool Duet::test(wxString &msg) const
|
||||
return connectionType != ConnectionType::error;
|
||||
}
|
||||
|
||||
wxString Duet::get_test_ok_msg () const
|
||||
{
|
||||
return _(L("Connection to Duet works correctly."));
|
||||
}
|
||||
|
||||
wxString Duet::get_test_failed_msg (wxString &msg) const
|
||||
{
|
||||
return GUI::from_u8((boost::format("%s: %s")
|
||||
% _utf8(L("Could not connect to Duet"))
|
||||
% std::string(msg.ToUTF8())).str());
|
||||
}
|
||||
|
||||
bool Duet::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const
|
||||
{
|
||||
wxString connect_msg;
|
||||
|
@ -20,8 +20,6 @@ public:
|
||||
const char* get_name() const override;
|
||||
|
||||
bool test(wxString &curl_msg) const override;
|
||||
wxString get_test_ok_msg() const override;
|
||||
wxString get_test_failed_msg(wxString &msg) const override;
|
||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||
bool has_auto_discovery() const override { return false; }
|
||||
bool can_test() const override { return true; }
|
||||
|
@ -63,17 +63,12 @@ bool FlashAir::test(wxString &msg) const
|
||||
return res;
|
||||
}
|
||||
|
||||
wxString FlashAir::get_test_ok_msg () const
|
||||
{
|
||||
return _(L("Connection to FlashAir works correctly and upload is enabled."));
|
||||
}
|
||||
|
||||
wxString FlashAir::get_test_failed_msg (wxString &msg) const
|
||||
{
|
||||
return GUI::from_u8((boost::format("%s: %s\n%s")
|
||||
% _utf8(L("Could not connect to FlashAir"))
|
||||
% (boost::format(_u8L("Could not connect to %s")) % get_name())
|
||||
% std::string(msg.ToUTF8())
|
||||
% _utf8(L("Note: FlashAir with firmware 2.00.02 or newer and activated upload function is required."))).str());
|
||||
% _u8L("Note: FlashAir with firmware 2.00.02 or newer and activated upload function is required.")).str());
|
||||
}
|
||||
|
||||
bool FlashAir::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const
|
||||
|
@ -21,7 +21,6 @@ public:
|
||||
const char* get_name() const override;
|
||||
|
||||
bool test(wxString &curl_msg) const override;
|
||||
wxString get_test_ok_msg() const override;
|
||||
wxString get_test_failed_msg(wxString &msg) const override;
|
||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||
bool has_auto_discovery() const override { return false; }
|
||||
|
@ -78,14 +78,13 @@ bool OctoPrint::test(wxString &msg) const
|
||||
return res;
|
||||
}
|
||||
|
||||
wxString OctoPrint::get_test_ok_msg () const
|
||||
{
|
||||
return wxString::Format(_(L("Connection to %s works correctly.")), get_name());
|
||||
}
|
||||
|
||||
wxString OctoPrint::get_test_failed_msg (wxString &msg) const
|
||||
{
|
||||
return wxString::Format("%s: %s\n\n%s", wxString::Format(_(L("Could not connect to %s")), get_name()), msg, _(L("Note: OctoPrint version at least 1.1.0 is required.")));
|
||||
return GUI::from_u8((boost::format("%s: %s\n\n%s")
|
||||
% (boost::format(_u8L("Could not connect to %s")) % get_name())
|
||||
% std::string(msg.ToUTF8())
|
||||
% _u8L("Note: OctoPrint version at least 1.1.0 is required.")
|
||||
).str());
|
||||
}
|
||||
|
||||
bool OctoPrint::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const
|
||||
|
@ -24,7 +24,6 @@ public:
|
||||
const char* get_name() const;
|
||||
|
||||
bool test(wxString &curl_msg) const override;
|
||||
wxString get_test_ok_msg () const override;
|
||||
wxString get_test_failed_msg (wxString &msg) const override;
|
||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||
bool has_auto_discovery() const override { return true; }
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "Repetier.hpp"
|
||||
#include "Klipper.hpp"
|
||||
#include "../GUI/PrintHostDialogs.hpp"
|
||||
#include "slic3r/GUI/I18N.hpp"
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
using boost::optional;
|
||||
@ -30,6 +31,19 @@ namespace Slic3r {
|
||||
|
||||
PrintHost::~PrintHost() {}
|
||||
|
||||
|
||||
wxString PrintHost::get_test_ok_msg() const
|
||||
{
|
||||
return wxString::Format(_L("Connection to %s works correctly."), get_name());
|
||||
}
|
||||
|
||||
wxString PrintHost::get_test_failed_msg(wxString& msg) const
|
||||
{
|
||||
return GUI::from_u8((boost::format("%s: %s")
|
||||
% (boost::format(_u8L("Could not connect to %s")) % get_name())
|
||||
% std::string(msg.ToUTF8())).str());
|
||||
}
|
||||
|
||||
PrintHost* PrintHost::get_print_host(DynamicPrintConfig *config)
|
||||
{
|
||||
PrinterTechnology tech = ptFFF;
|
||||
|
@ -39,8 +39,8 @@ public:
|
||||
virtual const char* get_name() const = 0;
|
||||
|
||||
virtual bool test(wxString &curl_msg) const = 0;
|
||||
virtual wxString get_test_ok_msg () const = 0;
|
||||
virtual wxString get_test_failed_msg (wxString &msg) const = 0;
|
||||
virtual wxString get_test_ok_msg () const;
|
||||
virtual wxString get_test_failed_msg (wxString &msg) const;
|
||||
virtual bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const = 0;
|
||||
virtual bool has_auto_discovery() const = 0;
|
||||
virtual bool can_test() const = 0;
|
||||
|
@ -66,7 +66,7 @@ bool Repetier::test(wxString &msg) const
|
||||
const auto text = ptree.get_optional<std::string>("name");
|
||||
res = validate_version_text(text);
|
||||
if (! res) {
|
||||
msg = GUI::from_u8((boost::format(_utf8(L("Mismatched type of print host: %s"))) % (text ? *text : "Repetier")).str());
|
||||
msg = GUI::from_u8((boost::format(_u8L("Mismatched type of print host: %s")) % (text ? *text : "Repetier")).str());
|
||||
}
|
||||
}
|
||||
catch (const std::exception &) {
|
||||
@ -79,17 +79,12 @@ bool Repetier::test(wxString &msg) const
|
||||
return res;
|
||||
}
|
||||
|
||||
wxString Repetier::get_test_ok_msg () const
|
||||
{
|
||||
return _(L("Connection to Repetier works correctly."));
|
||||
}
|
||||
|
||||
wxString Repetier::get_test_failed_msg (wxString &msg) const
|
||||
{
|
||||
return GUI::from_u8((boost::format("%s: %s\n\n%s")
|
||||
% _utf8(L("Could not connect to Repetier"))
|
||||
% (boost::format(_u8L("Could not connect to %s")) % get_name())
|
||||
% std::string(msg.ToUTF8())
|
||||
% _utf8(L("Note: Repetier version at least 0.90.0 is required."))).str());
|
||||
% _u8L("Note: Repetier version at least 0.90.0 is required.")).str());
|
||||
}
|
||||
|
||||
bool Repetier::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const
|
||||
|
@ -22,7 +22,6 @@ public:
|
||||
const char* get_name() const;
|
||||
|
||||
bool test(wxString &curl_msg) const override;
|
||||
wxString get_test_ok_msg () const override;
|
||||
wxString get_test_failed_msg (wxString &msg) const override;
|
||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||
bool has_auto_discovery() const override { return false; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user