[aisleriot] guile: Use guile builtin gettext
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] guile: Use guile builtin gettext
- Date: Sat, 5 Mar 2016 19:29:48 +0000 (UTC)
commit 6507de4f8a25f1f6845ee3467bf046c955dc5826
Author: Christian Persch <chpe gnome org>
Date: Sat Mar 5 20:29:34 2016 +0100
guile: Use guile builtin gettext
games/api.scm | 3 +++
src/game.c | 31 -------------------------------
2 files changed, 3 insertions(+), 31 deletions(-)
---
diff --git a/games/api.scm b/games/api.scm
index 18bae8f..c50b723 100644
--- a/games/api.scm
+++ b/games/api.scm
@@ -18,6 +18,9 @@
(use-modules (aisleriot interface) (ice-9 format) (ice-9 i18n))
+;; Define the usual alias for gettext
+(define-public (_ msg) (gettext msg "aisleriot"))
+
;; Feature masks:
(define-public droppable-feature 1)
(define-public scores-disabled 2)
diff --git a/src/game.c b/src/game.c
index b196bdc..632e9e1 100644
--- a/src/game.c
+++ b/src/game.c
@@ -670,36 +670,6 @@ cscmi_add_slot (SCM slot_data)
}
/* Scheme functions */
-static SCM
-scm_gettext (SCM message)
-{
- char *input;
- const char *output;
- SCM translated = SCM_UNDEFINED;
-
- if (!scm_is_string (message))
- return message;
-
- scm_dynwind_begin (0);
-
- input = scm_to_utf8_string (message);
- scm_dynwind_free (input);
- if (!input)
- goto out;
-
- output = g_dgettext (NULL, input);
-
- if (input != output) {
- translated = scm_from_utf8_string (output);
- } else {
- translated = message;
- }
-
-out:
- scm_dynwind_end ();
-
- return translated;
-}
static SCM
scm_undo_set_sensitive (SCM in_state)
@@ -1078,7 +1048,6 @@ cscm_init (void *data G_GNUC_UNUSED)
scm_c_define_gsubr ("get-timeout", 0, 0, 0, scm_get_timeout);
scm_c_define_gsubr ("set-timeout!", 1, 0, 0, scm_set_timeout);
scm_c_define_gsubr ("delayed-call", 1, 0, 0, scm_delayed_call);
- scm_c_define_gsubr ("_", 1, 0, 0, scm_gettext);
scm_c_define_gsubr ("undo-set-sensitive", 1, 0, 0, scm_undo_set_sensitive);
scm_c_define_gsubr ("redo-set-sensitive", 1, 0, 0, scm_redo_set_sensitive);
scm_c_define_gsubr ("dealable-set-sensitive", 1, 0, 0, scm_dealable_set_sensitive);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]