From b87e2660d0776f3d1380532ff0d2f3a28ed9d764 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 16 Apr 2024 22:19:39 +0200 Subject: Extract all uses of DCP-o-matic name to allow branding. --- src/lib/analytics.cc | 18 ++-- src/lib/config.cc | 11 +-- src/lib/create_cli.cc | 5 +- src/lib/cross_osx.cc | 13 +-- src/lib/email.cc | 6 +- src/lib/email.h | 1 + src/lib/encode_server.cc | 3 +- src/lib/encode_server_finder.cc | 3 +- src/lib/environment_info.cc | 7 +- src/lib/ffmpeg_content.cc | 3 +- src/lib/film.cc | 19 +++-- src/lib/hints.cc | 36 +++++--- src/lib/job.cc | 26 ++++-- src/lib/kdm_cli.cc | 13 +-- src/lib/release_notes.cc | 3 +- src/lib/send_problem_report_job.cc | 11 +-- src/lib/text_content.cc | 19 +++-- src/lib/transcode_job.cc | 6 +- src/lib/util.cc | 7 +- src/lib/variant.cc | 135 ++++++++++++++++++++++++++++++ src/lib/variant.h | 48 +++++++++++ src/lib/wscript | 1 + src/tools/dcpomatic.cc | 104 ++++++++++++++++-------- src/tools/dcpomatic_batch.cc | 11 ++- src/tools/dcpomatic_cli.cc | 5 +- src/tools/dcpomatic_combiner.cc | 10 ++- src/tools/dcpomatic_disk.cc | 22 +++-- src/tools/dcpomatic_editor.cc | 12 +-- src/tools/dcpomatic_kdm.cc | 20 +++-- src/tools/dcpomatic_player.cc | 32 ++++---- src/tools/dcpomatic_playlist.cc | 9 +- src/tools/dcpomatic_server.cc | 5 +- src/tools/dcpomatic_server_cli.cc | 21 ++--- src/tools/dcpomatic_verifier.cc | 7 +- src/wx/about_dialog.cc | 5 +- src/wx/audio_dialog.cc | 5 +- src/wx/config_dialog.cc | 5 +- src/wx/content_panel.cc | 13 ++- src/wx/content_view.cc | 3 +- src/wx/disk_warning_dialog.cc | 7 +- src/wx/dkdm_dialog.cc | 9 +- src/wx/full_config_dialog.cc | 43 +++++++--- src/wx/job_view.cc | 3 +- src/wx/kdm_dialog.cc | 9 +- src/wx/player_config_dialog.cc | 5 +- src/wx/playlist_controls.cc | 5 +- src/wx/playlist_editor_config_dialog.cc | 7 +- src/wx/screens_panel.cc | 19 ++++- src/wx/system_information_dialog.cc | 5 +- src/wx/try_unmount_dialog.cc | 8 +- src/wx/update_dialog.cc | 5 +- src/wx/wscript | 3 +- src/wx/wx_util.cc | 7 +- src/wx/wx_variant.cc | 140 ++++++++++++++++++++++++++++++++ src/wx/wx_variant.h | 52 ++++++++++++ 55 files changed, 791 insertions(+), 219 deletions(-) create mode 100644 src/lib/variant.cc create mode 100644 src/lib/variant.h create mode 100644 src/wx/wx_variant.cc create mode 100644 src/wx/wx_variant.h diff --git a/src/lib/analytics.cc b/src/lib/analytics.cc index 3fce79749..638f59f71 100644 --- a/src/lib/analytics.cc +++ b/src/lib/analytics.cc @@ -22,6 +22,7 @@ #include "analytics.h" #include "compose.hpp" #include "exceptions.h" +#include "variant.h" #include #include #include @@ -61,17 +62,17 @@ Analytics::successful_dcp_encode () boost::bind( boost::ref(Message), _("Congratulations!"), - String::compose (_( - "

You have made %1 DCPs with DCP-o-matic!

" + String::compose(_( + "

You have made %1 DCPs with %2!

" "" "

Hello. I'm Carl and I'm the " - "developer of DCP-o-matic. I work on it in my spare time (with the help " + "developer of %3. I work on it in my spare time (with the help " "of a fine volunteer team of testers and translators) and I release it " "as free software." - "

If you find DCP-o-matic useful, please consider a donation to the " + "

If you find %4 useful, please consider a donation to the " "project. Financial support will help me to spend more " - "time developing DCP-o-matic and making it better!" + "time developing %5 and making it better!" "

" - "

Thank you!"), _successful_dcp_encodes + "

Thank you!"), + _successful_dcp_encodes, + variant::dcpomatic(), + variant::dcpomatic(), + variant::dcpomatic(), + variant::dcpomatic() ) ) ); diff --git a/src/lib/config.cc b/src/lib/config.cc index 21192ad30..fb7a413de 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -33,6 +33,7 @@ #include "log.h" #include "ratio.h" #include "unzipper.h" +#include "variant.h" #include "zipper.h" #include #include @@ -433,7 +434,7 @@ try _kdm_bcc = f.optional_string_child ("KDMBCC").get_value_or (""); _kdm_email = f.string_child ("KDMEmail"); - _notification_subject = f.optional_string_child("NotificationSubject").get_value_or(_("DCP-o-matic notification")); + _notification_subject = f.optional_string_child("NotificationSubject").get_value_or(variant::insert_dcpomatic(_("%1 notification"))); _notification_from = f.optional_string_child("NotificationFrom").get_value_or(""); _notification_to = f.optional_string_child("NotificationTo").get_value_or(""); for (auto i: f.node_children("NotificationCC")) { @@ -1265,20 +1266,20 @@ Config::set_kdm_email_to_default () { _kdm_subject = _("KDM delivery: $CPL_NAME"); - _kdm_email = _( + _kdm_email = variant::insert_dcpomatic(_( "Dear Projectionist\n\n" "Please find attached KDMs for $CPL_NAME.\n\n" "Cinema: $CINEMA_NAME\n" "Screen(s): $SCREENS\n\n" "The KDMs are valid from $START_TIME until $END_TIME.\n\n" - "Best regards,\nDCP-o-matic" - ); + "Best regards,\n%1" + )); } void Config::set_notification_email_to_default () { - _notification_subject = _("DCP-o-matic notification"); + _notification_subject = variant::insert_dcpomatic(_("%1 notification")); _notification_email = _( "$JOB_NAME: $JOB_STATUS" diff --git a/src/lib/create_cli.cc b/src/lib/create_cli.cc index 1c2f2c635..cf903e376 100644 --- a/src/lib/create_cli.cc +++ b/src/lib/create_cli.cc @@ -26,6 +26,7 @@ #include "dcpomatic_log.h" #include "film.h" #include "ratio.h" +#include "variant.h" #include #include #include @@ -40,8 +41,8 @@ using boost::optional; string CreateCLI::_help = - "\nSyntax: %1 [OPTION] [OPTION] [ ...]\n" - " -v, --version show DCP-o-matic version\n" + string("\nSyntax: %1 [OPTION] [OPTION] [ ...]\n") + + variant::insert_dcpomatic(" -v, --version show %1 version\n") + " -h, --help show this help\n" " -n, --name film name\n" " -t, --template template name\n" diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 20fe9bce8..6df2f959e 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -19,12 +19,13 @@ */ -#include "cross.h" #include "compose.hpp" -#include "log.h" -#include "dcpomatic_log.h" #include "config.h" +#include "cross.h" +#include "dcpomatic_log.h" #include "exceptions.h" +#include "log.h" +#include "variant.h" #include #include #include @@ -168,6 +169,8 @@ Waker::~Waker () void start_tool (string executable, string app) { + boost::algorithm::replace_all(app, " ", "\\ "); + auto exe_path = directory_containing_executable(); exe_path = exe_path.parent_path(); // Contents exe_path = exe_path.parent_path(); // DCP-o-matic 2.app @@ -191,14 +194,14 @@ start_tool (string executable, string app) void start_batch_converter () { - start_tool ("dcpomatic2_batch", "DCP-o-matic\\ 2\\ Batch\\ Converter.app"); + start_tool("dcpomatic2_batch", variant::dcpomatic_batch_converter_app()); } void start_player () { - start_tool ("dcpomatic2_player", "DCP-o-matic\\ 2\\ Player.app"); + start_tool("dcpomatic2_player", variant::dcpomatic_player_app()); } diff --git a/src/lib/email.cc b/src/lib/email.cc index 8557b40e0..bd17bdf5b 100644 --- a/src/lib/email.cc +++ b/src/lib/email.cc @@ -23,6 +23,7 @@ #include "config.h" #include "email.h" #include "exceptions.h" +#include "variant.h" #include #include #include @@ -143,9 +144,8 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string "Content-Type: multipart/mixed; boundary=" + boundary + "\r\n"; } - _email += "Subject: " + encode_rfc1342(_subject) + "\r\n" - "User-Agent: DCP-o-matic\r\n" - "\r\n"; + _email += "Subject: " + encode_rfc1342(_subject) + "\r\n" + + variant::insert_dcpomatic("User-Agent: %1\r\n\r\n"); if (!_attachments.empty ()) { _email += "--" + boundary + "\r\n" diff --git a/src/lib/email.h b/src/lib/email.h index 36398bfd8..ac4703453 100644 --- a/src/lib/email.h +++ b/src/lib/email.h @@ -19,6 +19,7 @@ */ +#include "types.h" #include #include diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index b9c907e05..da5c7270e 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -37,6 +37,7 @@ #include "image.h" #include "log.h" #include "player_video.h" +#include "variant.h" #include "version.h" #include #include @@ -246,7 +247,7 @@ EncodeServer::run () { LOG_GENERAL ("Server %1 (%2) starting with %3 threads", dcpomatic_version, dcpomatic_git_commit, _num_threads); if (_verbose) { - cout << "DCP-o-matic server starting with " << _num_threads << " threads.\n"; + cout << variant::dcpomatic_encode_server() << " starting with " << _num_threads << " threads.\n"; } for (int i = 0; i < _num_threads; ++i) { diff --git a/src/lib/encode_server_finder.cc b/src/lib/encode_server_finder.cc index 1d4ced595..9ce9e1691 100644 --- a/src/lib/encode_server_finder.cc +++ b/src/lib/encode_server_finder.cc @@ -26,6 +26,7 @@ #include "encode_server_description.h" #include "encode_server_finder.h" #include "exceptions.h" +#include "variant.h" #include #include #include @@ -188,7 +189,7 @@ try { new tcp::acceptor (_listen_io_service, tcp::endpoint(tcp::v4(), is_batch_converter ? BATCH_SERVER_PRESENCE_PORT : MAIN_SERVER_PRESENCE_PORT)) ); } catch (...) { - boost::throw_exception (NetworkError (_("Could not listen for remote encode servers. Perhaps another instance of DCP-o-matic is running."))); + boost::throw_exception(NetworkError(variant::insert_dcpomatic(_("Could not listen for remote encode servers. Perhaps another instance of %1 is running.")))); } start_accept (); diff --git a/src/lib/environment_info.cc b/src/lib/environment_info.cc index 2e0347c79..d6592d126 100644 --- a/src/lib/environment_info.cc +++ b/src/lib/environment_info.cc @@ -22,6 +22,7 @@ #include "compose.hpp" #include "cross.h" #include "log.h" +#include "variant.h" #include "version.h" #include #include @@ -85,7 +86,7 @@ environment_info () { list info; - info.push_back (String::compose ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary())); + info.push_back(String::compose("%1 %2 git %3 using %4", variant::dcpomatic(), dcpomatic_version, dcpomatic_git_commit, dependency_version_summary())); { char buffer[128]; @@ -94,9 +95,9 @@ environment_info () } #ifdef DCPOMATIC_DEBUG - info.push_back ("DCP-o-matic built in debug mode."); + info.push_back(variant::insert_dcpomatic("%1 built in debug mode.")); #else - info.push_back ("DCP-o-matic built in optimised mode."); + info.push_back(variant::insert_dcpomatic("%1 built in optimised mode.")); #endif #ifdef LIBDCP_DEBUG info.push_back ("libdcp built in debug mode."); diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index c80bdec69..c2bb5ffe4 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -34,6 +34,7 @@ #include "job.h" #include "log.h" #include "text_content.h" +#include "variant.h" #include "video_content.h" #include #include @@ -118,7 +119,7 @@ FFmpegContent::FFmpegContent (cxml::ConstNodePtr node, int version, list if (auto filter = Filter::from_id(i->content())) { _filters.push_back(*filter); } else { - notes.push_back (String::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), i->content())); + notes.push_back(String::compose(_("%1 no longer supports the `%2' filter, so it has been turned off."), variant::dcpomatic(), i->content())); } } diff --git a/src/lib/film.cc b/src/lib/film.cc index a88e8a855..540d0b9b9 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -57,6 +57,7 @@ #include "text_content.h" #include "transcode_job.h" #include "upload_job.h" +#include "variant.h" #include "video_content.h" #include "version.h" #include @@ -507,7 +508,13 @@ Film::read_metadata (optional path) { if (!path) { if (dcp::filesystem::exists(file("metadata")) && !dcp::filesystem::exists(file(metadata_file))) { - throw runtime_error (_("This film was created with an older version of DCP-o-matic, and unfortunately it cannot be loaded into this version. You will need to create a new Film, re-add your content and set it up again. Sorry!")); + throw runtime_error( + variant::insert_dcpomatic( + _("This film was created with an older version of %1, and unfortunately it cannot " + "be loaded into this version. You will need to create a new Film, re-add your " + "content and set it up again. Sorry!") + ) + ); } path = file (metadata_file); @@ -522,7 +529,7 @@ Film::read_metadata (optional path) _state_version = f.number_child ("Version"); if (_state_version > current_state_version) { - throw runtime_error (_("This film was created with a newer version of DCP-o-matic, and it cannot be loaded into this version. Sorry!")); + throw runtime_error(variant::insert_dcpomatic(_("This film was created with a newer version of %1, and it cannot be loaded into this version. Sorry!"))); } else if (_state_version < current_state_version) { /* This is an older version; save a copy (if we haven't already) */ auto const older = path->parent_path() / String::compose("metadata.%1.xml", _state_version); @@ -1582,7 +1589,7 @@ Film::check_settings_consistency () } else if (!atmos_rate && rate != video_frame_rate()) { atmos_rate = rate; set_video_frame_rate (rate, false); - Message (_("DCP-o-matic had to change your settings so that the film's frame rate is the same as that of your Atmos content.")); + Message(variant::insert_dcpomatic(_("%1 had to change your settings so that the film's frame rate is the same as that of your Atmos content."))); } } } @@ -1614,7 +1621,7 @@ Film::check_settings_consistency () } if (change_made) { - Message (_("DCP-o-matic had to change your settings for referring to DCPs as OV. Please review those settings to make sure they are what you want.")); + Message(variant::insert_dcpomatic(_("%1 had to change your settings for referring to DCPs as OV. Please review those settings to make sure they are what you want."))); } if (reel_type() == ReelType::CUSTOM) { @@ -1625,9 +1632,9 @@ Film::check_settings_consistency () if (too_late != boundaries.end()) { if (std::distance(too_late, boundaries.end()) > 1) { - Message(_("DCP-o-matic had to remove some of your custom reel boundaries as they no longer lie within the film.")); + Message(variant::insert_dcpomatic(_("%1 had to remove some of your custom reel boundaries as they no longer lie within the film."))); } else { - Message(_("DCP-o-matic had to remove one of your custom reel boundaries as it no longer lies within the film.")); + Message(variant::insert_dcpomatic(_("%1 had to remove one of your custom reel boundaries as it no longer lies within the film."))); } boundaries.erase(too_late, boundaries.end()); set_custom_reel_boundaries(boundaries); diff --git a/src/lib/hints.cc b/src/lib/hints.cc index bbd5ae5d5..7a6a2a4bf 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -35,6 +35,7 @@ #include "player.h" #include "ratio.h" #include "text_content.h" +#include "variant.h" #include "video_content.h" #include "writer.h" #include @@ -107,7 +108,13 @@ void Hints::check_few_audio_channels () { if (film()->audio_channels() < 6) { - hint (_("Your DCP has fewer than 6 audio channels. This may cause problems on some projectors. You may want to set the DCP to have 6 channels. It does not matter if your content has fewer channels, as DCP-o-matic will fill the extras with silence.")); + hint( + variant::insert_dcpomatic( + _("Your DCP has fewer than 6 audio channels. This may cause problems on some projectors. " + "You may want to set the DCP to have 6 channels. It does not matter if your content has " + "fewer channels, as %1 will fill the extras with silence.") + ) + ); } } @@ -117,7 +124,12 @@ Hints::check_upmixers () { auto ap = film()->audio_processor(); if (ap && (ap->id() == "stereo-5.1-upmix-a" || ap->id() == "stereo-5.1-upmix-b")) { - hint (_("You are using DCP-o-matic's stereo-to-5.1 upmixer. This is experimental and may result in poor-quality audio. If you continue, you should listen to the resulting DCP in a cinema to make sure that it sounds good.")); + hint(variant::insert_dcpomatic( + _("You are using %1's stereo-to-5.1 upmixer. This is experimental and " + "may result in poor-quality audio. If you continue, you should listen to the " + "resulting DCP in a cinema to make sure that it sounds good.") + ) + ); } } @@ -718,16 +730,20 @@ Hints::check_certificates () switch (*bad) { case Config::BAD_SIGNER_UTF8_STRINGS: - hint(_("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error " - "which will prevent DCPs from being validated correctly on some systems. It is advisable to " - "re-create the signing certificate chain by clicking the \"Re-make certificates and key...\" " - "button in the Keys page of Preferences.")); + hint(variant::insert_dcpomatic( + _("The certificate chain that %1 uses for signing DCPs and KDMs contains a small error " + "which will prevent DCPs from being validated correctly on some systems. It is advisable to " + "re-create the signing certificate chain by clicking the \"Re-make certificates and key...\" " + "button in the Keys page of Preferences.") + )); break; case Config::BAD_SIGNER_VALIDITY_TOO_LONG: - hint(_("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs has a validity period " - "that is too long. This will cause problems playing back DCPs on some systems. " - "It is advisable to re-create the signing certificate chain by clicking the " - "\"Re-make certificates and key...\" button in the Keys page of Preferences.")); + hint(variant::insert_dcpomatic( + _("The certificate chain that %1 uses for signing DCPs and KDMs has a validity period " + "that is too long. This will cause problems playing back DCPs on some systems. " + "It is advisable to re-create the signing certificate chain by clicking the " + "\"Re-make certificates and key...\" button in the Keys page of Preferences.") + )); break; default: /* Some bad situations can't happen here as DCP-o-matic would have refused to start until they are fixed */ diff --git a/src/lib/job.cc b/src/lib/job.cc index 9e685ec11..94c23aac6 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -33,6 +33,7 @@ #include "job.h" #include "log.h" #include "util.h" +#include "variant.h" #include #include #include @@ -137,9 +138,13 @@ Job::run_wrapper () /* 32-bit */ set_error ( _("Failed to encode the DCP."), - _("This error has probably occurred because you are running the 32-bit version of DCP-o-matic and " - "trying to use too many encoding threads. Please reduce the 'number of threads DCP-o-matic should " - "use' in the General tab of Preferences and try again.") + String::compose( + _("This error has probably occurred because you are running the 32-bit version of %1 and " + "trying to use too many encoding threads. Please reduce the 'number of threads %2 should " + "use' in the General tab of Preferences and try again."), + variant::dcpomatic(), + variant::dcpomatic() + ) ); done = true; #else @@ -147,7 +152,12 @@ Job::run_wrapper () if (running_32_on_64()) { set_error ( _("Failed to encode the DCP."), - _("This error has probably occurred because you are running the 32-bit version of DCP-o-matic. Please re-install DCP-o-matic with the 64-bit installer and try again.") + String::compose( + _("This error has probably occurred because you are running the 32-bit version of %1. " + "Please re-install %2 with the 64-bit installer and try again."), + variant::dcpomatic(), + variant::dcpomatic() + ) ); done = true; } @@ -168,8 +178,8 @@ Job::run_wrapper () set_error ( String::compose (_("Could not open %1"), e.file().string()), - String::compose ( - _("DCP-o-matic could not open the file %1 (%2). Perhaps it does not exist or is in an unexpected format."), + String::compose(_("%1 could not open the file %2 (%3). Perhaps it does not exist or is in an unexpected format."), + variant::dcpomatic(), dcp::filesystem::absolute(e.file()).string(), e.what() ) @@ -183,8 +193,8 @@ Job::run_wrapper () if (e.code() == boost::system::errc::no_such_file_or_directory) { set_error ( String::compose (_("Could not open %1"), e.path1().string ()), - String::compose ( - _("DCP-o-matic could not open the file %1 (%2). Perhaps it does not exist or is in an unexpected format."), + String::compose(_("%1 could not open the file %2 (%3). Perhaps it does not exist or is in an unexpected format."), + variant::dcpomatic(), dcp::filesystem::absolute(e.path1()).string(), e.what() ) diff --git a/src/lib/kdm_cli.cc b/src/lib/kdm_cli.cc index 651ba8e26..c442cacdc 100644 --- a/src/lib/kdm_cli.cc +++ b/src/lib/kdm_cli.cc @@ -32,6 +32,7 @@ #include "film.h" #include "kdm_with_metadata.h" #include "screen.h" +#include "variant.h" #include #include #include @@ -60,9 +61,9 @@ help (std::function out) out (String::compose("Syntax: %1 [OPTION] [COMMAND] ", program_name)); out ("Commands:"); out ("create create KDMs; default if no other command is specified"); - out ("list-cinemas list known cinemas from DCP-o-matic settings"); - out ("list-dkdm-cpls list CPLs for which DCP-o-matic has DKDMs"); - out ("add-dkdm add DKDM to DCP-o-matic's list"); + out (variant::insert_dcpomatic("list-cinemas list known cinemas from %1 settings")); + out (variant::insert_dcpomatic("list-dkdm-cpls list CPLs for which %1 has DKDMs")); + out (variant::insert_dcpomatic("add-dkdm add DKDM to %1's list")); out (" -h, --help show this help"); out (" -o, --output output file or directory"); out (" -K, --filename-format filename format for KDMs"); @@ -81,15 +82,15 @@ help (std::function out) out (" -C, --projector-certificate file containing projector certificate"); out (" -T, --trusted-device-certificate file containing a trusted device's certificate"); out (" --decryption-key file containing the private key which can decrypt the given DKDM"); - out (" (DCP-o-matic's configured private key will be used otherwise)"); + out (variant::insert_dcpomatic(" (%1's configured private key will be used otherwise)")); out (" --cinemas-file use the given file as a list of cinemas instead of the current configuration"); out (""); - out ("CPL-ID must be the ID of a CPL that is mentioned in DCP-o-matic's DKDM list."); + out (variant::insert_dcpomatic("CPL-ID must be the ID of a CPL that is mentioned in %1's DKDM list.")); out (""); out ("For example:"); out (""); out ("Create KDMs for my_great_movie to play in all of Fred's Cinema's screens for the next two weeks and zip them up."); - out ("(Fred's Cinema must have been set up in DCP-o-matic's KDM window)"); + out (variant::insert_dcpomatic("(Fred's Cinema must have been set up in %1's KDM window)")); out (""); out (String::compose("\t%1 -c \"Fred's Cinema\" -f now -d \"2 weeks\" -z my_great_movie", program_name)); } diff --git a/src/lib/release_notes.cc b/src/lib/release_notes.cc index d69738427..b12ebc030 100644 --- a/src/lib/release_notes.cc +++ b/src/lib/release_notes.cc @@ -21,6 +21,7 @@ #include "config.h" #include "release_notes.h" +#include "variant.h" #include "version.h" #include "i18n.h" @@ -46,7 +47,7 @@ find_release_notes(bool dark, optional current) string const colour = dark ? "white" : "black"; auto const span = String::compose("", colour); - const string header = String::compose("

%1DCP-o-matic %2 release notes

", span, *current); + const string header = String::compose("

%1%2 %3 release notes

", span, variant::dcpomatic(), *current); if (!last) { return header + span + diff --git a/src/lib/send_problem_report_job.cc b/src/lib/send_problem_report_job.cc index 9569aca3b..ed78112e9 100644 --- a/src/lib/send_problem_report_job.cc +++ b/src/lib/send_problem_report_job.cc @@ -19,15 +19,16 @@ */ -#include "send_problem_report_job.h" #include "compose.hpp" -#include "film.h" #include "cross.h" +#include "email.h" +#include "environment_info.h" +#include "film.h" #include "film.h" #include "log.h" +#include "send_problem_report_job.h" +#include "variant.h" #include "version.h" -#include "email.h" -#include "environment_info.h" #include #include "i18n.h" @@ -108,7 +109,7 @@ SendProblemReportJob::run () body += "---<8----\n"; } - Email email(_from, {"carl@dcpomatic.com"}, "DCP-o-matic problem report", body); + Email email(_from, {"carl@dcpomatic.com"}, variant::insert_dcpomatic("%1 problem report"), body); email.send("main.carlh.net", 2525, EmailProtocol::STARTTLS); set_progress (1); diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index cfdaabcbc..03336f15d 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -19,11 +19,12 @@ */ -#include "text_content.h" -#include "util.h" +#include "content.h" #include "exceptions.h" #include "font.h" -#include "content.h" +#include "text_content.h" +#include "util.h" +#include "variant.h" #include #include #include @@ -32,13 +33,13 @@ #include "i18n.h" -using std::string; -using std::vector; using std::cout; +using std::dynamic_pointer_cast; using std::list; -using std::shared_ptr; using std::make_shared; -using std::dynamic_pointer_cast; +using std::shared_ptr; +using std::string; +using std::vector; using boost::optional; using dcp::raw_convert; using namespace dcpomatic; @@ -246,9 +247,9 @@ TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version, */ if (version <= 37) { if (!lang->content().empty()) { - notes.push_back (String::compose( + notes.push_back(String::compose( _("A subtitle or closed caption file in this project is marked with the language '%1', " - "which DCP-o-matic does not recognise. The file's language has been cleared."), lang->content())); + "which %2 does not recognise. The file's language has been cleared."), lang->content(), variant::dcpomatic())); } } else { throw; diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index b260bc44b..ba420ab94 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -37,6 +37,7 @@ #include "log.h" #include "transcode_job.h" #include "upload_job.h" +#include "variant.h" #include #include @@ -110,7 +111,10 @@ TranscodeJob::run () return; case ChangedBehaviour::STOP: set_progress (1); - set_error (_("Files have changed since they were added to the project."), _("Open the project in DCP-o-matic, check the settings, then save it before trying again.")); + set_error( + _("Files have changed since they were added to the project."), + variant::insert_dcpomatic(_("Open the project in %1, check the settings, then save it before trying again.")) + ); set_state (FINISHED_ERROR); return; default: diff --git a/src/lib/util.cc b/src/lib/util.cc index ef15b90e5..60117f61d 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -49,6 +49,7 @@ #include "string_text.h" #include "text_decoder.h" #include "util.h" +#include "variant.h" #include "video_content.h" #include #include @@ -515,7 +516,7 @@ mo_path () boost::filesystem::path mo_path () { - return "DCP-o-matic 2.app/Contents/Resources"; + return variant::dcpomatic_app() + "/Contents/Resources"; } #endif @@ -1018,9 +1019,9 @@ decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm) } } if (!on_chain) { - throw KDMError (_("This KDM was not made for DCP-o-matic's decryption certificate."), e.what()); + throw KDMError(variant::insert_dcpomatic(_("This KDM was not made for %1's decryption certificate.")), e.what()); } else if (kdm_subject_name != dc->leaf().subject()) { - throw KDMError (_("This KDM was made for DCP-o-matic but not for its leaf certificate."), e.what()); + throw KDMError(variant::insert_dcpomatic(_("This KDM was made for %1 but not for its leaf certificate.")), e.what()); } else { throw; } diff --git a/src/lib/variant.cc b/src/lib/variant.cc new file mode 100644 index 000000000..e69d94012 --- /dev/null +++ b/src/lib/variant.cc @@ -0,0 +1,135 @@ +/* + Copyright (C) 2024 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + + +#include "variant.h" + + +static char const* _dcpomatic = "DCP-o-matic"; +static char const* _dcpomatic_player = "DCP-o-matic Player"; +static char const* _dcpomatic_kdm_creator = "DCP-o-matic KDM Creator"; +static char const* _dcpomatic_verifier = "DCP-o-matic Verifier"; +static char const* _dcpomatic_app = "DCP-o-matic 2.app"; +static char const* _dcpomatic_player_app = "DCP-o-matic 2 Player.app"; +static char const* _dcpomatic_disk_writer = "DCP-o-matic Disk Writer"; +static char const* _dcpomatic_editor = "DCP-o-matic Editor"; +static char const* _dcpomatic_encode_server = "DCP-o-matic Encode Server"; +static char const* _dcpomatic_batch_converter_app = "DCP-o-matic 2 Batch Converter.app"; +static char const* _dcpomatic_playlist_editor = "DCP-o-matic Playlist Editor"; +static char const* _dcpomatic_combiner = "DCP-o-matic Combiner"; +static char const* _dcpomatic_batch_converter = "DCP-o-matic Batch Converter"; + + +std::string +variant::dcpomatic() +{ + return _dcpomatic; +} + +std::string +variant::dcpomatic_batch_converter() +{ + return _dcpomatic_batch_converter; +} + +std::string +variant::dcpomatic_combiner() +{ + return _dcpomatic_combiner; +} + +std::string +variant::dcpomatic_disk_writer() +{ + return _dcpomatic_disk_writer; +} + +std::string +variant::dcpomatic_editor() +{ + return _dcpomatic_editor; +} + +std::string +variant::dcpomatic_encode_server() +{ + return _dcpomatic_encode_server; +} + +std::string +variant::dcpomatic_kdm_creator() +{ + return _dcpomatic_kdm_creator; +} + +std::string +variant::dcpomatic_player() +{ + return _dcpomatic_player; +} + +std::string +variant::dcpomatic_playlist_editor() +{ + return _dcpomatic_playlist_editor; +} + +std::string +variant::dcpomatic_verifier() +{ + return _dcpomatic_verifier; +} + +std::string +variant::insert_dcpomatic(std::string const& s) +{ + return String::compose(s, _dcpomatic); +} + +std::string +variant::insert_dcpomatic_encode_server(std::string const& s) +{ + return String::compose(s, _dcpomatic_encode_server); +} + +std::string +variant::insert_dcpomatic_kdm_creator(std::string const& s) +{ + return String::compose(s, _dcpomatic_kdm_creator); +} + +std::string +variant::dcpomatic_app() +{ + return _dcpomatic_app; +} + +std::string +variant::dcpomatic_batch_converter_app() +{ + return _dcpomatic_batch_converter_app; +} + +std::string +variant::dcpomatic_player_app() +{ + return _dcpomatic_player_app; +} + diff --git a/src/lib/variant.h b/src/lib/variant.h new file mode 100644 index 000000000..66b06376b --- /dev/null +++ b/src/lib/variant.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2024 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + + +#include "compose.hpp" + + +namespace variant +{ + +std::string dcpomatic(); +std::string dcpomatic_batch_converter(); +std::string dcpomatic_combiner(); +std::string dcpomatic_disk_writer(); +std::string dcpomatic_editor(); +std::string dcpomatic_encode_server(); +std::string dcpomatic_kdm_creator(); +std::string dcpomatic_player(); +std::string dcpomatic_playlist_editor(); +std::string dcpomatic_verifier(); + +std::string insert_dcpomatic(std::string const& s); +std::string insert_dcpomatic_encode_server(std::string const& s); +std::string insert_dcpomatic_kdm_creator(std::string const& s); + +std::string dcpomatic_app(); +std::string dcpomatic_batch_converter_app(); +std::string dcpomatic_player_app(); + +} + diff --git a/src/lib/wscript b/src/lib/wscript index 878b503a8..4eeeb578e 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -206,6 +206,7 @@ sources = """ upmixer_b.cc usl.cc util.cc + variant.cc verify_dcp_job.cc video_content.cc video_decoder.cc 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 @@ -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 @@ -66,7 +67,7 @@ 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" << " -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 run a JSON server on the specified port\n" << " -k, --keep-going keep running even when the job is complete\n" << " -s, --servers 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 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(_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( 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( 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( 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 #include #include @@ -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(); #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 #include #include @@ -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 @@ -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(_film, dcp); _examine_job_connection = job->Finished.connect(bind(&DOMFrame::add_dcp_to_film, this, weak_ptr(job), weak_ptr(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(_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(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(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 @@ -18,26 +18,27 @@ */ +#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 #include #include -#include #include -#include #include +#include #include #include #include @@ -47,15 +48,15 @@ #include 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; diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc index 8b1f8a038..28bee89b9 100644 --- a/src/wx/about_dialog.cc +++ b/src/wx/about_dialog.cc @@ -26,6 +26,7 @@ #include "about_dialog.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/compose.hpp" #include "lib/version.h" #include @@ -38,7 +39,7 @@ using std::vector; AboutDialog::AboutDialog (wxWindow* parent) - : wxDialog (parent, wxID_ANY, _("About DCP-o-matic")) + : wxDialog(parent, wxID_ANY, variant::wx::insert_dcpomatic(_("About %s"))) { auto overall_sizer = new wxBoxSizer (wxVERTICAL); auto sizer = new wxBoxSizer (wxVERTICAL); @@ -53,7 +54,7 @@ AboutDialog::AboutDialog (wxWindow* parent) wxFont version_font (*wxNORMAL_FONT); version_font.SetWeight (wxFONTWEIGHT_BOLD); - auto t = new StaticText (this, _("DCP-o-matic")); + auto t = new StaticText(this, variant::wx::dcpomatic()); t->SetFont (title_font); sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16)); diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index 714bf78e4..1f7f3ad03 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -24,6 +24,7 @@ #include "check_box.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/analyse_audio_job.h" #include "lib/audio_analysis.h" #include "lib/audio_content.h" @@ -166,9 +167,9 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film, FilmViewer& v _film_content_connection = film->ContentChange.connect(boost::bind(&AudioDialog::content_change, this, _1, _3)); DCPOMATIC_ASSERT (film->directory()); if (content) { - SetTitle(wxString::Format(_("DCP-o-matic audio - %s"), std_to_wx(content->path(0).string()))); + SetTitle(wxString::Format(_("%s audio - %s"), variant::wx::dcpomatic(), std_to_wx(content->path(0).string()))); } else { - SetTitle(wxString::Format(_("DCP-o-matic audio - %s"), std_to_wx(film->directory().get().string()))); + SetTitle(wxString::Format(_("%s audio - %s"), variant::wx::dcpomatic(), std_to_wx(film->directory().get().string()))); } if (content) { diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index b4adc855e..04bb26c2e 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -25,6 +25,7 @@ #include "dcpomatic_button.h" #include "nag_dialog.h" #include "static_text.h" +#include "wx_variant.h" #include "lib/constants.h" #include #include @@ -148,7 +149,7 @@ GeneralPage::add_language_controls (wxGridBagSizer* table, int& r) ++r; auto restart = add_label_to_sizer ( - table, _panel, _("(restart DCP-o-matic to see language changes)"), false, wxGBPosition (r, 0), wxGBSpan (1, 2) + table, _panel, variant::wx::insert_dcpomatic(_("(restart %s to see language changes)")), false, wxGBPosition (r, 0), wxGBSpan (1, 2) ); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); @@ -792,7 +793,7 @@ KeysPage::import_decryption_chain_and_key () if (new_chain->chain_valid() && new_chain->private_key_valid()) { Config::instance()->set_decryption_chain(new_chain); } else { - error_dialog(_panel, _("Invalid DCP-o-matic export file")); + error_dialog(_panel, variant::wx::insert_dcpomatic(_("Invalid %s export file"))); } } diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index ed9c15c83..07a632b4a 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -31,6 +31,7 @@ #include "timing_panel.h" #include "video_panel.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/audio_content.h" #include "lib/case_insensitive_sorter.h" #include "lib/compose.hpp" @@ -673,10 +674,14 @@ ContentPanel::add_dcp(boost::filesystem::path dcp) } catch (ProjectFolderError &) { error_dialog ( _parent, - _( - "This looks like a DCP-o-matic project folder, which cannot be added to a different project. " - "Choose the DCP folder inside the DCP-o-matic project folder if that's what you want to import." - ) + wxString::Format( + _( + "This looks like a %s project folder, which cannot be added to a different project. " + "Choose the DCP folder inside the %s project folder if that's what you want to import." + ), + variant::wx::dcpomatic(), + variant::wx::dcpomatic() + ) ); } catch (exception& e) { error_dialog(_parent, e.what()); diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc index b9fe7ce00..b2d6f86d1 100644 --- a/src/wx/content_view.cc +++ b/src/wx/content_view.cc @@ -21,6 +21,7 @@ #include "content_view.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/content_factory.h" #include "lib/cross.h" @@ -86,7 +87,7 @@ ContentView::update () dir = home_directory (); } - wxProgressDialog progress (_("DCP-o-matic"), _("Reading content directory")); + wxProgressDialog progress(variant::wx::dcpomatic(), _("Reading content directory")); auto jm = JobManager::instance (); list> jobs; diff --git a/src/wx/disk_warning_dialog.cc b/src/wx/disk_warning_dialog.cc index 531b7f4f9..9af4a2aca 100644 --- a/src/wx/disk_warning_dialog.cc +++ b/src/wx/disk_warning_dialog.cc @@ -18,9 +18,12 @@ */ + #include "disk_warning_dialog.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" + DiskWarningDialog::DiskWarningDialog () : wxDialog(nullptr, wxID_ANY, _("Important notice")) @@ -45,10 +48,10 @@ DiskWarningDialog::DiskWarningDialog () auto const confirmation = _("I am sure"); text->SetLabelMarkup(wxString::Format( - _("The DCP-o-matic Disk Writer is\n\nBETA-GRADE TEST SOFTWARE\n\n" + _("The %s is\n\nBETA-GRADE TEST SOFTWARE\n\n" "and may\n\nDESTROY DATA!\n\n" "If you are sure you want to continue please type\n\n%s\n\ninto the box below, then click OK."), - confirmation)); + variant::wx::dcpomatic_disk_writer(), confirmation)); } bool diff --git a/src/wx/dkdm_dialog.cc b/src/wx/dkdm_dialog.cc index 82c2e3598..a36a9ceae 100644 --- a/src/wx/dkdm_dialog.cc +++ b/src/wx/dkdm_dialog.cc @@ -28,6 +28,7 @@ #include "recipients_panel.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/film.h" #include "lib/job_manager.h" @@ -170,7 +171,13 @@ DKDMDialog::make_clicked () 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( + _("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 (runtime_error& e) { diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index e3ea91224..193392f29 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -49,6 +49,7 @@ #include "grok/gpu_config_panel.h" #endif #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/cross.h" #include "lib/dcp_content_type.h" @@ -107,12 +108,12 @@ private: int r = 0; add_language_controls (table, r); - add_label_to_sizer (table, _panel, _("Number of threads DCP-o-matic should use"), true, wxGBPosition (r, 0)); + add_label_to_sizer(table, _panel, variant::wx::insert_dcpomatic(_("Number of threads %s should use")), true, wxGBPosition(r, 0)); _master_encoding_threads = new wxSpinCtrl (_panel); table->Add (_master_encoding_threads, wxGBPosition (r, 1)); ++r; - add_label_to_sizer (table, _panel, _("Number of threads DCP-o-matic encode server should use"), true, wxGBPosition (r, 0)); + add_label_to_sizer(table, _panel, variant::wx::insert_dcpomatic_encode_server(_("Number of threads %s should use")), true, wxGBPosition(r, 0)); _server_encoding_threads = new wxSpinCtrl (_panel); table->Add (_server_encoding_threads, wxGBPosition (r, 1)); ++r; @@ -986,8 +987,8 @@ private: Email email( wx_to_std(dialog.from()), { wx_to_std(dialog.to()) }, - wx_to_std(_("DCP-o-matic test email")), - wx_to_std(_("This is a test email from DCP-o-matic.")) + wx_to_std(variant::wx::insert_dcpomatic(_("%s test email"))), + wx_to_std(variant::wx::insert_dcpomatic(_("This is a test email from %s."))) ); auto config = Config::instance(); try { @@ -1407,32 +1408,50 @@ private: add_label_to_sizer (table, _panel, _("Issuer"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _issuer = new wxTextCtrl (_panel, wxID_ANY); - _issuer->SetToolTip (_("This will be written to the DCP's XML files as the . If it is blank, a default value mentioning DCP-o-matic will be used.")); + _issuer->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's XML files as the . If it is blank, a default value mentioning %s will be used.") + )); table->Add (_issuer, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("Creator"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _creator = new wxTextCtrl (_panel, wxID_ANY); - _creator->SetToolTip (_("This will be written to the DCP's XML files as the . If it is blank, a default value mentioning DCP-o-matic will be used.")); + _creator->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's XML files as the . If it is blank, a default value mentioning %s will be used.") + )); table->Add (_creator, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("Company name"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _company_name = new wxTextCtrl (_panel, wxID_ANY); - _company_name->SetToolTip (_("This will be written to the DCP's MXF files as the 'company name'. If it is blank, a default value mentioning libdcp (an internal DCP-o-matic library) will be used.")); + _company_name->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's MXF files as the 'company name'. If it is blank, a default value mentioning libdcp (an internal %s library) will be used.") + )); table->Add (_company_name, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("Product name"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _product_name = new wxTextCtrl (_panel, wxID_ANY); - _product_name->SetToolTip (_("This will be written to the DCP's MXF files as the 'product name'. If it is blank, a default value mentioning libdcp (an internal DCP-o-matic library) will be used.")); + _product_name->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's MXF files as the 'product name'. If it is blank, a default value mentioning libdcp (an internal %s library) will be used.") + )); table->Add (_product_name, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("Product version"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _product_version = new wxTextCtrl (_panel, wxID_ANY); - _product_version->SetToolTip (_("This will be written to the DCP's MXF files as the 'product version'. If it is blank, a default value mentioning libdcp (an internal DCP-o-matic library) will be used.")); + _product_version->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's MXF files as the 'product version'. If it is blank, a default value mentioning libdcp (an internal %s library) will be used.") + )); table->Add (_product_version, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("JPEG2000 comment"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _j2k_comment = new wxTextCtrl (_panel, wxID_ANY); - _j2k_comment->SetToolTip (_("This will be written to the DCP's JPEG2000 data as a comment. If it is blank, a default value mentioning libdcp (an internal DCP-o-matic library) will be used.")); + _j2k_comment->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's JPEG2000 data as a comment. If it is blank, a default value mentioning libdcp (an internal %s library) will be used.") + )); table->Add (_j2k_comment, 1, wxALL | wxEXPAND); _panel->GetSizer()->Add (table, 0, wxEXPAND | wxALL, _border); @@ -1540,7 +1559,7 @@ private: _allow_any_container = new CheckBox(_panel, _("Allow full-frame and non-standard container ratios")); table->Add(_allow_any_container, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); - auto restart = new StaticText(_panel, _("(restart DCP-o-matic to see all ratios)")); + auto restart = new StaticText(_panel, variant::wx::insert_dcpomatic(_("(restart %s to see all ratios)"))); auto font = restart->GetFont(); font.SetStyle(wxFONTSTYLE_ITALIC); font.SetPointSize(font.GetPointSize() - 1); @@ -1674,7 +1693,7 @@ private: _video_display_mode = new wxChoice (_panel, wxID_ANY); table->Add (_video_display_mode); - auto restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to change display mode)"), false); + auto restart = add_label_to_sizer(table, _panel, variant::wx::insert_dcpomatic(_("(restart %s to change display mode)")), false); auto font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc index efe17f4de..d5b6c4632 100644 --- a/src/wx/job_view.cc +++ b/src/wx/job_view.cc @@ -25,6 +25,7 @@ #include "message_dialog.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/analyse_audio_job.h" #include "lib/compose.hpp" #include "lib/config.h" @@ -165,7 +166,7 @@ JobView::finished () if (_job->enable_notify() && _notify->GetValue()) { if (Config::instance()->notification(Config::MESSAGE_BOX)) { - wxMessageBox (std_to_wx(_job->name() + ": " + _job->status()), _("DCP-o-matic"), wxICON_INFORMATION); + wxMessageBox(std_to_wx(_job->name() + ": " + _job->status()), variant::wx::dcpomatic(), wxICON_INFORMATION); } if (Config::instance()->notification(Config::EMAIL)) { string body = Config::instance()->notification_email(); diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 5ab13b4ce..e9d186264 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -29,6 +29,7 @@ #include "screens_panel.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/cinema.h" #include "lib/config.h" #include "lib/film.h" @@ -219,7 +220,13 @@ KDMDialog::make_clicked () 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( + _("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 (runtime_error& e) { diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc index 58874e50b..d7bba4dcc 100644 --- a/src/wx/player_config_dialog.cc +++ b/src/wx/player_config_dialog.cc @@ -37,6 +37,7 @@ #include "server_dialog.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/cross.h" #include "lib/dcp_content_type.h" @@ -114,7 +115,7 @@ private: table->Add (_video_display_mode, wxGBPosition(r, 1)); ++r; - wxStaticText* restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to change display mode)"), false, wxGBPosition(r, 0)); + wxStaticText* restart = add_label_to_sizer(table, _panel, variant::wx::insert_dcpomatic_player(_("(restart %s to change display mode)")), false, wxGBPosition(r, 0)); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); @@ -353,7 +354,7 @@ private: wxPreferencesEditor* create_player_config_dialog () { - auto e = new wxPreferencesEditor (_("DCP-o-matic Player Preferences")); + auto e = new wxPreferencesEditor(variant::wx::insert_dcpomatic_player(_("%s Preferences"))); #ifdef DCPOMATIC_OSX /* Width that we force some of the config panels to be on OSX so that diff --git a/src/wx/playlist_controls.cc b/src/wx/playlist_controls.cc index 3a1bba362..f51bcc4e2 100644 --- a/src/wx/playlist_controls.cc +++ b/src/wx/playlist_controls.cc @@ -25,6 +25,7 @@ #include "playlist_controls.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/compose.hpp" #include "lib/constants.h" #include "lib/cross.h" @@ -331,7 +332,7 @@ PlaylistControls::spl_selection_changed () void PlaylistControls::select_playlist (int selected, int position) { - wxProgressDialog dialog (_("DCP-o-matic"), "Loading playlist and KDMs"); + wxProgressDialog dialog(variant::wx::dcpomatic(), "Loading playlist and KDMs"); for (auto const& i: _playlists[selected].get()) { dialog.Pulse (); @@ -403,7 +404,7 @@ PlaylistControls::update_current_content () { DCPOMATIC_ASSERT (_selected_playlist); - wxProgressDialog dialog (_("DCP-o-matic"), "Loading content"); + wxProgressDialog dialog(variant::wx::dcpomatic(), "Loading content"); setup_sensitivity (); dialog.Pulse (); diff --git a/src/wx/playlist_editor_config_dialog.cc b/src/wx/playlist_editor_config_dialog.cc index d5c4106ea..67bedc05e 100644 --- a/src/wx/playlist_editor_config_dialog.cc +++ b/src/wx/playlist_editor_config_dialog.cc @@ -18,8 +18,11 @@ */ -#include "playlist_editor_config_dialog.h" + #include "config_dialog.h" +#include "playlist_editor_config_dialog.h" +#include "wx_variant.h" + /** @file src/playlist_editor_config_dialog.cc * @brief A dialogue to edit DCP-o-matic Playlist Editor configuration. @@ -28,7 +31,7 @@ wxPreferencesEditor* create_playlist_editor_config_dialog () { - auto e = new wxPreferencesEditor (_("DCP-o-matic Playlist Editor Preferences")); + auto e = new wxPreferencesEditor(variant::wx::insert_dcpomatic_playlist_editor(_("%s Preferences"))); #ifdef DCPOMATIC_OSX /* Width that we force some of the config panels to be on OSX so that diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc index 62f8688a9..52545e5f6 100644 --- a/src/wx/screens_panel.cc +++ b/src/wx/screens_panel.cc @@ -25,6 +25,7 @@ #include "screen_dialog.h" #include "screens_panel.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/cinema.h" #include "lib/config.h" #include "lib/screen.h" @@ -261,7 +262,14 @@ ScreensPanel::add_cinema_clicked () dcp::ScopeGuard sg = [this]() { _ignore_cinemas_changed = false; }; Config::instance()->add_cinema(cinema); } catch (FileError& e) { - error_dialog(GetParent(), _("Could not write cinema details to the cinemas.xml file. Check that the location of cinemas.xml is valid in DCP-o-matic's preferences."), std_to_wx(e.what())); + error_dialog( + GetParent(), + variant::wx::insert_dcpomatic( + _("Could not write cinema details to the cinemas.xml file. Check that the location of " + "cinemas.xml is valid in %s's preferences.") + ), + std_to_wx(e.what()) + ); return; } @@ -718,7 +726,14 @@ ScreensPanel::notify_cinemas_changed() try { Config::instance()->changed(Config::CINEMAS); } catch (FileError& e) { - error_dialog(GetParent(), _("Could not write cinema details to the cinemas.xml file. Check that the location of cinemas.xml is valid in DCP-o-matic's preferences."), std_to_wx(e.what())); + error_dialog( + GetParent(), + variant::wx::insert_dcpomatic( + _("Could not write cinema details to the cinemas.xml file. Check that the location of " + "cinemas.xml is valid in %s's preferences.") + ), + std_to_wx(e.what()) + ); return false; } diff --git a/src/wx/system_information_dialog.cc b/src/wx/system_information_dialog.cc index fbae2e010..26138900a 100644 --- a/src/wx/system_information_dialog.cc +++ b/src/wx/system_information_dialog.cc @@ -23,6 +23,7 @@ #include "gl_video_view.h" #include "system_information_dialog.h" #include "wx_util.h" +#include "wx_variant.h" #ifdef DCPOMATIC_OSX @@ -48,7 +49,7 @@ SystemInformationDialog::SystemInformationDialog(wxWindow* parent, FilmViewer co if (!gl) { add (_("OpenGL version"), true); - add (_("unknown (OpenGL not enabled in DCP-o-matic)"), false); + add(variant::wx::insert_dcpomatic(_("unknown (OpenGL not enabled in %s)")), false); } else { auto information = gl->information(); auto add_string = [this, &information](GLenum name, wxString label) { @@ -79,7 +80,7 @@ SystemInformationDialog::SystemInformationDialog(wxWindow* parent, FilmViewer co : TableDialog (parent, _("System information"), 2, 1, false) { add (_("OpenGL version"), true); - add (_("OpenGL renderer not supported by this DCP-o-matic version"), false); + add(variant::wx::insert_dcpomatic(_("OpenGL renderer not supported by this %s version")), false); } #endif diff --git a/src/wx/try_unmount_dialog.cc b/src/wx/try_unmount_dialog.cc index ddfaec5c0..37d6e75fa 100644 --- a/src/wx/try_unmount_dialog.cc +++ b/src/wx/try_unmount_dialog.cc @@ -22,6 +22,7 @@ #include "static_text.h" #include "try_unmount_dialog.h" #include "wx_util.h" +#include "wx_variant.h" #include LIBDCP_DISABLE_WARNINGS #include @@ -32,14 +33,17 @@ static int constexpr width = 300; TryUnmountDialog::TryUnmountDialog (wxWindow* parent, wxString description) - : wxDialog (parent, wxID_ANY, _("DCP-o-matic Disk Writer")) + : wxDialog(parent, wxID_ANY, variant::wx::dcpomatic_disk_writer()) { auto sizer = new wxBoxSizer (wxVERTICAL); auto text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(width, -1)); sizer->Add (text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); text->SetLabelMarkup ( - wxString::Format(_("The drive %s is mounted.\n\nIt must be unmounted before DCP-o-matic can write to it.\n\nShould DCP-o-matic try to unmount it now?"), description) + wxString::Format( + _("The drive %s is mounted.\n\nIt must be unmounted before %s can write to it.\n\nShould DCP-o-matic try to unmount it now?"), + description, variant::wx::dcpomatic() + ) ); text->Wrap(width); diff --git a/src/wx/update_dialog.cc b/src/wx/update_dialog.cc index 0a7319704..7c687aa60 100644 --- a/src/wx/update_dialog.cc +++ b/src/wx/update_dialog.cc @@ -22,6 +22,7 @@ #include "static_text.h" #include "update_dialog.h" #include "wx_util.h" +#include "wx_variant.h" #include LIBDCP_DISABLE_WARNINGS #include @@ -40,9 +41,9 @@ UpdateDialog::UpdateDialog (wxWindow* parent, optional stable, optional< wxStaticText* message; if ((stable || test) && !(stable && test)) { - message = new StaticText (this, _("A new version of DCP-o-matic is available.")); + message = new StaticText(this, variant::wx::insert_dcpomatic(_("A new version of %s is available."))); } else { - message = new StaticText (this, _("New versions of DCP-o-matic are available.")); + message = new StaticText(this, variant::wx::insert_dcpomatic(_("New versions of %s are available."))); } overall_sizer->Add (message, 0, wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER); diff --git a/src/wx/wscript b/src/wx/wscript index eecc314a0..b37d26d6d 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -186,8 +186,9 @@ sources = """ video_view.cc video_waveform_dialog.cc video_waveform_plot.cc - wx_util.cc wx_signal_manager.cc + wx_util.cc + wx_variant.cc """ def configure(conf): diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 58bb4d5ea..49a3ca5c3 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -31,6 +31,7 @@ #include "static_text.h" #include "wx_ptr.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/cross.h" #include "lib/job.h" @@ -161,7 +162,7 @@ add_label_to_sizer (wxGridBagSizer* s, wxStaticText* t, bool, wxGBPosition pos, void error_dialog (wxWindow* parent, wxString m, optional e) { - auto d = make_wx(parent, m, _("DCP-o-matic"), wxOK | wxICON_ERROR); + auto d = make_wx(parent, m, variant::wx::dcpomatic(), wxOK | wxICON_ERROR); if (e) { wxString em = *e; em[0] = wxToupper (em[0]); @@ -178,7 +179,7 @@ error_dialog (wxWindow* parent, wxString m, optional e) void message_dialog (wxWindow* parent, wxString m) { - auto d = make_wx(parent, m, _("DCP-o-matic"), wxOK | wxICON_INFORMATION); + auto d = make_wx(parent, m, variant::wx::dcpomatic(), wxOK | wxICON_INFORMATION); d->ShowModal (); } @@ -187,7 +188,7 @@ message_dialog (wxWindow* parent, wxString m) bool confirm_dialog (wxWindow* parent, wxString m) { - auto d = make_wx(parent, m, _("DCP-o-matic"), wxYES_NO | wxICON_QUESTION); + auto d = make_wx(parent, m, variant::wx::dcpomatic(), wxYES_NO | wxICON_QUESTION); return d->ShowModal() == wxID_YES; } diff --git a/src/wx/wx_variant.cc b/src/wx/wx_variant.cc new file mode 100644 index 000000000..690e3a330 --- /dev/null +++ b/src/wx/wx_variant.cc @@ -0,0 +1,140 @@ +/* + Copyright (C) 2024 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + + +#include "wx_util.h" +#include "wx_variant.h" +#include "lib/variant.h" + + + +wxString +variant::wx::dcpomatic() +{ + return std_to_wx(variant::dcpomatic()); +} + +wxString +variant::wx::dcpomatic_batch_converter() +{ + return std_to_wx(variant::dcpomatic_batch_converter()); +} + +wxString +variant::wx::dcpomatic_combiner() +{ + return std_to_wx(variant::dcpomatic_combiner()); +} + +wxString +variant::wx::dcpomatic_disk_writer() +{ + return std_to_wx(variant::dcpomatic_disk_writer()); +} + +wxString +variant::wx::dcpomatic_editor() +{ + return std_to_wx(variant::dcpomatic_editor()); +} + +wxString +variant::wx::dcpomatic_encode_server() +{ + return std_to_wx(variant::dcpomatic_encode_server()); +} + +wxString +variant::wx::dcpomatic_kdm_creator() +{ + return std_to_wx(variant::dcpomatic_kdm_creator()); +} + +wxString +variant::wx::dcpomatic_player() +{ + return std_to_wx(variant::dcpomatic_player()); +} + +wxString +variant::wx::dcpomatic_playlist_editor() +{ + return std_to_wx(variant::dcpomatic_playlist_editor()); +} + +wxString +variant::wx::dcpomatic_verifier() +{ + return std_to_wx(variant::dcpomatic_verifier()); +} + +wxString +variant::wx::insert_dcpomatic(wxString const& s) +{ + return wxString::Format(s, dcpomatic()); +} + +wxString +variant::wx::insert_dcpomatic_batch_converter(wxString const& s) +{ + return wxString::Format(s, dcpomatic_batch_converter()); +} + +wxString +variant::wx::insert_dcpomatic_disk_writer(wxString const& s) +{ + return wxString::Format(s, dcpomatic_disk_writer()); +} + +wxString +variant::wx::insert_dcpomatic_editor(wxString const& s) +{ + return wxString::Format(s, dcpomatic_editor()); +} + +wxString +variant::wx::insert_dcpomatic_encode_server(wxString const& s) +{ + return wxString::Format(s, dcpomatic_encode_server()); +} + +wxString +variant::wx::insert_dcpomatic_kdm_creator(wxString const& s) +{ + return wxString::Format(s, dcpomatic_kdm_creator()); +} + +wxString +variant::wx::insert_dcpomatic_player(wxString const& s) +{ + return wxString::Format(s, dcpomatic_player()); +} + +wxString +variant::wx::insert_dcpomatic_playlist_editor(wxString const& s) +{ + return wxString::Format(s, dcpomatic_playlist_editor()); +} + +wxString +variant::wx::insert_dcpomatic_verifier(wxString const& s) +{ + return wxString::Format(s, dcpomatic_verifier()); +} diff --git a/src/wx/wx_variant.h b/src/wx/wx_variant.h new file mode 100644 index 000000000..0121c5b11 --- /dev/null +++ b/src/wx/wx_variant.h @@ -0,0 +1,52 @@ +/* + Copyright (C) 2024 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + + +#include + + +namespace variant { +namespace wx { + + +wxString dcpomatic(); +wxString dcpomatic_batch_converter(); +wxString dcpomatic_combiner(); +wxString dcpomatic_disk_writer(); +wxString dcpomatic_editor(); +wxString dcpomatic_encode_server(); +wxString dcpomatic_kdm_creator(); +wxString dcpomatic_player(); +wxString dcpomatic_playlist_editor(); +wxString dcpomatic_verifier(); + +wxString insert_dcpomatic(wxString const& s); +wxString insert_dcpomatic_batch_converter(wxString const& s); +wxString insert_dcpomatic_disk_writer(wxString const& s); +wxString insert_dcpomatic_editor(wxString const& s); +wxString insert_dcpomatic_encode_server(wxString const& s); +wxString insert_dcpomatic_kdm_creator(wxString const& s); +wxString insert_dcpomatic_player(wxString const& s); +wxString insert_dcpomatic_playlist_editor(wxString const& s); +wxString insert_dcpomatic_verifier(wxString const& s); + + +} +} -- cgit v1.2.3