From 0e4bcc1123a500c20b4f353c9ffa2324a37f22c5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 12 May 2023 09:19:38 -0400 Subject: Fix use of reserved macro name --- src/CanvasModule.cpp | 6 +++--- src/CanvasPort.hpp | 2 +- src/Legend.cpp | 2 +- src/Patchage.cpp | 12 ++++++------ src/i18n.hpp | 5 +---- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/CanvasModule.cpp b/src/CanvasModule.cpp index 95ab169..3b45b6f 100644 --- a/src/CanvasModule.cpp +++ b/src/CanvasModule.cpp @@ -91,15 +91,15 @@ CanvasModule::show_menu(GdkEventButton* ev) if (_type == SignalDirection::duplex) { items.push_back(Gtk::Menu_Helpers::MenuElem( - _("_Split"), sigc::mem_fun(this, &CanvasModule::on_split))); + T("_Split"), sigc::mem_fun(this, &CanvasModule::on_split))); update_menu(); } else { items.push_back(Gtk::Menu_Helpers::MenuElem( - _("_Join"), sigc::mem_fun(this, &CanvasModule::on_join))); + T("_Join"), sigc::mem_fun(this, &CanvasModule::on_join))); } items.push_back(Gtk::Menu_Helpers::MenuElem( - _("_Disconnect"), sigc::mem_fun(this, &CanvasModule::on_disconnect))); + T("_Disconnect"), sigc::mem_fun(this, &CanvasModule::on_disconnect))); _menu->popup(ev->button, ev->time); return true; diff --git a/src/CanvasPort.hpp b/src/CanvasPort.hpp index c3195a9..0fc2f04 100644 --- a/src/CanvasPort.hpp +++ b/src/CanvasPort.hpp @@ -83,7 +83,7 @@ public: Gtk::Menu* menu = Gtk::manage(new Gtk::Menu()); menu->items().push_back(Gtk::Menu_Helpers::MenuElem( - _("Disconnect"), sigc::mem_fun(this, &Port::disconnect))); + T("Disconnect"), sigc::mem_fun(this, &Port::disconnect))); menu->popup(ev->button.button, ev->button.time); return true; diff --git a/src/Legend.cpp b/src/Legend.cpp index a4e8705..1ef833e 100644 --- a/src/Legend.cpp +++ b/src/Legend.cpp @@ -24,7 +24,7 @@ namespace patchage { Legend::Legend(const Configuration& configuration) { add_button(PortType::jack_audio, - _("Audio"), + T("Audio"), configuration.get_port_color(PortType::jack_audio)); #if USE_JACK_METADATA diff --git a/src/Patchage.cpp b/src/Patchage.cpp index f2d2b59..a51c1ca 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -452,7 +452,7 @@ Patchage::update_toolbar() const auto latency_ms = buffer_size / sample_rate_khz; _latency_label->set_label(" " + - fmt::format(_("frames at {} kHz ({:0.2f} ms)"), + fmt::format(T("frames at {} kHz ({:0.2f} ms)"), sample_rate_khz, latency_ms)); @@ -474,7 +474,7 @@ Patchage::update_load() if (_drivers.jack() && _drivers.jack()->is_attached()) { const auto xruns = _drivers.jack()->xruns(); - _dropouts_label->set_text(" " + fmt::format(_("Dropouts: {}"), xruns)); + _dropouts_label->set_text(" " + fmt::format(T("Dropouts: {}"), xruns)); if (xruns > 0u) { _dropouts_label->show(); @@ -509,7 +509,7 @@ Patchage::store_window_location() void Patchage::clear_load() { - _dropouts_label->set_text(" " + fmt::format(_("Dropouts: {}"), 0U)); + _dropouts_label->set_text(" " + fmt::format(T("Dropouts: {}"), 0U)); _dropouts_label->hide(); _clear_load_but->hide(); if (_drivers.jack()) { @@ -837,7 +837,7 @@ Patchage::on_quit() void Patchage::on_export_image() { - Gtk::FileChooserDialog dialog(_("Export Image"), + Gtk::FileChooserDialog dialog(T("Export Image"), Gtk::FILE_CHOOSER_ACTION_SAVE); dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); @@ -859,7 +859,7 @@ Patchage::on_export_image() dialog.add_filter(filt); } - auto* bg_but = new Gtk::CheckButton(_("Draw _Background"), true); + auto* bg_but = new Gtk::CheckButton(T("Draw _Background"), true); auto* extra = new Gtk::Alignment(1.0, 0.5, 0.0, 0.0); bg_but->set_active(true); extra->add(*Gtk::manage(bg_but)); @@ -870,7 +870,7 @@ Patchage::on_export_image() const std::string filename = dialog.get_filename(); if (Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) { Gtk::MessageDialog confirm( - fmt::format(_("File exists! Overwrite {}?"), filename), + fmt::format(T("File exists! Overwrite {}?"), filename), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_YES_NO, diff --git a/src/i18n.hpp b/src/i18n.hpp index 4cf082d..ebf8fd1 100644 --- a/src/i18n.hpp +++ b/src/i18n.hpp @@ -7,9 +7,6 @@ #include /// Mark a string literal as translatable -#define _(msgid) gettext(msgid) - -/// Mark a string literal as non-translatable -// #define N_(msgid) (msgid) +#define T(msgid) gettext(msgid) #endif // PATCHAGE_I18N_HPP -- cgit v1.2.1