Extract all uses of DCP-o-matic name to allow branding.
authorCarl Hetherington <cth@carlh.net>
Tue, 16 Apr 2024 20:19:39 +0000 (22:19 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 21 Apr 2024 20:07:15 +0000 (22:07 +0200)
55 files changed:
src/lib/analytics.cc
src/lib/config.cc
src/lib/create_cli.cc
src/lib/cross_osx.cc
src/lib/email.cc
src/lib/email.h
src/lib/encode_server.cc
src/lib/encode_server_finder.cc
src/lib/environment_info.cc
src/lib/ffmpeg_content.cc
src/lib/film.cc
src/lib/hints.cc
src/lib/job.cc
src/lib/kdm_cli.cc
src/lib/release_notes.cc
src/lib/send_problem_report_job.cc
src/lib/text_content.cc
src/lib/transcode_job.cc
src/lib/util.cc
src/lib/variant.cc [new file with mode: 0644]
src/lib/variant.h [new file with mode: 0644]
src/lib/wscript
src/tools/dcpomatic.cc
src/tools/dcpomatic_batch.cc
src/tools/dcpomatic_cli.cc
src/tools/dcpomatic_combiner.cc
src/tools/dcpomatic_disk.cc
src/tools/dcpomatic_editor.cc
src/tools/dcpomatic_kdm.cc
src/tools/dcpomatic_player.cc
src/tools/dcpomatic_playlist.cc
src/tools/dcpomatic_server.cc
src/tools/dcpomatic_server_cli.cc
src/tools/dcpomatic_verifier.cc
src/wx/about_dialog.cc
src/wx/audio_dialog.cc
src/wx/config_dialog.cc
src/wx/content_panel.cc
src/wx/content_view.cc
src/wx/disk_warning_dialog.cc
src/wx/dkdm_dialog.cc
src/wx/full_config_dialog.cc
src/wx/job_view.cc
src/wx/kdm_dialog.cc
src/wx/player_config_dialog.cc
src/wx/playlist_controls.cc
src/wx/playlist_editor_config_dialog.cc
src/wx/screens_panel.cc
src/wx/system_information_dialog.cc
src/wx/try_unmount_dialog.cc
src/wx/update_dialog.cc
src/wx/wscript
src/wx/wx_util.cc
src/wx/wx_variant.cc [new file with mode: 0644]
src/wx/wx_variant.h [new file with mode: 0644]

index 3fce7974923d639be1890d678848d8442cc5ab72..638f59f71ae1fdc74a739cbe775b8461bdb7a9dc 100644 (file)
@@ -22,6 +22,7 @@
 #include "analytics.h"
 #include "compose.hpp"
 #include "exceptions.h"
+#include "variant.h"
 #include <dcp/filesystem.h>
 #include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
@@ -61,17 +62,17 @@ Analytics::successful_dcp_encode ()
                        boost::bind(
                                boost::ref(Message),
                                _("Congratulations!"),
-                               String::compose (_(
-                                       "<h2>You have made %1 DCPs with DCP-o-matic!</h2>"
+                               String::compose(_(
+                                       "<h2>You have made %1 DCPs with %2!</h2>"
                                        "<img width=\"20%%\" src=\"memory:me.jpg\" align=\"center\">"
                                         "<p>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."
 
-                                       "<p>If you find DCP-o-matic useful, please consider a donation to the "
+                                       "<p>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!"
 
                                        "<p><ul>"
                                        "<li><a href=\"https://dcpomatic.com/donate_amount?amount=40\">Go to Paypal to donate €40</a>"
@@ -79,7 +80,12 @@ Analytics::successful_dcp_encode ()
                                        "<li><a href=\"https://dcpomatic.com/donate_amount?amount=10\">Go to Paypal to donate €10</a>"
                                        "</ul>"
 
-                                       "<p>Thank you!"), _successful_dcp_encodes
+                                       "<p>Thank you!"),
+                                       _successful_dcp_encodes,
+                                       variant::dcpomatic(),
+                                       variant::dcpomatic(),
+                                       variant::dcpomatic(),
+                                       variant::dcpomatic()
                                        )
                                )
                        );
index 21192ad30ce3078772dde7441ce297c8f8354fa4..fb7a413de710db00cda5eb004dbe8e884d02dbc7 100644 (file)
@@ -33,6 +33,7 @@
 #include "log.h"
 #include "ratio.h"
 #include "unzipper.h"
+#include "variant.h"
 #include "zipper.h"
 #include <dcp/certificate_chain.h>
 #include <dcp/name_format.h>
@@ -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"
index 1c2f2c6354fcf3ef4f2edf73096c9add9af39c22..cf903e376097fd684091f446f261ba883acfbc54 100644 (file)
@@ -26,6 +26,7 @@
 #include "dcpomatic_log.h"
 #include "film.h"
 #include "ratio.h"
+#include "variant.h"
 #include <dcp/raw_convert.h>
 #include <iostream>
 #include <string>
@@ -40,8 +41,8 @@ using boost::optional;
 
 
 string CreateCLI::_help =
-       "\nSyntax: %1 [OPTION] <CONTENT> [OPTION] [<CONTENT> ...]\n"
-       "  -v, --version                 show DCP-o-matic version\n"
+       string("\nSyntax: %1 [OPTION] <CONTENT> [OPTION] [<CONTENT> ...]\n") +
+       variant::insert_dcpomatic("  -v, --version                 show %1 version\n") +
        "  -h, --help                    show this help\n"
        "  -n, --name <name>             film name\n"
        "  -t, --template <name>         template name\n"
index 20fe9bce870b22bca53c3b6d104f46b9cee5d82c..6df2f959e5fdb390f3bae4a1da1b1932eb226cd0 100644 (file)
 */
 
 
-#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 <dcp/filesystem.h>
 #include <dcp/raw_convert.h>
 #include <glib.h>
@@ -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());
 }
 
 
index 8557b40e0c808cf06f2e10b3e5d32bebd4dd0261..bd17bdf5bca9bcd4f26bff278d623ceb20ea0973 100644 (file)
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "email.h"
 #include "exceptions.h"
+#include "variant.h"
 #include <curl/curl.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/date_time/c_local_time_adjustor.hpp>
@@ -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"
index 36398bfd804984f5f5179be77bc5b1a8581279c7..ac4703453437ca2100829195a6634b6bece8bb94 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 
+#include "types.h"
 #include <curl/curl.h>
 #include <boost/scoped_array.hpp>
 
index b9c907e050a6af4cb4221eb105db3717f2299e54..da5c7270e15be3c420529d0682d6870f44dd9a3f 100644 (file)
@@ -37,6 +37,7 @@
 #include "image.h"
 #include "log.h"
 #include "player_video.h"
+#include "variant.h"
 #include "version.h"
 #include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
@@ -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) {
index 1d4ced5951f01315306259a861bf2c5645b94aa5..9ce9e169128c0661dd6b28d2edb84ee620921ba7 100644 (file)
@@ -26,6 +26,7 @@
 #include "encode_server_description.h"
 #include "encode_server_finder.h"
 #include "exceptions.h"
+#include "variant.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <boost/bind/placeholders.hpp>
@@ -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 ();
index 2e0347c79dccb78bc282f7b6f42c2cbfadea3d54..d6592d126869aa88c1c4a7349499d74f21f38027 100644 (file)
@@ -22,6 +22,7 @@
 #include "compose.hpp"
 #include "cross.h"
 #include "log.h"
+#include "variant.h"
 #include "version.h"
 #include <dcp/version.h>
 #include <dcp/warnings.h>
@@ -85,7 +86,7 @@ environment_info ()
 {
        list<string> 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.");
index c80bdec69fef072cc2aa07f48e88a48aec73004b..c2bb5ffe4fa4ba30ff1f69709f037f3e5724e51b 100644 (file)
@@ -34,6 +34,7 @@
 #include "job.h"
 #include "log.h"
 #include "text_content.h"
+#include "variant.h"
 #include "video_content.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
@@ -118,7 +119,7 @@ FFmpegContent::FFmpegContent (cxml::ConstNodePtr node, int version, list<string>
                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()));
                }
        }
 
index a88e8a855573d62a270ccf9a2eb35a428b9df0aa..540d0b9b947af55e80b89183703c44845e763f05 100644 (file)
@@ -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 <libcxml/cxml.h>
@@ -507,7 +508,13 @@ Film::read_metadata (optional<boost::filesystem::path> 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<boost::filesystem::path> path)
 
        _state_version = f.number_child<int> ("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);
index bbd5ae5d594e5a3b1b81ac4f3ad1ab7bb4ba10ae..7a6a2a4bfce32fb5a3ad22939b0cfec1ed1446e5 100644 (file)
@@ -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 <dcp/cpl.h>
@@ -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 */
index 9e685ec114cee9d01fe95e998e009b8f59d64390..94c23aac68d2621c40c69b055d541dccda95cf6f 100644 (file)
@@ -33,6 +33,7 @@
 #include "job.h"
 #include "log.h"
 #include "util.h"
+#include "variant.h"
 #include <dcp/exceptions.h>
 #include <sub/exceptions.h>
 #include <boost/date_time/posix_time/posix_time.hpp>
@@ -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()
                                        )
index 651ba8e2616dc364478055cb73ab0d206f247a79..c442cacdc6ae6b818053822856044f179a2bec8e 100644 (file)
@@ -32,6 +32,7 @@
 #include "film.h"
 #include "kdm_with_metadata.h"
 #include "screen.h"
+#include "variant.h"
 #include <dcp/certificate.h>
 #include <dcp/decrypted_kdm.h>
 #include <dcp/encrypted_kdm.h>
@@ -60,9 +61,9 @@ help (std::function<void (string)> out)
        out (String::compose("Syntax: %1 [OPTION] [COMMAND] <FILM|CPL-ID|DKDM>", 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 <path>                      output file or directory");
        out ("  -K, --filename-format <format>           filename format for KDMs");
@@ -81,15 +82,15 @@ help (std::function<void (string)> out)
        out ("  -C, --projector-certificate <file>       file containing projector certificate");
        out ("  -T, --trusted-device-certificate <file>  file containing a trusted device's certificate");
        out ("      --decryption-key <file>              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 <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));
 }
index d697384277a418566544c32d87c7522db0315ac5..b12ebc0302b37891d3e1a8e301643ca580064118 100644 (file)
@@ -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<string> current)
        string const colour = dark ? "white" : "black";
        auto const span = String::compose("<span style=\"color: %1\">", colour);
 
-       const string header = String::compose("<h1>%1DCP-o-matic %2 release notes</span></h1>", span, *current);
+       const string header = String::compose("<h1>%1%2 %3 release notes</span></h1>", span, variant::dcpomatic(), *current);
 
        if (!last) {
                return header + span +
index 9569aca3b968d6299b36e38e601162b16ded6e17..ed78112e9ea5765eea15b84c768eeb6686d3c49d 100644 (file)
 */
 
 
-#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 <libxml++/libxml++.h>
 
 #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);
index cfdaabcbc0bdf24e3bf133052d842563c4837e40..03336f15dd8c01a29f10e10581f813e0783e6536 100644 (file)
 */
 
 
-#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 <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #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;
index b260bc44b1d852c5c23ce0870a7a3c2594a2318f..ba420ab94f466a8aff684f55dc110c019a13edc4 100644 (file)
@@ -37,6 +37,7 @@
 #include "log.h"
 #include "transcode_job.h"
 #include "upload_job.h"
+#include "variant.h"
 #include <iomanip>
 #include <iostream>
 
@@ -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:
index ef15b90e5b1c4fea79837a814ccce69df84d2017..60117f61ddeeb8a4425c2bdea29bf7389a9e91b6 100644 (file)
@@ -49,6 +49,7 @@
 #include "string_text.h"
 #include "text_decoder.h"
 #include "util.h"
+#include "variant.h"
 #include "video_content.h"
 #include <dcp/atmos_asset.h>
 #include <dcp/decrypted_kdm.h>
@@ -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 (file)
index 0000000..e69d940
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+    Copyright (C) 2024 Carl Hetherington <cth@carlh.net>
+
+    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 <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#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 (file)
index 0000000..66b0637
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+    Copyright (C) 2024 Carl Hetherington <cth@carlh.net>
+
+    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 <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#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();
+
+}
+
index 878b503a8b8aa0504226d88b19d6f07022dcbeca..4eeeb578ed934dccd9c17a1579ee81a38798c728 100644 (file)
@@ -206,6 +206,7 @@ sources = """
           upmixer_b.cc
           usl.cc
           util.cc
+          variant.cc
           verify_dcp_job.cc
           video_content.cc
           video_decoder.cc
index d516c6f5bea3c41ca8728139f0cbfb9a74314fd7..5f723ba0f89940d19f7b65a2ef3dfe66bf340b0a 100644 (file)
@@ -57,6 +57,7 @@
 #include "wx/video_waveform_dialog.h"
 #include "wx/wx_signal_manager.h"
 #include "wx/wx_util.h"
+#include "wx/wx_variant.h"
 #include "lib/analytics.h"
 #include "lib/audio_content.h"
 #include "lib/check_content_job.h"
@@ -94,6 +95,7 @@
 #include "lib/text_content.h"
 #include "lib/transcode_job.h"
 #include "lib/update_checker.h"
+#include "lib/variant.h"
 #include "lib/version.h"
 #include "lib/video_content.h"
 #include <dcp/exceptions.h>
@@ -490,8 +492,10 @@ public:
                auto const dir = e.file().parent_path();
                if (dcp::filesystem::exists(dir / "ASSETMAP") || dcp::filesystem::exists(dir / "ASSETMAP.xml")) {
                        error_dialog (
-                               this, _("Could not open this folder as a DCP-o-matic project."),
-                               _("It looks like you are trying to open a DCP.  File -> Open is for loading DCP-o-matic projects, not DCPs.  To import a DCP, create a new project with File -> New and then click the \"Add DCP...\" button.")
+                               this, variant::wx::insert_dcpomatic(_("Could not open this folder as a %s project.")),
+                               variant::wx::insert_dcpomatic(
+                                       _("It looks like you are trying to open a DCP.  File -> Open is for loading %s projects, not DCPs.  "
+                                         "To import a DCP, create a new project with File -> New and then click the \"Add DCP...\" button."))
                                );
                } else {
                        auto const p = std_to_wx(file.string ());
@@ -575,7 +579,7 @@ private:
                        if (!found_bad_chars.empty()) {
                                message += wxString::Format (_("Try removing the %s characters from your folder name."), std_to_wx(found_bad_chars).data());
                        } else {
-                               message += _("Please check that you do not have Windows controlled folder access enabled for DCP-o-matic.");
+                               message += variant::wx::insert_dcpomatic(_("Please check that you do not have Windows controlled folder access enabled for %s."));
                        }
                        error_dialog (this, message, std_to_wx(e.what()));
 #else
@@ -1143,10 +1147,15 @@ private:
                        body += i.first + "\n" + i.second + "\n\n";
                }
                if (dialog.email().find("@") == string::npos) {
-                       error_dialog (this, _("You must enter a valid email address when sending translations, "
-                                             "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions."));
+                       error_dialog(
+                               this,
+                               variant::wx::insert_dcpomatic(
+                                       _("You must enter a valid email address when sending translations, "
+                                         "otherwise the %s maintainers cannot credit you or contact you with questions.")
+                                       )
+                               );
                } else {
-                       Email email(dialog.email(), { "carl@dcpomatic.com" }, "DCP-o-matic translations", body);
+                       Email email(dialog.email(), { "carl@dcpomatic.com" }, variant::insert_dcpomatic("%1 translations"), body);
                        try {
                                email.send("main.carlh.net", 2525, EmailProtocol::STARTTLS);
                        } catch (NetworkError& e) {
@@ -1403,7 +1412,7 @@ private:
                add_item (jobs_menu, _("Make &KDMs...\tCtrl-K"), ID_jobs_make_kdms, NEEDS_FILM);
                /* [Shortcut] Ctrl+D:Make DKDMs */
                add_item (jobs_menu, _("Make &DKDMs...\tCtrl-D"), ID_jobs_make_dkdms, NEEDS_FILM);
-               add_item (jobs_menu, _("Make DKDM for DCP-o-matic..."), ID_jobs_make_self_dkdm, NEEDS_FILM | NEEDS_ENCRYPTION);
+               add_item(jobs_menu, variant::wx::insert_dcpomatic(_("Make DKDM for %s...")), ID_jobs_make_self_dkdm, NEEDS_FILM | NEEDS_ENCRYPTION);
                jobs_menu->AppendSeparator ();
                /* [Shortcut] Ctrl+E:Export video file */
                add_item (jobs_menu, _("Export video file...\tCtrl-E"), ID_jobs_export_video_file, NEEDS_FILM);
@@ -1441,7 +1450,7 @@ private:
 
                wxMenu* help = new wxMenu;
 #ifdef __WXOSX__
-               add_item (help, _("About DCP-o-matic"), wxID_ABOUT, ALWAYS);
+               add_item(help, variant::wx::insert_dcpomatic(_("About %s")), wxID_ABOUT, ALWAYS);
 #else
                add_item (help, _("About"), wxID_ABOUT, ALWAYS);
 #endif
@@ -1559,9 +1568,9 @@ private:
                        UpdateDialog dialog(this, uc->stable(), uc->test());
                        dialog.ShowModal();
                } else if (uc->state() == UpdateChecker::State::FAILED) {
-                       error_dialog (this, _("The DCP-o-matic download server could not be contacted."));
+                       error_dialog(this, variant::wx::insert_dcpomatic(_("The %s download server could not be contacted.")));
                } else {
-                       error_dialog (this, _("There are no new versions of DCP-o-matic available."));
+                       error_dialog(this, variant::wx::insert_dcpomatic(_("There are no new versions of %s available.")));
                }
 
                _update_news_requested = false;
@@ -1599,7 +1608,7 @@ private:
 
        void set_title ()
        {
-               auto s = wx_to_std(_("DCP-o-matic"));
+               auto s = variant::dcpomatic();
                if (_film) {
                        if (_film->directory()) {
                                s += " - " + _film->directory()->string();
@@ -1643,7 +1652,7 @@ static const wxCmdLineEntryDesc command_line_description[] = {
        { wxCMD_LINE_SWITCH, "n", "new", "create new film", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_OPTION, "c", "content", "add content file / directory", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_OPTION, "d", "dcp", "add content DCP", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
-       { wxCMD_LINE_SWITCH, "v", "version", "show DCP-o-matic version", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
+       { wxCMD_LINE_SWITCH, "v", "version", "show version", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_OPTION, "", "config", "directory containing config.xml and cinemas.xml", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_PARAM, 0, 0, "film to load or create", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 }
@@ -1687,7 +1696,7 @@ private:
                        setvbuf(hf_in, NULL, _IONBF, 128);
                        *stdin = *hf_in;
 
-                       cout << "DCP-o-matic is starting." << "\n";
+                       cout << variant::insert_dcpomatic("%1 is starting.") << "\n";
                }
 #endif
                        wxInitAllImageHandlers ();
@@ -1697,7 +1706,7 @@ private:
 
                        _splash = maybe_show_splash ();
 
-                       SetAppName (_("DCP-o-matic"));
+                       SetAppName(variant::wx::dcpomatic());
 
                        if (!wxApp::OnInit()) {
                                return false;
@@ -1736,7 +1745,7 @@ private:
                        */
                        Config::Bad.connect (boost::bind(&App::config_bad, this, _1));
 
-                       _frame = new DOMFrame (_("DCP-o-matic"));
+                       _frame = new DOMFrame(variant::wx::dcpomatic());
                        SetTopWindow (_frame);
                        _frame->Maximize ();
                        close_splash ();
@@ -1744,7 +1753,14 @@ private:
                        if (running_32_on_64 ()) {
                                NagDialog::maybe_nag (
                                        _frame, Config::NAG_32_ON_64,
-                                       _("You are running the 32-bit version of DCP-o-matic on a 64-bit version of Windows.  This will limit the memory available to DCP-o-matic and may cause errors.  You are strongly advised to install the 64-bit version of DCP-o-matic."),
+                                       wxString::Format(
+                                               _("You are running the 32-bit version of %s on a 64-bit version of Windows.  "
+                                                 "This will limit the memory available to %s and may cause errors.  You are "
+                                                 "strongly advised to install the 64-bit version of %s."),
+                                               variant::wx::dcpomatic(),
+                                               variant::wx::dcpomatic(),
+                                               variant::wx::dcpomatic()
+                                               ),
                                        false);
                        }
 
@@ -1796,7 +1812,7 @@ private:
                catch (exception& e)
                {
                        close_splash();
-                       error_dialog (nullptr, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what()));
+                       error_dialog(nullptr, variant::wx::insert_dcpomatic(_("%s could not start.")), std_to_wx(e.what()));
                }
 
                return true;
@@ -1939,9 +1955,11 @@ private:
                        }
                        RecreateChainDialog dialog(
                                _frame, _("Recreate signing certificates"),
-                               _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error\n"
-                                 "which will prevent DCPs from being validated correctly on some systems.  Do you want to re-create\n"
-                                 "the certificate chain for signing DCPs and KDMs?"),
+                               variant::wx::insert_dcpomatic(
+                                       _("The certificate chain that %s uses for signing DCPs and KDMs contains a small error\n"
+                                         "which will prevent DCPs from being validated correctly on some systems.  Do you want to re-create\n"
+                                         "the certificate chain for signing DCPs and KDMs?")
+                                       ),
                                _("Do nothing"),
                                Config::NAG_BAD_SIGNER_CHAIN_UTF8
                                );
@@ -1954,9 +1972,11 @@ private:
                        }
                        RecreateChainDialog dialog(
                                _frame, _("Recreate signing certificates"),
-                               _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs has a validity period\n"
-                                 "that is too long.  This will cause problems playing back DCPs on some systems.\n"
-                                 "Do you want to re-create the certificate chain for signing DCPs and KDMs?"),
+                               variant::wx::insert_dcpomatic(
+                                       _("The certificate chain that %s uses for signing DCPs and KDMs has a validity period\n"
+                                         "that is too long.  This will cause problems playing back DCPs on some systems.\n"
+                                         "Do you want to re-create the certificate chain for signing DCPs and KDMs?")
+                                       ),
                                _("Do nothing"),
                                Config::NAG_BAD_SIGNER_CHAIN_VALIDITY
                                );
@@ -1966,10 +1986,14 @@ private:
                {
                        RecreateChainDialog dialog(
                                _frame, _("Recreate signing certificates"),
-                               _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs is inconsistent and\n"
-                                 "cannot be used.  DCP-o-matic cannot start unless you re-create it.  Do you want to re-create\n"
-                                 "the certificate chain for signing DCPs and KDMs?"),
-                               _("Close DCP-o-matic")
+                               wxString::Format(
+                                       _("The certificate chain that %s uses for signing DCPs and KDMs is inconsistent and\n"
+                                         "cannot be used.  %s cannot start unless you re-create it.  Do you want to re-create\n"
+                                         "the certificate chain for signing DCPs and KDMs?"),
+                                       variant::wx::dcpomatic(),
+                                       variant::wx::dcpomatic()
+                                       ),
+                               variant::wx::insert_dcpomatic(_("Close %s"))
                                );
                        if (dialog.ShowModal() != wxID_OK) {
                                exit (EXIT_FAILURE);
@@ -1980,11 +2004,15 @@ private:
                {
                        RecreateChainDialog dialog(
                                _frame, _("Recreate KDM decryption chain"),
-                               _("The certificate chain that DCP-o-matic uses for decrypting KDMs is inconsistent and\n"
-                                 "cannot be used.  DCP-o-matic cannot start unless you re-create it.  Do you want to re-create\n"
-                                 "the certificate chain for decrypting KDMs?  You may want to say \"No\" here and back up your\n"
-                                 "configuration before continuing."),
-                               _("Close DCP-o-matic")
+                               wxString::Format(
+                                       _("The certificate chain that %s uses for decrypting KDMs is inconsistent and\n"
+                                         "cannot be used.  %s cannot start unless you re-create it.  Do you want to re-create\n"
+                                         "the certificate chain for decrypting KDMs?  You may want to say \"No\" here and back up your\n"
+                                         "configuration before continuing."),
+                                       variant::wx::dcpomatic(),
+                                       variant::wx::dcpomatic()
+                                       ),
+                               variant::wx::insert_dcpomatic(_("Close %s"))
                                );
                        if (dialog.ShowModal() != wxID_OK) {
                                exit (EXIT_FAILURE);
@@ -1995,10 +2023,14 @@ private:
                {
                        RecreateChainDialog dialog(
                                _frame, _("Recreate signing certificates"),
-                               _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error\n"
-                                 "which will prevent DCPs from being validated correctly on some systems.  This error was caused\n"
-                                 "by a bug in DCP-o-matic which has now been fixed. Do you want to re-create the certificate chain\n"
-                                 "for signing DCPs and KDMs?"),
+                               wxString::Format(
+                                       _("The certificate chain that %s uses for signing DCPs and KDMs contains a small error\n"
+                                         "which will prevent DCPs from being validated correctly on some systems.  This error was caused\n"
+                                         "by a bug in %s which has now been fixed. Do you want to re-create the certificate chain\n"
+                                         "for signing DCPs and KDMs?"),
+                                       variant::wx::dcpomatic(),
+                                       variant::wx::dcpomatic()
+                                       ),
                                _("Do nothing"),
                                Config::NAG_BAD_SIGNER_DN_QUALIFIER
                                );
index 1e383b39a5ecdafc516532308c85fc0638f4acf0..0a228b93324cbf5fbfe0783609d4f140688bfc52 100644 (file)
@@ -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);
index c2e7ee76cf3c35860c7ab8982c19e0b5dcfbc0ae..c087f89e796d03b1f77fe0af123005670c8a35d8 100644 (file)
@@ -40,6 +40,7 @@
 #include "lib/signal_manager.h"
 #include "lib/transcode_job.h"
 #include "lib/util.h"
+#include "lib/variant.h"
 #include "lib/version.h"
 #include "lib/video_content.h"
 #include <dcp/filesystem.h>
@@ -66,7 +67,7 @@ static void
 help (string n)
 {
        cerr << "Syntax: " << n << " [OPTION] [<FILM>]\n"
-            << "  -v, --version                     show DCP-o-matic version\n"
+            << variant::insert_dcpomatic("  -v, --version                     show %1 version\n")
             << "  -h, --help                        show this help\n"
             << "  -f, --flags                       show flags passed to C++ compiler on build\n"
             << "  -n, --no-progress                 do not print progress to stdout\n"
@@ -75,7 +76,7 @@ help (string n)
             << "  -j, --json <port>                 run a JSON server on the specified port\n"
             << "  -k, --keep-going                  keep running even when the job is complete\n"
             << "  -s, --servers <file>              specify servers to use in a text file\n"
-            << "  -l, --list-servers                just display a list of encoding servers that DCP-o-matic is configured to use; don't encode\n"
+            << variant::insert_dcpomatic("  -l, --list-servers                just display a list of encoding servers that %1 is configured to use; don't encode\n")
             << "  -d, --dcp-path                    echo DCP's path to stdout on successful completion (implies -n)\n"
             << "  -c, --config <dir>                directory containing config.xml and cinemas.xml\n"
             << "      --dump                        just dump a summary of the film's settings; don't encode\n"
index c135184e6a7f04a5ce1eb94b45e1456cec0d3012..6588b23b483f9db96d166a705d942c7226505d6d 100644 (file)
@@ -23,6 +23,8 @@
 #include "wx/dir_picker_ctrl.h"
 #include "wx/editable_list.h"
 #include "wx/wx_signal_manager.h"
+#include "wx/wx_util.h"
+#include "wx/wx_variant.h"
 #include "lib/combine_dcp_job.h"
 #include "lib/config.h"
 #include "lib/constants.h"
@@ -175,7 +177,7 @@ private:
 
                auto jm = JobManager::instance ();
                jm->add (make_shared<CombineDCPJob>(_inputs, output, wx_to_std(_annotation_text->GetValue())));
-               bool const ok = display_progress(_("DCP-o-matic Combiner"), _("Combining DCPs"));
+               bool const ok = display_progress(variant::wx::dcpomatic_combiner(), _("Combining DCPs"));
                if (!ok) {
                        return;
                }
@@ -219,7 +221,7 @@ public:
                        Config::FailedToLoad.connect(boost::bind(&App::config_failed_to_load, this, _1));
                        Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
 
-                       SetAppName (_("DCP-o-matic Combiner"));
+                       SetAppName(variant::wx::dcpomatic_combiner());
 
                        if (!wxApp::OnInit()) {
                                return false;
@@ -253,7 +255,7 @@ public:
                        */
                        Config::drop ();
 
-                       _frame = new DOMFrame(_("DCP-o-matic Combiner"));
+                       _frame = new DOMFrame(variant::wx::dcpomatic_combiner());
                        SetTopWindow (_frame);
 
                        _frame->Show ();
@@ -263,7 +265,7 @@ public:
                }
                catch (exception& e)
                {
-                       error_dialog(nullptr, wxString::Format("DCP-o-matic Combiner could not start."), std_to_wx(e.what()));
+                       error_dialog(nullptr, wxString::Format(_("%s could not start (%s)"), variant::wx::dcpomatic_combiner()), std_to_wx(e.what()));
                        return false;
                }
 
index 0cc7ccbcd0961b1f8b1b2db2564431ecffb8399e..cd07f935d227f4793c4b37da0cecd8042181fce5 100644 (file)
@@ -29,6 +29,7 @@
 #include "wx/wx_util.h"
 #include "wx/wx_signal_manager.h"
 #include "wx/wx_util.h"
+#include "wx/wx_variant.h"
 #include "lib/config.h"
 #include "lib/constants.h"
 #include "lib/copy_to_drive_job.h"
@@ -325,7 +326,7 @@ private:
 #if defined(DCPOMATIC_WINDOWS)
                        auto m = make_wx<MessageDialog>(
                                this,
-                               _("DCP-o-matic Disk Writer"),
+                               variant::wx::dcpomatic_disk_writer(),
                                _("Do you see a 'User Account Control' dialogue asking about dcpomatic2_disk_writer.exe?  If so, click 'Yes', then try again.")
                                );
                        m->ShowModal ();
@@ -333,8 +334,8 @@ private:
 #elif defined(DCPOMATIC_OSX)
                        auto m = make_wx<MessageDialog>(
                                this,
-                               _("DCP-o-matic Disk Writer"),
-                               _("Did you install the DCP-o-matic Disk Writer.pkg from the .dmg?  Please check and try again.")
+                               variant::wx::dcpomatic_disk_writer(),
+                               variant::wx::insert_dcpomatic(_("Did you install the %s Disk Writer.pkg from the .dmg?  Please check and try again."))
                                );
                        m->ShowModal ();
                        return;
@@ -366,7 +367,7 @@ private:
                        if (!reply || reply->type() != DiskWriterBackEndResponse::Type::OK) {
                                auto m = make_wx<MessageDialog>(
                                                this,
-                                               _("DCP-o-matic Disk Writer"),
+                                               variant::wx::dcpomatic_disk_writer(),
                                                wxString::Format(
                                                        _("The drive %s could not be unmounted.\nClose any application that is using it, then try again. (%s)"),
                                                        std_to_wx(drive.description()),
@@ -454,7 +455,7 @@ public:
                        Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
                        Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
 
-                       SetAppName (_("DCP-o-matic Disk Writer"));
+                       SetAppName(variant::wx::dcpomatic_disk_writer());
 
                        if (!wxApp::OnInit()) {
                                return false;
@@ -495,12 +496,17 @@ public:
                                        return false;
                                }
                                if (!warning->confirmed()) {
-                                       message_dialog(nullptr, _("You did not correctly confirm that you read the warning that was just shown.  DCP-o-matic Disk Writer will close now.  Please try again."));
+                                       message_dialog(
+                                               nullptr,
+                                               variant::wx::insert_dcpomatic_disk_writer(
+                                                       _("You did not correctly confirm that you read the warning that was just shown.  %s will close now.  Please try again.")
+                                                       )
+                                               );
                                        return false;
                                }
                        }
 
-                       _frame = new DOMFrame (_("DCP-o-matic Disk Writer"));
+                       _frame = new DOMFrame(variant::wx::dcpomatic_disk_writer());
                        SetTopWindow (_frame);
 
                        _frame->Show ();
@@ -514,7 +520,7 @@ public:
                }
                catch (exception& e)
                {
-                       error_dialog (0, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what()));
+                       error_dialog(nullptr, wxString::Format(_("%s could not start"), variant::wx::dcpomatic_disk_writer()), std_to_wx(e.what()));
                        return false;
                }
 
index 14ff6da7f04129f8188cb70d9d7e01ee337966a3..e1f541fe820a4c059ed720561a498ecb431dfe60 100644 (file)
 #include "wx/id.h"
 #include "wx/wx_signal_manager.h"
 #include "wx/wx_util.h"
+#include "wx/wx_variant.h"
 #include "lib/constants.h"
 #include "lib/cross.h"
 #include "lib/dcpomatic_log.h"
 #include "lib/null_log.h"
+#include "lib/variant.h"
 #include <dcp/cpl.h>
 #include <dcp/dcp.h>
 #include <dcp/reel.h>
@@ -290,14 +292,14 @@ class DOMFrame : public wxFrame
 {
 public:
        DOMFrame ()
-               : wxFrame(nullptr, -1, _("DCP-o-matic Editor"))
+               : wxFrame(nullptr, -1, variant::wx::dcpomatic_editor())
                , _main_sizer(new wxBoxSizer(wxVERTICAL))
        {
                dcpomatic_log = make_shared<NullLog>();
 
 #if defined(DCPOMATIC_WINDOWS)
                maybe_open_console();
-               std::cout << "DCP-o-matic Editor is starting." << "\n";
+               std::cout << variant::dcpomatic_editor() << " is starting." << "\n";
 #endif
 
                auto bar = new wxMenuBar;
@@ -360,7 +362,7 @@ private:
 
                auto help = new wxMenu;
 #ifdef __WXOSX__
-               help->Append (wxID_ABOUT, _("About DCP-o-matic"));
+               help->Append(wxID_ABOUT, variant::wx::insert_dcpomatic_editor(_("About %s")));
 #else
                help->Append (wxID_ABOUT, _("About"));
 #endif
@@ -444,7 +446,7 @@ private:
 
                        splash = maybe_show_splash ();
 
-                       SetAppName (_("DCP-o-matic Editor"));
+                       SetAppName(variant::wx::dcpomatic_editor());
 
                        if (!wxApp::OnInit()) {
                                return false;
@@ -495,7 +497,7 @@ private:
                        if (splash) {
                                splash->Destroy ();
                        }
-                       error_dialog (0, _("DCP-o-matic Editor could not start."), std_to_wx(e.what()));
+                       error_dialog(nullptr, variant::wx::insert_dcpomatic_editor(_("%s could not start.")), std_to_wx(e.what()));
                }
 
                return true;
index 9adef0ab016ec42a228a2f28900bd30a606dfd54..d6c8b39459a4a63faebc0fb5a4e25231c976e762 100644 (file)
@@ -37,6 +37,7 @@
 #include "wx/static_text.h"
 #include "wx/wx_signal_manager.h"
 #include "wx/wx_util.h"
+#include "wx/wx_variant.h"
 #include "lib/cinema.h"
 #include "lib/collator.h"
 #include "lib/compose.hpp"
@@ -52,6 +53,7 @@
 #include "lib/kdm_with_metadata.h"
 #include "lib/screen.h"
 #include "lib/send_kdm_email_job.h"
+#include "lib/variant.h"
 #include <dcp/encrypted_kdm.h>
 #include <dcp/decrypted_kdm.h>
 #include <dcp/exceptions.h>
@@ -125,7 +127,7 @@ public:
                        setvbuf(hf_in, NULL, _IONBF, 128);
                        *stdin = *hf_in;
 
-                       std::cout << "DCP-o-matic KDM creator is starting." << "\n";
+                       std::cout << variant::insert_dcpomatic_kdm_creator("%1 is starting.\n");
                }
 #endif
 
@@ -302,7 +304,7 @@ private:
 
                wxMenu* help = new wxMenu;
 #ifdef __WXOSX__
-               help->Append (wxID_ABOUT, _("About DCP-o-matic"));
+               help->Append(wxID_ABOUT, variant::wx::insert_dcpomatic_kdm_creator(_("About %s")));
 #else
                help->Append (wxID_ABOUT, _("About"));
 #endif
@@ -460,7 +462,13 @@ private:
                        if (e.starts_too_early()) {
                                error_dialog(this, _("The KDM start period is before (or close to) the start of the signing certificate's validity period.  Use a later start time for this KDM."));
                        } else {
-                               error_dialog(this, _("The KDM end period is after (or close to) the end of the signing certificates' validity period.  Either use an earlier end time for this KDM or re-create your signing certificates in the DCP-o-matic preferences window."));
+                               error_dialog(
+                                       this,
+                                       variant::wx::insert_dcpomatic_kdm_creator(
+                                               _("The KDM end period is after (or close to) the end of the signing certificates' validity period.  "
+                                                 "Either use an earlier end time for this KDM or re-create your signing certificates in the %s preferences window.")
+                                               )
+                                       );
                        }
                        return;
                } catch (dcp::NotEncryptedError& e) {
@@ -841,7 +849,7 @@ private:
 
                        splash = maybe_show_splash ();
 
-                       SetAppName (_("DCP-o-matic KDM Creator"));
+                       SetAppName(variant::wx::dcpomatic_kdm_creator());
 
                        if (!wxApp::OnInit()) {
                                return false;
@@ -875,7 +883,7 @@ private:
                        */
                        Config::drop ();
 
-                       _frame = new DOMFrame (_("DCP-o-matic KDM Creator"));
+                       _frame = new DOMFrame(variant::wx::dcpomatic_kdm_creator());
                        SetTopWindow (_frame);
                        _frame->Maximize ();
                        if (splash) {
@@ -892,7 +900,7 @@ private:
                        if (splash) {
                                splash->Destroy ();
                        }
-                       error_dialog (0, _("DCP-o-matic could not start"), std_to_wx(e.what()));
+                       error_dialog(nullptr, variant::wx::insert_dcpomatic_kdm_creator(_("%s could not start")), std_to_wx(e.what()));
                }
 
                return true;
index 1ed604a1b9e7f83355f62f29b0bfaf350b21aea4..dec07d4a8734e9adefcd7cdb00f1d0e2e9503746 100644 (file)
@@ -37,6 +37,7 @@
 #include "wx/wx_ptr.h"
 #include "wx/wx_signal_manager.h"
 #include "wx/wx_util.h"
+#include "wx/wx_variant.h"
 #include "lib/compose.hpp"
 #include "lib/config.h"
 #include "lib/constants.h"
@@ -64,6 +65,7 @@
 #include "lib/server.h"
 #include "lib/text_content.h"
 #include "lib/update_checker.h"
+#include "lib/variant.h"
 #include "lib/verify_dcp_job.h"
 #include "lib/video_content.h"
 #include <dcp/cpl.h>
@@ -198,7 +200,7 @@ public:
 
 
        DOMFrame ()
-               : wxFrame (nullptr, -1, _("DCP-o-matic Player"))
+               : wxFrame(nullptr, -1, variant::wx::dcpomatic_player())
                , _mode (Config::instance()->player_mode())
                /* Use a panel as the only child of the Frame so that we avoid
                   the dark-grey background on Windows.
@@ -211,7 +213,7 @@ public:
 
 #if defined(DCPOMATIC_WINDOWS)
                maybe_open_console ();
-               cout << "DCP-o-matic Player is starting." << "\n";
+               cout << variant::dcpomatic_player() << " is starting." << "\n";
 #endif
 
                auto bar = new wxMenuBar;
@@ -398,7 +400,7 @@ public:
                        auto job = make_shared<ExamineContentJob>(_film, dcp);
                        _examine_job_connection = job->Finished.connect(bind(&DOMFrame::add_dcp_to_film, this, weak_ptr<Job>(job), weak_ptr<Content>(dcp)));
                        JobManager::instance()->add (job);
-                       bool const ok = display_progress (_("DCP-o-matic Player"), _("Loading content"));
+                       bool const ok = display_progress(variant::wx::dcpomatic_player(), _("Loading content"));
                        if (!ok || !report_errors_from_last_job(this)) {
                                return;
                        }
@@ -410,10 +412,12 @@ public:
                        error_dialog (
                                this,
                                wxString::Format(_("Could not load a DCP from %s"), std_to_wx(dir.string())),
-                               _(
-                                       "This looks like a DCP-o-matic project folder, which cannot be loaded into the player.  "
-                                       "Choose the DCP folder inside the DCP-o-matic project folder if that's what you want to play."
-                                )
+                               wxString::Format(
+                                       _("This looks like a %s project folder, which cannot be loaded into the player.  "
+                                         "Choose the DCP folder inside the %s project folder if that's what you want to play."),
+                                       variant::wx::dcpomatic(),
+                                       variant::wx::dcpomatic()
+                                       )
                                );
                } catch (dcp::ReadError& e) {
                        error_dialog (this, wxString::Format(_("Could not load a DCP from %s"), std_to_wx(dir.string())), std_to_wx(e.what()));
@@ -609,7 +613,7 @@ private:
 
                auto help = new wxMenu;
 #ifdef __WXOSX__
-               help->Append (wxID_ABOUT, _("About DCP-o-matic"));
+               help->Append(wxID_ABOUT, variant::wx::insert_dcpomatic_player(_("About %s")));
 #else
                help->Append (wxID_ABOUT, _("About"));
 #endif
@@ -682,7 +686,7 @@ private:
                        DCPOMATIC_ASSERT (dcp);
                        dcp->add_ov (wx_to_std(c->GetPath()));
                        JobManager::instance()->add(make_shared<ExamineContentJob>(_film, dcp));
-                       bool const ok = display_progress (_("DCP-o-matic Player"), _("Loading content"));
+                       bool const ok = display_progress(variant::wx::dcpomatic_player(), _("Loading content"));
                        if (!ok || !report_errors_from_last_job(this)) {
                                return;
                        }
@@ -927,7 +931,7 @@ private:
                DCPOMATIC_ASSERT (dcp);
 
                auto job = make_shared<VerifyDCPJob>(dcp->directories(), _kdms);
-               VerifyDCPProgressDialog progress(this, _("DCP-o-matic Player"));
+               VerifyDCPProgressDialog progress(this, variant::wx::dcpomatic_player());
                bool const completed = progress.run(job);
                progress.Close();
 
@@ -991,9 +995,9 @@ private:
                        auto dialog = make_wx<UpdateDialog>(this, uc->stable (), uc->test ());
                        dialog->ShowModal ();
                } else if (uc->state() == UpdateChecker::State::FAILED) {
-                       error_dialog (this, _("The DCP-o-matic download server could not be contacted."));
+                       error_dialog(this, variant::wx::insert_dcpomatic(_("The %s download server could not be contacted.")));
                } else {
-                       error_dialog (this, _("There are no new versions of DCP-o-matic available."));
+                       error_dialog(this, variant::wx::insert_dcpomatic(_("There are no new versions of %s available.")));
                }
 
                _update_news_requested = false;
@@ -1205,7 +1209,7 @@ private:
 
                        splash = maybe_show_splash ();
 
-                       SetAppName (_("DCP-o-matic Player"));
+                       SetAppName(variant::wx::dcpomatic_player());
 
                        if (!wxApp::OnInit()) {
                                return false;
@@ -1287,7 +1291,7 @@ private:
                        if (splash) {
                                splash->Destroy ();
                        }
-                       error_dialog (0, _("DCP-o-matic Player could not start."), std_to_wx(e.what()));
+                       error_dialog(nullptr, variant::wx::insert_dcpomatic_player(_("%s could not start")), std_to_wx(e.what()));
                }
 
                return true;
index b16a2be68338ed85a0195e8d174f49e4d3d120c0..56cf07413d9010c78d46e65c5a5f420a984e745e 100644 (file)
@@ -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;
        }
 
index 622704d2167cd7952452ea861b7b08decd738c22..5aad282fddae7c4f365ec6ad984f554a14cd6527 100644 (file)
@@ -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 ();
                }
        }
index 8997bb92c4bf53ba079ade8e9349ef61818ab5c7..25fe59fc7d289160da89a23000978f9e46696c62 100644 (file)
 
 */
 
+#include "lib/config.h"
 #include "lib/config.h"
 #include "lib/dcp_video.h"
+#include "lib/dcpomatic_log.h"
+#include "lib/encode_server.h"
 #include "lib/exceptions.h"
-#include "lib/util.h"
-#include "lib/config.h"
-#include "lib/image.h"
 #include "lib/file_log.h"
 #ifdef DCPOMATIC_GROK
 #include "lib/grok/context.h"
 #endif
+#include "lib/image.h"
 #include "lib/null_log.h"
+#include "lib/util.h"
+#include "lib/variant.h"
 #include "lib/version.h"
-#include "lib/encode_server.h"
-#include "lib/dcpomatic_log.h"
+#include <boost/algorithm/string.hpp>
 #include <boost/array.hpp>
 #include <boost/asio.hpp>
-#include <boost/algorithm/string.hpp>
 #include <boost/thread.hpp>
-#include <boost/thread/mutex.hpp>
 #include <boost/thread/condition.hpp>
+#include <boost/thread/mutex.hpp>
 #include <unistd.h>
 #include <errno.h>
 #include <getopt.h>
 #include <vector>
 
 using std::cerr;
-using std::string;
 using std::cout;
 using std::shared_ptr;
+using std::string;
 
 static void
 help (string n)
 {
        cerr << "Syntax: " << n << " [OPTION]\n"
-            << "  -v, --version      show DCP-o-matic version\n"
+            << variant::insert_dcpomatic("  -v, --version      show %1 version\n")
             << "  -h, --help         show this help\n"
             << "  -t, --threads      number of parallel encoding threads to use\n"
             << "  --verbose          be verbose to stdout\n"
@@ -123,7 +124,7 @@ main (int argc, char* argv[])
                server.run ();
        } catch (boost::system::system_error& e) {
                if (e.code() == boost::system::errc::address_in_use) {
-                       cerr << argv[0] << ": address already in use.  Is another DCP-o-matic server instance already running?\n";
+                       cerr << argv[0] << variant::insert_dcpomatic(": address already in use.  Is another %1 server instance already running?\n");
                        exit (EXIT_FAILURE);
                }
                cerr << argv[0] << ": " << e.what() << "\n";
index 382516acceb26fcd1cd7f94a79c33874f299bbb8..273403a4e76d6ab23da3880d58ee77c247a9808e 100644 (file)
@@ -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;
index 8b1f8a03863b2796867559c10390e3220d6ecb3a..28bee89b93b8c837837d560d44cc624106570292 100644 (file)
@@ -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 <dcp/warnings.h>
@@ -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));
 
index 714bf78e4e6c5c35b9e552dcf144ebb45b75f7e5..1f7f3ad039f295817a0f711bbc455ac596a97124 100644 (file)
@@ -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> 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) {
index b4adc855e4af103398fd11a8c5a27cbc33c6a8c6..04bb26c2e7bc6dfe7340924eeadfd474aa4217de 100644 (file)
@@ -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 <dcp/file.h>
 #include <dcp/filesystem.h>
@@ -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")));
        }
 }
 
index ed9c15c834368c47b7a808315ab5f6b48a597e9c..07a632b4ad387e121f0f2e7152a91a26b47d54b0 100644 (file)
@@ -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());
index b9fe7ce005a8dde13de020dffa0920317e96d84f..b2d6f86d11f0ed151f74d577ac71f8a0fce1ed5c 100644 (file)
@@ -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<shared_ptr<ExamineContentJob>> jobs;
index 531b7f4f9d6d01856a00fb5790b10b9507b60cfa..9af4a2acae317211da7fefb4be32572343a1c7fd 100644 (file)
 
 */
 
+
 #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 <b>DCP-o-matic Disk Writer</b> is\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">BETA-GRADE TEST SOFTWARE</span>\n\n"
+               _("The <b>%s</b> is\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">BETA-GRADE TEST SOFTWARE</span>\n\n"
                  "and may\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">DESTROY DATA!</span>\n\n"
                  "If you are sure you want to continue please type\n\n<tt>%s</tt>\n\ninto the box below, then click OK."),
-               confirmation));
+               variant::wx::dcpomatic_disk_writer(), confirmation));
 }
 
 bool
index 82c2e3598268788ecce0e401f5cd8c3a9589088c..a36a9ceaef634efb3e724985ad8545fa2b32921e 100644 (file)
@@ -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) {
index e3ea9122494f478c80e979fcc91b31cda7127a01..193392f29d05cff6041be898aefb1d2f55e5b067 100644 (file)
@@ -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 <Issuer>.  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 <Issuer>.  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 <Creator>.  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 <Creator>.  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);
index efe17f4deba2a01c1939f9764464c5fa8b021cba..d5b6c4632d16695bac123706014d29994da95fc6 100644 (file)
@@ -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();
index 5ab13b4ce7410905f41b5581e9290bbdd57446a8..e9d186264807e84a444126974a693affa60f20fd 100644 (file)
@@ -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) {
index 58874e50b59ac63cb589ebd32bce6a28135823a7..d7bba4dcc032b763e07d2a6dc511d6631059510a 100644 (file)
@@ -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
index 3a1bba3628bf1c48b697aa298b898b33e6d1b44f..f51bcc4e22dcc33c96da7966fad104cc614ddf1b 100644 (file)
@@ -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 ();
index d5c4106eabb46eb0e5c4f377ec71fe162a9998e4..67bedc05e8c0a51a73af0117337d1c54bbda22ca 100644 (file)
 
 */
 
-#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
index 62f8688a9192150328c4fc7dac5724925f633dd9..52545e5f6cd0734a93ae2e7745812ce84449d865 100644 (file)
@@ -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;
        }
 
index fbae2e010ec57f7cbe9dc455e399b1a2f87c3401..26138900a602b4934103263ae342d0adfb7e32bd 100644 (file)
@@ -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
index ddfaec5c09f60470d58a8f924f9ab26952c208c0..37d6e75fa80a22d696dab22af8c6190d12c90f11 100644 (file)
@@ -22,6 +22,7 @@
 #include "static_text.h"
 #include "try_unmount_dialog.h"
 #include "wx_util.h"
+#include "wx_variant.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
@@ -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 <b>%s</b> 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 <b>%s</b> 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);
 
index 0a7319704e6581af1fe54ff5fb4dd271cfaa1bcd..7c687aa60a1a502b8c47b61f3ad02960de5d08e5 100644 (file)
@@ -22,6 +22,7 @@
 #include "static_text.h"
 #include "update_dialog.h"
 #include "wx_util.h"
+#include "wx_variant.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/hyperlink.h>
@@ -40,9 +41,9 @@ UpdateDialog::UpdateDialog (wxWindow* parent, optional<string> 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);
index eecc314a03e312047b1eab051ae7457fcaa1f628..b37d26d6d48bd7af09d76fd24bb269fbe853a453 100644 (file)
@@ -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):
index 58bb4d5ea0d4cb601c5fd249d4e95b43214ccdab..49a3ca5c3364b04323762afe4eb6a5e8037bf2ea 100644 (file)
@@ -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<wxString> e)
 {
-       auto d = make_wx<wxMessageDialog>(parent, m, _("DCP-o-matic"), wxOK | wxICON_ERROR);
+       auto d = make_wx<wxMessageDialog>(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<wxString> e)
 void
 message_dialog (wxWindow* parent, wxString m)
 {
-       auto d = make_wx<wxMessageDialog>(parent, m, _("DCP-o-matic"), wxOK | wxICON_INFORMATION);
+       auto d = make_wx<wxMessageDialog>(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<wxMessageDialog>(parent, m, _("DCP-o-matic"), wxYES_NO | wxICON_QUESTION);
+       auto d = make_wx<wxMessageDialog>(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 (file)
index 0000000..690e3a3
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+    Copyright (C) 2024 Carl Hetherington <cth@carlh.net>
+
+    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 <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#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 (file)
index 0000000..0121c5b
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+    Copyright (C) 2024 Carl Hetherington <cth@carlh.net>
+
+    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 <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include <wx/wx.h>
+
+
+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);
+
+
+}
+}