diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-04-16 22:19:39 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-04-21 22:07:15 +0200 |
| commit | b87e2660d0776f3d1380532ff0d2f3a28ed9d764 (patch) | |
| tree | ebddcef5b9a22b4e4e7475e20abf484f8aabd671 /src/tools | |
| parent | 748b182f27eedb006cb8493e12a389fa1c5883e7 (diff) | |
Extract all uses of DCP-o-matic name to allow branding.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 104 | ||||
| -rw-r--r-- | src/tools/dcpomatic_batch.cc | 11 | ||||
| -rw-r--r-- | src/tools/dcpomatic_cli.cc | 5 | ||||
| -rw-r--r-- | src/tools/dcpomatic_combiner.cc | 10 | ||||
| -rw-r--r-- | src/tools/dcpomatic_disk.cc | 22 | ||||
| -rw-r--r-- | src/tools/dcpomatic_editor.cc | 12 | ||||
| -rw-r--r-- | src/tools/dcpomatic_kdm.cc | 20 | ||||
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 32 | ||||
| -rw-r--r-- | src/tools/dcpomatic_playlist.cc | 9 | ||||
| -rw-r--r-- | src/tools/dcpomatic_server.cc | 5 | ||||
| -rw-r--r-- | src/tools/dcpomatic_server_cli.cc | 21 | ||||
| -rw-r--r-- | src/tools/dcpomatic_verifier.cc | 7 |
12 files changed, 161 insertions, 97 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index d516c6f5b..5f723ba0f 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -57,6 +57,7 @@ #include "wx/video_waveform_dialog.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/analytics.h" #include "lib/audio_content.h" #include "lib/check_content_job.h" @@ -94,6 +95,7 @@ #include "lib/text_content.h" #include "lib/transcode_job.h" #include "lib/update_checker.h" +#include "lib/variant.h" #include "lib/version.h" #include "lib/video_content.h" #include <dcp/exceptions.h> @@ -490,8 +492,10 @@ public: auto const dir = e.file().parent_path(); if (dcp::filesystem::exists(dir / "ASSETMAP") || dcp::filesystem::exists(dir / "ASSETMAP.xml")) { error_dialog ( - this, _("Could not open this folder as a DCP-o-matic project."), - _("It looks like you are trying to open a DCP. File -> Open is for loading DCP-o-matic projects, not DCPs. To import a DCP, create a new project with File -> New and then click the \"Add DCP...\" button.") + this, variant::wx::insert_dcpomatic(_("Could not open this folder as a %s project.")), + variant::wx::insert_dcpomatic( + _("It looks like you are trying to open a DCP. File -> Open is for loading %s projects, not DCPs. " + "To import a DCP, create a new project with File -> New and then click the \"Add DCP...\" button.")) ); } else { auto const p = std_to_wx(file.string ()); @@ -575,7 +579,7 @@ private: if (!found_bad_chars.empty()) { message += wxString::Format (_("Try removing the %s characters from your folder name."), std_to_wx(found_bad_chars).data()); } else { - message += _("Please check that you do not have Windows controlled folder access enabled for DCP-o-matic."); + message += variant::wx::insert_dcpomatic(_("Please check that you do not have Windows controlled folder access enabled for %s.")); } error_dialog (this, message, std_to_wx(e.what())); #else @@ -1143,10 +1147,15 @@ private: body += i.first + "\n" + i.second + "\n\n"; } if (dialog.email().find("@") == string::npos) { - error_dialog (this, _("You must enter a valid email address when sending translations, " - "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions.")); + error_dialog( + this, + variant::wx::insert_dcpomatic( + _("You must enter a valid email address when sending translations, " + "otherwise the %s maintainers cannot credit you or contact you with questions.") + ) + ); } else { - Email email(dialog.email(), { "carl@dcpomatic.com" }, "DCP-o-matic translations", body); + Email email(dialog.email(), { "carl@dcpomatic.com" }, variant::insert_dcpomatic("%1 translations"), body); try { email.send("main.carlh.net", 2525, EmailProtocol::STARTTLS); } catch (NetworkError& e) { @@ -1403,7 +1412,7 @@ private: add_item (jobs_menu, _("Make &KDMs...\tCtrl-K"), ID_jobs_make_kdms, NEEDS_FILM); /* [Shortcut] Ctrl+D:Make DKDMs */ add_item (jobs_menu, _("Make &DKDMs...\tCtrl-D"), ID_jobs_make_dkdms, NEEDS_FILM); - add_item (jobs_menu, _("Make DKDM for DCP-o-matic..."), ID_jobs_make_self_dkdm, NEEDS_FILM | NEEDS_ENCRYPTION); + add_item(jobs_menu, variant::wx::insert_dcpomatic(_("Make DKDM for %s...")), ID_jobs_make_self_dkdm, NEEDS_FILM | NEEDS_ENCRYPTION); jobs_menu->AppendSeparator (); /* [Shortcut] Ctrl+E:Export video file */ add_item (jobs_menu, _("Export video file...\tCtrl-E"), ID_jobs_export_video_file, NEEDS_FILM); @@ -1441,7 +1450,7 @@ private: wxMenu* help = new wxMenu; #ifdef __WXOSX__ - add_item (help, _("About DCP-o-matic"), wxID_ABOUT, ALWAYS); + add_item(help, variant::wx::insert_dcpomatic(_("About %s")), wxID_ABOUT, ALWAYS); #else add_item (help, _("About"), wxID_ABOUT, ALWAYS); #endif @@ -1559,9 +1568,9 @@ private: UpdateDialog dialog(this, uc->stable(), uc->test()); dialog.ShowModal(); } else if (uc->state() == UpdateChecker::State::FAILED) { - error_dialog (this, _("The DCP-o-matic download server could not be contacted.")); + error_dialog(this, variant::wx::insert_dcpomatic(_("The %s download server could not be contacted."))); } else { - error_dialog (this, _("There are no new versions of DCP-o-matic available.")); + error_dialog(this, variant::wx::insert_dcpomatic(_("There are no new versions of %s available."))); } _update_news_requested = false; @@ -1599,7 +1608,7 @@ private: void set_title () { - auto s = wx_to_std(_("DCP-o-matic")); + auto s = variant::dcpomatic(); if (_film) { if (_film->directory()) { s += " - " + _film->directory()->string(); @@ -1643,7 +1652,7 @@ static const wxCmdLineEntryDesc command_line_description[] = { { wxCMD_LINE_SWITCH, "n", "new", "create new film", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_OPTION, "c", "content", "add content file / directory", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_OPTION, "d", "dcp", "add content DCP", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_SWITCH, "v", "version", "show DCP-o-matic version", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, + { wxCMD_LINE_SWITCH, "v", "version", "show version", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_OPTION, "", "config", "directory containing config.xml and cinemas.xml", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_PARAM, 0, 0, "film to load or create", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 } @@ -1687,7 +1696,7 @@ private: setvbuf(hf_in, NULL, _IONBF, 128); *stdin = *hf_in; - cout << "DCP-o-matic is starting." << "\n"; + cout << variant::insert_dcpomatic("%1 is starting.") << "\n"; } #endif wxInitAllImageHandlers (); @@ -1697,7 +1706,7 @@ private: _splash = maybe_show_splash (); - SetAppName (_("DCP-o-matic")); + SetAppName(variant::wx::dcpomatic()); if (!wxApp::OnInit()) { return false; @@ -1736,7 +1745,7 @@ private: */ Config::Bad.connect (boost::bind(&App::config_bad, this, _1)); - _frame = new DOMFrame (_("DCP-o-matic")); + _frame = new DOMFrame(variant::wx::dcpomatic()); SetTopWindow (_frame); _frame->Maximize (); close_splash (); @@ -1744,7 +1753,14 @@ private: if (running_32_on_64 ()) { NagDialog::maybe_nag ( _frame, Config::NAG_32_ON_64, - _("You are running the 32-bit version of DCP-o-matic on a 64-bit version of Windows. This will limit the memory available to DCP-o-matic and may cause errors. You are strongly advised to install the 64-bit version of DCP-o-matic."), + wxString::Format( + _("You are running the 32-bit version of %s on a 64-bit version of Windows. " + "This will limit the memory available to %s and may cause errors. You are " + "strongly advised to install the 64-bit version of %s."), + variant::wx::dcpomatic(), + variant::wx::dcpomatic(), + variant::wx::dcpomatic() + ), false); } @@ -1796,7 +1812,7 @@ private: catch (exception& e) { close_splash(); - error_dialog (nullptr, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what())); + error_dialog(nullptr, variant::wx::insert_dcpomatic(_("%s could not start.")), std_to_wx(e.what())); } return true; @@ -1939,9 +1955,11 @@ private: } RecreateChainDialog dialog( _frame, _("Recreate signing certificates"), - _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error\n" - "which will prevent DCPs from being validated correctly on some systems. Do you want to re-create\n" - "the certificate chain for signing DCPs and KDMs?"), + variant::wx::insert_dcpomatic( + _("The certificate chain that %s uses for signing DCPs and KDMs contains a small error\n" + "which will prevent DCPs from being validated correctly on some systems. Do you want to re-create\n" + "the certificate chain for signing DCPs and KDMs?") + ), _("Do nothing"), Config::NAG_BAD_SIGNER_CHAIN_UTF8 ); @@ -1954,9 +1972,11 @@ private: } RecreateChainDialog dialog( _frame, _("Recreate signing certificates"), - _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs has a validity period\n" - "that is too long. This will cause problems playing back DCPs on some systems.\n" - "Do you want to re-create the certificate chain for signing DCPs and KDMs?"), + variant::wx::insert_dcpomatic( + _("The certificate chain that %s uses for signing DCPs and KDMs has a validity period\n" + "that is too long. This will cause problems playing back DCPs on some systems.\n" + "Do you want to re-create the certificate chain for signing DCPs and KDMs?") + ), _("Do nothing"), Config::NAG_BAD_SIGNER_CHAIN_VALIDITY ); @@ -1966,10 +1986,14 @@ private: { RecreateChainDialog dialog( _frame, _("Recreate signing certificates"), - _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs is inconsistent and\n" - "cannot be used. DCP-o-matic cannot start unless you re-create it. Do you want to re-create\n" - "the certificate chain for signing DCPs and KDMs?"), - _("Close DCP-o-matic") + wxString::Format( + _("The certificate chain that %s uses for signing DCPs and KDMs is inconsistent and\n" + "cannot be used. %s cannot start unless you re-create it. Do you want to re-create\n" + "the certificate chain for signing DCPs and KDMs?"), + variant::wx::dcpomatic(), + variant::wx::dcpomatic() + ), + variant::wx::insert_dcpomatic(_("Close %s")) ); if (dialog.ShowModal() != wxID_OK) { exit (EXIT_FAILURE); @@ -1980,11 +2004,15 @@ private: { RecreateChainDialog dialog( _frame, _("Recreate KDM decryption chain"), - _("The certificate chain that DCP-o-matic uses for decrypting KDMs is inconsistent and\n" - "cannot be used. DCP-o-matic cannot start unless you re-create it. Do you want to re-create\n" - "the certificate chain for decrypting KDMs? You may want to say \"No\" here and back up your\n" - "configuration before continuing."), - _("Close DCP-o-matic") + wxString::Format( + _("The certificate chain that %s uses for decrypting KDMs is inconsistent and\n" + "cannot be used. %s cannot start unless you re-create it. Do you want to re-create\n" + "the certificate chain for decrypting KDMs? You may want to say \"No\" here and back up your\n" + "configuration before continuing."), + variant::wx::dcpomatic(), + variant::wx::dcpomatic() + ), + variant::wx::insert_dcpomatic(_("Close %s")) ); if (dialog.ShowModal() != wxID_OK) { exit (EXIT_FAILURE); @@ -1995,10 +2023,14 @@ private: { RecreateChainDialog dialog( _frame, _("Recreate signing certificates"), - _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error\n" - "which will prevent DCPs from being validated correctly on some systems. This error was caused\n" - "by a bug in DCP-o-matic which has now been fixed. Do you want to re-create the certificate chain\n" - "for signing DCPs and KDMs?"), + wxString::Format( + _("The certificate chain that %s uses for signing DCPs and KDMs contains a small error\n" + "which will prevent DCPs from being validated correctly on some systems. This error was caused\n" + "by a bug in %s which has now been fixed. Do you want to re-create the certificate chain\n" + "for signing DCPs and KDMs?"), + variant::wx::dcpomatic(), + variant::wx::dcpomatic() + ), _("Do nothing"), Config::NAG_BAD_SIGNER_DN_QUALIFIER ); diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index 1e383b39a..0a228b933 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -28,6 +28,7 @@ #include "wx/wx_ptr.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/compose.hpp" #include "lib/config.h" #include "lib/dcpomatic_socket.h" @@ -436,7 +437,7 @@ class App : public wxApp { wxInitAllImageHandlers (); - SetAppName (_("DCP-o-matic Batch Converter")); + SetAppName(variant::wx::dcpomatic_batch_converter()); is_batch_converter = true; Config::FailedToLoad.connect(boost::bind(&App::config_failed_to_load, this, _1)); @@ -472,7 +473,7 @@ class App : public wxApp */ Config::drop (); - _frame = new DOMFrame (_("DCP-o-matic Batch Converter")); + _frame = new DOMFrame(variant::wx::dcpomatic_batch_converter()); SetTopWindow (_frame); _frame->Maximize (); if (splash) { @@ -485,7 +486,11 @@ class App : public wxApp server->StartJob.connect(bind(&DOMFrame::start_job, _frame, _1)); new thread (boost::bind (&JobServer::run, server)); } catch (boost::system::system_error& e) { - error_dialog(_frame, _("Could not listen for new batch jobs. Perhaps another instance of the DCP-o-matic Batch Converter is running.")); + error_dialog( + _frame, + variant::wx::insert_dcpomatic_batch_converter( + _("Could not listen for new batch jobs. Perhaps another instance of the %s is running.") + )); } signal_manager = new wxSignalManager (this); diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index c2e7ee76c..c087f89e7 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -40,6 +40,7 @@ #include "lib/signal_manager.h" #include "lib/transcode_job.h" #include "lib/util.h" +#include "lib/variant.h" #include "lib/version.h" #include "lib/video_content.h" #include <dcp/filesystem.h> @@ -66,7 +67,7 @@ static void help (string n) { cerr << "Syntax: " << n << " [OPTION] [<FILM>]\n" - << " -v, --version show DCP-o-matic version\n" + << variant::insert_dcpomatic(" -v, --version show %1 version\n") << " -h, --help show this help\n" << " -f, --flags show flags passed to C++ compiler on build\n" << " -n, --no-progress do not print progress to stdout\n" @@ -75,7 +76,7 @@ help (string n) << " -j, --json <port> run a JSON server on the specified port\n" << " -k, --keep-going keep running even when the job is complete\n" << " -s, --servers <file> specify servers to use in a text file\n" - << " -l, --list-servers just display a list of encoding servers that DCP-o-matic is configured to use; don't encode\n" + << variant::insert_dcpomatic(" -l, --list-servers just display a list of encoding servers that %1 is configured to use; don't encode\n") << " -d, --dcp-path echo DCP's path to stdout on successful completion (implies -n)\n" << " -c, --config <dir> directory containing config.xml and cinemas.xml\n" << " --dump just dump a summary of the film's settings; don't encode\n" diff --git a/src/tools/dcpomatic_combiner.cc b/src/tools/dcpomatic_combiner.cc index c135184e6..6588b23b4 100644 --- a/src/tools/dcpomatic_combiner.cc +++ b/src/tools/dcpomatic_combiner.cc @@ -23,6 +23,8 @@ #include "wx/dir_picker_ctrl.h" #include "wx/editable_list.h" #include "wx/wx_signal_manager.h" +#include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/combine_dcp_job.h" #include "lib/config.h" #include "lib/constants.h" @@ -175,7 +177,7 @@ private: auto jm = JobManager::instance (); jm->add (make_shared<CombineDCPJob>(_inputs, output, wx_to_std(_annotation_text->GetValue()))); - bool const ok = display_progress(_("DCP-o-matic Combiner"), _("Combining DCPs")); + bool const ok = display_progress(variant::wx::dcpomatic_combiner(), _("Combining DCPs")); if (!ok) { return; } @@ -219,7 +221,7 @@ public: Config::FailedToLoad.connect(boost::bind(&App::config_failed_to_load, this, _1)); Config::Warning.connect (boost::bind (&App::config_warning, this, _1)); - SetAppName (_("DCP-o-matic Combiner")); + SetAppName(variant::wx::dcpomatic_combiner()); if (!wxApp::OnInit()) { return false; @@ -253,7 +255,7 @@ public: */ Config::drop (); - _frame = new DOMFrame(_("DCP-o-matic Combiner")); + _frame = new DOMFrame(variant::wx::dcpomatic_combiner()); SetTopWindow (_frame); _frame->Show (); @@ -263,7 +265,7 @@ public: } catch (exception& e) { - error_dialog(nullptr, wxString::Format("DCP-o-matic Combiner could not start."), std_to_wx(e.what())); + error_dialog(nullptr, wxString::Format(_("%s could not start (%s)"), variant::wx::dcpomatic_combiner()), std_to_wx(e.what())); return false; } diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc index 0cc7ccbcd..cd07f935d 100644 --- a/src/tools/dcpomatic_disk.cc +++ b/src/tools/dcpomatic_disk.cc @@ -29,6 +29,7 @@ #include "wx/wx_util.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/config.h" #include "lib/constants.h" #include "lib/copy_to_drive_job.h" @@ -325,7 +326,7 @@ private: #if defined(DCPOMATIC_WINDOWS) auto m = make_wx<MessageDialog>( this, - _("DCP-o-matic Disk Writer"), + variant::wx::dcpomatic_disk_writer(), _("Do you see a 'User Account Control' dialogue asking about dcpomatic2_disk_writer.exe? If so, click 'Yes', then try again.") ); m->ShowModal (); @@ -333,8 +334,8 @@ private: #elif defined(DCPOMATIC_OSX) auto m = make_wx<MessageDialog>( this, - _("DCP-o-matic Disk Writer"), - _("Did you install the DCP-o-matic Disk Writer.pkg from the .dmg? Please check and try again.") + variant::wx::dcpomatic_disk_writer(), + variant::wx::insert_dcpomatic(_("Did you install the %s Disk Writer.pkg from the .dmg? Please check and try again.")) ); m->ShowModal (); return; @@ -366,7 +367,7 @@ private: if (!reply || reply->type() != DiskWriterBackEndResponse::Type::OK) { auto m = make_wx<MessageDialog>( this, - _("DCP-o-matic Disk Writer"), + variant::wx::dcpomatic_disk_writer(), wxString::Format( _("The drive %s could not be unmounted.\nClose any application that is using it, then try again. (%s)"), std_to_wx(drive.description()), @@ -454,7 +455,7 @@ public: Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this)); Config::Warning.connect (boost::bind (&App::config_warning, this, _1)); - SetAppName (_("DCP-o-matic Disk Writer")); + SetAppName(variant::wx::dcpomatic_disk_writer()); if (!wxApp::OnInit()) { return false; @@ -495,12 +496,17 @@ public: return false; } if (!warning->confirmed()) { - message_dialog(nullptr, _("You did not correctly confirm that you read the warning that was just shown. DCP-o-matic Disk Writer will close now. Please try again.")); + message_dialog( + nullptr, + variant::wx::insert_dcpomatic_disk_writer( + _("You did not correctly confirm that you read the warning that was just shown. %s will close now. Please try again.") + ) + ); return false; } } - _frame = new DOMFrame (_("DCP-o-matic Disk Writer")); + _frame = new DOMFrame(variant::wx::dcpomatic_disk_writer()); SetTopWindow (_frame); _frame->Show (); @@ -514,7 +520,7 @@ public: } catch (exception& e) { - error_dialog (0, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what())); + error_dialog(nullptr, wxString::Format(_("%s could not start"), variant::wx::dcpomatic_disk_writer()), std_to_wx(e.what())); return false; } diff --git a/src/tools/dcpomatic_editor.cc b/src/tools/dcpomatic_editor.cc index 14ff6da7f..e1f541fe8 100644 --- a/src/tools/dcpomatic_editor.cc +++ b/src/tools/dcpomatic_editor.cc @@ -24,10 +24,12 @@ #include "wx/id.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/constants.h" #include "lib/cross.h" #include "lib/dcpomatic_log.h" #include "lib/null_log.h" +#include "lib/variant.h" #include <dcp/cpl.h> #include <dcp/dcp.h> #include <dcp/reel.h> @@ -290,14 +292,14 @@ class DOMFrame : public wxFrame { public: DOMFrame () - : wxFrame(nullptr, -1, _("DCP-o-matic Editor")) + : wxFrame(nullptr, -1, variant::wx::dcpomatic_editor()) , _main_sizer(new wxBoxSizer(wxVERTICAL)) { dcpomatic_log = make_shared<NullLog>(); #if defined(DCPOMATIC_WINDOWS) maybe_open_console(); - std::cout << "DCP-o-matic Editor is starting." << "\n"; + std::cout << variant::dcpomatic_editor() << " is starting." << "\n"; #endif auto bar = new wxMenuBar; @@ -360,7 +362,7 @@ private: auto help = new wxMenu; #ifdef __WXOSX__ - help->Append (wxID_ABOUT, _("About DCP-o-matic")); + help->Append(wxID_ABOUT, variant::wx::insert_dcpomatic_editor(_("About %s"))); #else help->Append (wxID_ABOUT, _("About")); #endif @@ -444,7 +446,7 @@ private: splash = maybe_show_splash (); - SetAppName (_("DCP-o-matic Editor")); + SetAppName(variant::wx::dcpomatic_editor()); if (!wxApp::OnInit()) { return false; @@ -495,7 +497,7 @@ private: if (splash) { splash->Destroy (); } - error_dialog (0, _("DCP-o-matic Editor could not start."), std_to_wx(e.what())); + error_dialog(nullptr, variant::wx::insert_dcpomatic_editor(_("%s could not start.")), std_to_wx(e.what())); } return true; diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index 9adef0ab0..d6c8b3945 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -37,6 +37,7 @@ #include "wx/static_text.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/cinema.h" #include "lib/collator.h" #include "lib/compose.hpp" @@ -52,6 +53,7 @@ #include "lib/kdm_with_metadata.h" #include "lib/screen.h" #include "lib/send_kdm_email_job.h" +#include "lib/variant.h" #include <dcp/encrypted_kdm.h> #include <dcp/decrypted_kdm.h> #include <dcp/exceptions.h> @@ -125,7 +127,7 @@ public: setvbuf(hf_in, NULL, _IONBF, 128); *stdin = *hf_in; - std::cout << "DCP-o-matic KDM creator is starting." << "\n"; + std::cout << variant::insert_dcpomatic_kdm_creator("%1 is starting.\n"); } #endif @@ -302,7 +304,7 @@ private: wxMenu* help = new wxMenu; #ifdef __WXOSX__ - help->Append (wxID_ABOUT, _("About DCP-o-matic")); + help->Append(wxID_ABOUT, variant::wx::insert_dcpomatic_kdm_creator(_("About %s"))); #else help->Append (wxID_ABOUT, _("About")); #endif @@ -460,7 +462,13 @@ private: if (e.starts_too_early()) { error_dialog(this, _("The KDM start period is before (or close to) the start of the signing certificate's validity period. Use a later start time for this KDM.")); } else { - error_dialog(this, _("The KDM end period is after (or close to) the end of the signing certificates' validity period. Either use an earlier end time for this KDM or re-create your signing certificates in the DCP-o-matic preferences window.")); + error_dialog( + this, + variant::wx::insert_dcpomatic_kdm_creator( + _("The KDM end period is after (or close to) the end of the signing certificates' validity period. " + "Either use an earlier end time for this KDM or re-create your signing certificates in the %s preferences window.") + ) + ); } return; } catch (dcp::NotEncryptedError& e) { @@ -841,7 +849,7 @@ private: splash = maybe_show_splash (); - SetAppName (_("DCP-o-matic KDM Creator")); + SetAppName(variant::wx::dcpomatic_kdm_creator()); if (!wxApp::OnInit()) { return false; @@ -875,7 +883,7 @@ private: */ Config::drop (); - _frame = new DOMFrame (_("DCP-o-matic KDM Creator")); + _frame = new DOMFrame(variant::wx::dcpomatic_kdm_creator()); SetTopWindow (_frame); _frame->Maximize (); if (splash) { @@ -892,7 +900,7 @@ private: if (splash) { splash->Destroy (); } - error_dialog (0, _("DCP-o-matic could not start"), std_to_wx(e.what())); + error_dialog(nullptr, variant::wx::insert_dcpomatic_kdm_creator(_("%s could not start")), std_to_wx(e.what())); } return true; diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 1ed604a1b..dec07d4a8 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -37,6 +37,7 @@ #include "wx/wx_ptr.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/compose.hpp" #include "lib/config.h" #include "lib/constants.h" @@ -64,6 +65,7 @@ #include "lib/server.h" #include "lib/text_content.h" #include "lib/update_checker.h" +#include "lib/variant.h" #include "lib/verify_dcp_job.h" #include "lib/video_content.h" #include <dcp/cpl.h> @@ -198,7 +200,7 @@ public: DOMFrame () - : wxFrame (nullptr, -1, _("DCP-o-matic Player")) + : wxFrame(nullptr, -1, variant::wx::dcpomatic_player()) , _mode (Config::instance()->player_mode()) /* Use a panel as the only child of the Frame so that we avoid the dark-grey background on Windows. @@ -211,7 +213,7 @@ public: #if defined(DCPOMATIC_WINDOWS) maybe_open_console (); - cout << "DCP-o-matic Player is starting." << "\n"; + cout << variant::dcpomatic_player() << " is starting." << "\n"; #endif auto bar = new wxMenuBar; @@ -398,7 +400,7 @@ public: auto job = make_shared<ExamineContentJob>(_film, dcp); _examine_job_connection = job->Finished.connect(bind(&DOMFrame::add_dcp_to_film, this, weak_ptr<Job>(job), weak_ptr<Content>(dcp))); JobManager::instance()->add (job); - bool const ok = display_progress (_("DCP-o-matic Player"), _("Loading content")); + bool const ok = display_progress(variant::wx::dcpomatic_player(), _("Loading content")); if (!ok || !report_errors_from_last_job(this)) { return; } @@ -410,10 +412,12 @@ public: error_dialog ( this, wxString::Format(_("Could not load a DCP from %s"), std_to_wx(dir.string())), - _( - "This looks like a DCP-o-matic project folder, which cannot be loaded into the player. " - "Choose the DCP folder inside the DCP-o-matic project folder if that's what you want to play." - ) + wxString::Format( + _("This looks like a %s project folder, which cannot be loaded into the player. " + "Choose the DCP folder inside the %s project folder if that's what you want to play."), + variant::wx::dcpomatic(), + variant::wx::dcpomatic() + ) ); } catch (dcp::ReadError& e) { error_dialog (this, wxString::Format(_("Could not load a DCP from %s"), std_to_wx(dir.string())), std_to_wx(e.what())); @@ -609,7 +613,7 @@ private: auto help = new wxMenu; #ifdef __WXOSX__ - help->Append (wxID_ABOUT, _("About DCP-o-matic")); + help->Append(wxID_ABOUT, variant::wx::insert_dcpomatic_player(_("About %s"))); #else help->Append (wxID_ABOUT, _("About")); #endif @@ -682,7 +686,7 @@ private: DCPOMATIC_ASSERT (dcp); dcp->add_ov (wx_to_std(c->GetPath())); JobManager::instance()->add(make_shared<ExamineContentJob>(_film, dcp)); - bool const ok = display_progress (_("DCP-o-matic Player"), _("Loading content")); + bool const ok = display_progress(variant::wx::dcpomatic_player(), _("Loading content")); if (!ok || !report_errors_from_last_job(this)) { return; } @@ -927,7 +931,7 @@ private: DCPOMATIC_ASSERT (dcp); auto job = make_shared<VerifyDCPJob>(dcp->directories(), _kdms); - VerifyDCPProgressDialog progress(this, _("DCP-o-matic Player")); + VerifyDCPProgressDialog progress(this, variant::wx::dcpomatic_player()); bool const completed = progress.run(job); progress.Close(); @@ -991,9 +995,9 @@ private: auto dialog = make_wx<UpdateDialog>(this, uc->stable (), uc->test ()); dialog->ShowModal (); } else if (uc->state() == UpdateChecker::State::FAILED) { - error_dialog (this, _("The DCP-o-matic download server could not be contacted.")); + error_dialog(this, variant::wx::insert_dcpomatic(_("The %s download server could not be contacted."))); } else { - error_dialog (this, _("There are no new versions of DCP-o-matic available.")); + error_dialog(this, variant::wx::insert_dcpomatic(_("There are no new versions of %s available."))); } _update_news_requested = false; @@ -1205,7 +1209,7 @@ private: splash = maybe_show_splash (); - SetAppName (_("DCP-o-matic Player")); + SetAppName(variant::wx::dcpomatic_player()); if (!wxApp::OnInit()) { return false; @@ -1287,7 +1291,7 @@ private: if (splash) { splash->Destroy (); } - error_dialog (0, _("DCP-o-matic Player could not start."), std_to_wx(e.what())); + error_dialog(nullptr, variant::wx::insert_dcpomatic_player(_("%s could not start")), std_to_wx(e.what())); } return true; diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc index b16a2be68..56cf07413 100644 --- a/src/tools/dcpomatic_playlist.cc +++ b/src/tools/dcpomatic_playlist.cc @@ -25,6 +25,7 @@ #include "wx/playlist_editor_config_dialog.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/config.h" #include "lib/constants.h" #include "lib/cross.h" @@ -576,7 +577,7 @@ private: help->Append(wxID_PREFERENCES, _("&Preferences...\tCtrl-,")); } help->Append(wxID_EXIT, _("&Exit")); - help->Append(wxID_ABOUT, _("About DCP-o-matic")); + help->Append(wxID_ABOUT, variant::wx::insert_dcpomatic_playlist_editor(_("About %s"))); m->Append(help, _("&Help")); #else @@ -637,7 +638,7 @@ private: try { wxInitAllImageHandlers (); - SetAppName (_("DCP-o-matic Playlist Editor")); + SetAppName(variant::wx::dcpomatic_playlist_editor()); if (!wxApp::OnInit()) { return false; @@ -671,7 +672,7 @@ private: */ Config::drop (); - _frame = new DOMFrame (_("DCP-o-matic Playlist Editor")); + _frame = new DOMFrame(variant::wx::dcpomatic_playlist_editor()); SetTopWindow (_frame); _frame->Maximize (); _frame->Show (); @@ -683,7 +684,7 @@ private: } catch (exception& e) { - error_dialog (0, _("DCP-o-matic could not start"), std_to_wx(e.what())); + error_dialog(nullptr, variant::wx::insert_dcpomatic_playlist_editor(_("%s could not start %s")), std_to_wx(e.what())); return true; } diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc index 622704d21..5aad282fd 100644 --- a/src/tools/dcpomatic_server.cc +++ b/src/tools/dcpomatic_server.cc @@ -22,6 +22,7 @@ #include "wx/static_text.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/config.h" #ifdef DCPOMATIC_GROK #include "lib/grok/context.h" @@ -154,7 +155,7 @@ class StatusDialog : public wxDialog public: StatusDialog () : wxDialog ( - nullptr, wxID_ANY, _("DCP-o-matic Encode Server"), + nullptr, wxID_ANY, variant::wx::dcpomatic_encode_server(), wxDefaultPosition, wxDefaultSize, #ifdef DCPOMATIC_OSX wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxSTAY_ON_TOP @@ -362,7 +363,7 @@ private: error_dialog (nullptr, std_to_wx(e.what())); wxTheApp->ExitMainLoop (); } catch (...) { - error_dialog (nullptr, _("An unknown error has occurred with the DCP-o-matic server.")); + error_dialog(nullptr, variant::wx::insert_dcpomatic_encode_server(_("An unknown error has occurred with the %s."))); wxTheApp->ExitMainLoop (); } } diff --git a/src/tools/dcpomatic_server_cli.cc b/src/tools/dcpomatic_server_cli.cc index 8997bb92c..25fe59fc7 100644 --- a/src/tools/dcpomatic_server_cli.cc +++ b/src/tools/dcpomatic_server_cli.cc @@ -19,25 +19,26 @@ */ #include "lib/config.h" +#include "lib/config.h" #include "lib/dcp_video.h" +#include "lib/dcpomatic_log.h" +#include "lib/encode_server.h" #include "lib/exceptions.h" -#include "lib/util.h" -#include "lib/config.h" -#include "lib/image.h" #include "lib/file_log.h" #ifdef DCPOMATIC_GROK #include "lib/grok/context.h" #endif +#include "lib/image.h" #include "lib/null_log.h" +#include "lib/util.h" +#include "lib/variant.h" #include "lib/version.h" -#include "lib/encode_server.h" -#include "lib/dcpomatic_log.h" +#include <boost/algorithm/string.hpp> #include <boost/array.hpp> #include <boost/asio.hpp> -#include <boost/algorithm/string.hpp> #include <boost/thread.hpp> -#include <boost/thread/mutex.hpp> #include <boost/thread/condition.hpp> +#include <boost/thread/mutex.hpp> #include <unistd.h> #include <errno.h> #include <getopt.h> @@ -47,15 +48,15 @@ #include <vector> using std::cerr; -using std::string; using std::cout; using std::shared_ptr; +using std::string; static void help (string n) { cerr << "Syntax: " << n << " [OPTION]\n" - << " -v, --version show DCP-o-matic version\n" + << variant::insert_dcpomatic(" -v, --version show %1 version\n") << " -h, --help show this help\n" << " -t, --threads number of parallel encoding threads to use\n" << " --verbose be verbose to stdout\n" @@ -123,7 +124,7 @@ main (int argc, char* argv[]) server.run (); } catch (boost::system::system_error& e) { if (e.code() == boost::system::errc::address_in_use) { - cerr << argv[0] << ": address already in use. Is another DCP-o-matic server instance already running?\n"; + cerr << argv[0] << variant::insert_dcpomatic(": address already in use. Is another %1 server instance already running?\n"); exit (EXIT_FAILURE); } cerr << argv[0] << ": " << e.what() << "\n"; diff --git a/src/tools/dcpomatic_verifier.cc b/src/tools/dcpomatic_verifier.cc index 382516acc..273403a4e 100644 --- a/src/tools/dcpomatic_verifier.cc +++ b/src/tools/dcpomatic_verifier.cc @@ -30,6 +30,7 @@ #include "wx/verify_dcp_progress_panel.h" #include "wx/verify_dcp_result_panel.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/constants.h" #include "lib/cross.h" #include "lib/job_manager.h" @@ -146,7 +147,7 @@ private: bool OnInit() override { try { - SetAppName(_("DCP-o-matic Verifier")); + SetAppName(variant::wx::dcpomatic_verifier()); if (!wxApp::OnInit()) { return false; @@ -179,14 +180,14 @@ private: */ Config::drop(); - _frame = new DOMFrame(_("DCP-o-matic Verifier")); + _frame = new DOMFrame(variant::wx::dcpomatic_verifier()); SetTopWindow(_frame); _frame->SetSize({480, 640}); _frame->Show(); } catch (exception& e) { - error_dialog(nullptr, wxString::Format("DCP-o-matic Verifier could not start."), std_to_wx(e.what())); + error_dialog(nullptr, variant::wx::insert_dcpomatic_verifier("%s could not start."), std_to_wx(e.what())); } return true; |
