[beast: 5/6] BEAST: make use of gettext from glib-extra.hh
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 5/6] BEAST: make use of gettext from glib-extra.hh
- Date: Wed, 21 Jun 2017 09:51:15 +0000 (UTC)
commit 1456cf012c632929f3ce45ca60bd041645a7983c
Author: Tim Janik <timj gnu org>
Date: Wed Jun 21 11:49:45 2017 +0200
BEAST: make use of gettext from glib-extra.hh
Signed-off-by: Tim Janik <timj gnu org>
beast-gtk/bstdefs.hh | 7 ++++---
beast-gtk/bstprojectctrl.cc | 2 +-
beast-gtk/bstusermessage.cc | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/beast-gtk/bstdefs.hh b/beast-gtk/bstdefs.hh
index 7bc86c6..f3a11a9 100644
--- a/beast-gtk/bstdefs.hh
+++ b/beast-gtk/bstdefs.hh
@@ -74,9 +74,10 @@ typedef enum /*< skip >*/
} G_STMT_END
/* --- i18n and gettext helpers --- */
-#define BEAST_GETTEXT_DOMAIN (NULL)
-#define _(str) dgettext (BEAST_GETTEXT_DOMAIN, str)
-#define N_(str) (str)
+// Atm, Beast and libbse share the same text domain
+#define _(str) ::Bse::_ (str)
+#define N_(str) (str)
+inline const char* bst_gettext_domain () { return ::Bse::bse_gettext_domain(); }
/* --- internal stuff --- */
void beast_show_about_box (void);
diff --git a/beast-gtk/bstprojectctrl.cc b/beast-gtk/bstprojectctrl.cc
index 00bcd0e..5dfe34f 100644
--- a/beast-gtk/bstprojectctrl.cc
+++ b/beast-gtk/bstprojectctrl.cc
@@ -12,7 +12,7 @@ bst_project_ctrl_play (BstProjectCtrl *self)
{
if (self && self->project)
{
- gchar *starting;
+ const char *starting;
Bse::Error error;
if (self->project.is_playing())
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index 5559c67..3992b12 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -348,7 +348,7 @@ repeat_dialog (GxkDialog *dialog)
if (label)
{
gint count = g_object_get_int (dialog, "BEAST-user-message-count");
- gchar *rstr = g_strdup_format (dngettext (BEAST_GETTEXT_DOMAIN, _("Message has been repeated %u
time"), _("Message has been repeated %u times"), count), count);
+ gchar *rstr = g_strdup_format (dngettext (bst_gettext_domain(), _("Message has been repeated %u
time"), _("Message has been repeated %u times"), count), count);
g_object_set_int (dialog, "BEAST-user-message-count", count + 1);
gtk_label_set_text (label, rstr);
g_free (rstr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]