speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Mark spsay messages for translation.


From: Rui Batista
Subject: [PATCH] Mark spsay messages for translation.
Date: Thu, 7 Oct 2010 14:10:39 +0100

Note that output was somehow changed to use printf,
to make translation easier.

This patch make spdsay depend on libcommon.
---
 po/POTFILES.in              |    1 +
 src/clients/say/Makefile.am |    6 +-
 src/clients/say/options.c   |   93 ++++++++++++++++++++++++++-----------------
 src/clients/say/say.c       |    4 ++
 4 files changed, 64 insertions(+), 40 deletions(-)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 685d475..544f23b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1 +1,2 @@
+src/clients/say/options.c
 src/server/options.c
diff --git a/src/clients/say/Makefile.am b/src/clients/say/Makefile.am
index e32ebbf..c050a84 100644
--- a/src/clients/say/Makefile.am
+++ b/src/clients/say/Makefile.am
@@ -1,9 +1,9 @@
 ## Process this file with automake to produce Makefile.in
 
-inc_local = -I$(top_srcdir)/src/api/c
+inc_local = -I$(top_srcdir)/src/api/c -I$(top_srcdir)/include
 c_api = $(top_builddir)/src/api/c
 
 bin_PROGRAMS = spd-say
-spd_say_CPPFLAGS = $(inc_local) -DLOCALEDIR=\"$(localedir)\"
+spd_say_CPPFLAGS = $(inc_local) $(GLIB_CFLAGS)
 spd_say_SOURCES = say.c options.c options.h
-spd_say_LDADD = $(c_api)/libspeechd.la -lpthread $(EXTRA_SOCKET_LIBS)
+spd_say_LDADD = $(c_api)/libspeechd.la -lpthread $(EXTRA_SOCKET_LIBS) 
$(top_builddir)/src/common/libcommon.la
diff --git a/src/clients/say/options.c b/src/clients/say/options.c
index 3e140b2..fa5f6f5 100644
--- a/src/clients/say/options.c
+++ b/src/clients/say/options.c
@@ -29,6 +29,7 @@
 #endif
 
 #define PACKAGE "spd-say"
+
 #define VERSION "0.4"
 
 #include <stdio.h>
@@ -36,6 +37,7 @@
 #include <string.h>
 #include <assert.h>
 #include "options.h"
+#include <i18n.h>
 
 void
 options_print_help(char *argv[])
@@ -43,48 +45,65 @@ options_print_help(char *argv[])
     assert(argv);
     assert(argv[0]);
 
-    printf("Usage: %s [options] \"some text\"\n", argv[0]);
-    printf("Speech Dispatcher Say -- a simple client for speech synthesis (GNU 
GPL)\n\n");
-    printf(
-          "-r, --rate             -     Set the rate of the speech\n"
-           "                               (between -100 and +100, default: 
0)\n"
-          "-p, --pitch            -     Set the pitch of the speech\n"
-          "                               (between -100 and +100, default: 
0)\n"
-          "-i, --volume           -     Set the volume (intensity) of the 
speech\n"
-           "                               (between -100 and +100, default: 0) 
\n"
-          "-o, --output-module    -     Set the output module\n"
-          "-l, --language         -     Set the language (iso code)\n"
-          "-t, --voice-type       -     Set the prefered voice type\n"
+    printf(_("Usage: %s [options] \"some text\"\n"), argv[0]);
+    printf(_("Speech Dispatcher Say -- a simple client for speech synthesis 
(GNU GPL)\n\n"));
+    printf("-r, --rate\t");
+    printf(_("Set the rate of the speech\n"
+           "                               (between -100 and +100, default: 
0)\n"));
+    printf("-p, --pitch\t");
+    printf(_("Set the pitch of the speech\n"
+          "                               (between -100 and +100, default: 
0)\n"));
+    printf("-i, --volume\t");
+    printf(_("Set the volume (intensity) of the speech\n"
+           "                               (between -100 and +100, default: 0) 
\n"));
+    printf("-o, --output-module\t");
+    printf(_("Set the output module\n"));
+    printf("-l, --language\t");
+    printf(_("Set the language (iso code)\n"));
+    printf("-t, --voice-type\t");
+          printf(_("Set the prefered voice type\n"
            "                               (male1, male2, male3, female1, 
female2\n"
-          "                                female3, child_male, 
child_female)\n"
-          "-m, --punctuation-mode -     Set the punctuation mode (none, some, 
all) \n"
-          "-s, --spelling         -     Spell the message\n"
-           "-x, --ssml             -     Set SSML mode on (default: off)\n"
-           "\n"
-           "-e, --pipe-mode        -     Pipe from stdin to stdout plus Speech 
Dispatcher\n"
-           "-P, --priority         -     Set priority of the message 
(important, message,\n"
-           "                                text, notification, progress; 
default: text)\n"
-           "-N, --application-name -     Set the application name used to 
estabilish\n"
+          "                                female3, child_male, 
child_female)\n"));
+    printf("-m, --punctuation-mode\t");
+    printf(_("Set the punctuation mode (none, some, all) \n"));
+    printf("-s, --spelling\t\t");
+    printf(_("Spell the message\n"));
+    printf("-x, --ssml\t");
+    printf(_("Set SSML mode on (default: off)\n"));
+    printf("\n");
+    printf("-e, --pipe-mode\t");
+           printf(_("Pipe from stdin to stdout plus Speech Dispatcher\n"));
+    printf("-P, --priority\t");
+    printf(_("Set priority of the message (important, message,\n"
+           "                                text, notification, progress; 
default: text)\n"));
+    printf("-N, --application-name\t");
+    printf(_("Set the application name used to estabilish\n"
            "                                the connection to specified string 
value\n"
-           "                                (default: spd-say)\n"
-           "-n, --connection-name  -     Set the connection name used to 
estabilish\n"
+           "                                (default: spd-say)\n"));
+    printf("-n, --connection-name\t");
+    printf(_("Set the connection name used to estabilish\n"
            "                                the connection to specified string 
value\n"
-          "                                (default: main)\n"
-           "\n"
-          "-w, --wait             -     Wait till the message is spoken or 
discarded\n"
-           "-S, --stop             -     Stop speaking the message being 
spoken\n"
-           "                                in Speech Dispatcher\n"
-           "-C, --cancel           -     Cancel all messages in Speech 
Dispatcher\n"
-           "\n"
-          "-v, --version          -     Print version and copyright info\n"
-          "-h, --help             -     Print this info\n"
-           "\n"
-          "Copyright (C) 2003 Brailcom, o.p.s.\n"
+           "                                (default: main)\n"));
+    printf("\n");
+    printf("-w, --wait\t");
+    printf(_("Wait till the message is spoken or discarded\n"));
+    printf("-S, --stop\t");
+    printf(_("Stop speaking the message being spoken\n"
+           "                                in Speech Dispatcher\n"));
+    printf("-C, --cancel\t");
+    printf(_("Cancel all messages in Speech Dispatcher\n"));
+    printf("\n");
+    printf("-v, --version\t");
+    printf(_("Print version and copyright info\n"));
+    printf(    "-h, --help\t");
+    printf(_("Print this info\n"));
+    printf("\n");
+    printf(_("Copyright (C) 2003 Brailcom, o.p.s.\n"
           "This is free software; you can redistribute it and/or modify it\n"
           "under the terms of the GNU General Public License as published by\n"
           "the Free Software Foundation; either version 2, or (at your 
option)\n"
           "any later version. Please see COPYING for more details.\n\n"
-          "Please report bugs to <speechd at bugs.freebsoft.org>\n\n"
+          "Please report bugs to <speechd at bugs.freebsoft.org>\n\n")
           );
     
 }
@@ -93,11 +112,11 @@ void
 options_print_version()
 {
     printf("spd-say: "PACKAGE" "VERSION"\n");
-    printf("Copyright (C) 2002-2006 Brailcom, o.p.s.\n"
+    printf(_("Copyright (C) 2002-2006 Brailcom, o.p.s.\n"
            "spd-say comes with ABSOLUTELY NO WARRANTY.\n"
            "You may redistribute copies of spd-say\n"
            "under the terms of the GNU General Public License.\n"
-           "For more information about these matters, see the file named 
COPYING.\n"
+           "For more information about these matters, see the file named 
COPYING.\n")
            );
 }
 
diff --git a/src/clients/say/say.c b/src/clients/say/say.c
index 64b4bd8..464379f 100644
--- a/src/clients/say/say.c
+++ b/src/clients/say/say.c
@@ -36,6 +36,7 @@
 #include "libspeechd.h"
 #include "options.h"
 
+#include <i18n.h>
 
 #define MAX_LINELEN 16384
 
@@ -57,6 +58,9 @@ int main(int argc, char **argv) {
     int option_ret;
     char *line;
 
+    /* initialize i18n support */
+    i18n_init();
+
     rate = -101;
     pitch = -101;
     volume = -101;
-- 
1.7.0.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]