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

Bug#634076: cdebconf: [text] Should use commas to separate choices for proper speech synthesis



Package: cdebconf
Version: 0.156
Severity: normal
Tags: patch

Hello,

Currently, the speech synthesis speaks cdebconf choices in a
non-intelligible way. This is because:

1. Foo 2. Bar

is recognized as "1", then "Foo 2", then "Bar".

The attached patch fixes it by properly using colon and comma to
separate choices:

1: Foo, 2: Bar

the speech synthesis will then properly pause between "Foo" and "2".

Samuel

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.39-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cdebconf depends on:
ii  debconf                      1.5.40      Debian configuration management sy
ii  dpkg                         1.16.0.3    Debian package management system
ii  libc6                        2.13-7      Embedded GNU C Library: Shared lib
ii  libdebian-installer4         0.78        Library of common debian-installer
ii  libnewt0.52                  0.52.11-2.1 Not Erik's Windowing Toolkit - tex
ii  libslang2                    2.2.4-2     S-Lang programming library - runti
ii  libtextwrap1                 0.1-12      text-wrapping library with i18n - 

cdebconf recommends no packages.

Versions of packages cdebconf suggests:
pn  cdebconf-gtk                  <none>     (no description available)

-- no debconf information

-- 
Samuel Thibault <samuel.thibault@fnac.net>
Actually, typing random strings in the Finder does the equivalent of
filename completion.
(Discussion in comp.os.linux.misc on the intuitiveness of commands: file
completion vs. the Mac Finder.)
diff --git a/src/modules/frontend/text/text.c b/src/modules/frontend/text/text.c
index db4988d..1e66244 100644
--- a/src/modules/frontend/text/text.c
+++ b/src/modules/frontend/text/text.c
@@ -234,10 +234,11 @@ printlist (struct frontend *obj, struct question *q, int count, char **choices_t
 	for (i=0; i < count; i++)
 	{
 		/*  Trailing spaces are a placeholder to add [*] for
-		    selected values */
-		asprintf(&(fchoices[i]), "%3d. %s    ", i+1, choices_translated[i]);
+		    selected values
+		    Comma is needed for proper speech synthesis pause */
+		asprintf(&(fchoices[i]), "%3d: %s,    ", i+1, choices_translated[i]);
 		if (selected[tindex[i]])
-			strcpy(fchoices[i]+strlen(fchoices[i])-3, "[*]");
+			strcpy(fchoices[i]+strlen(fchoices[i])-5, " [*],");
 		if (strwidth(fchoices[i]) < choice_min || choice_min == -1)
 			choice_min = strwidth(fchoices[i]);
 		if (strwidth(fchoices[i]) > width)
@@ -339,8 +340,8 @@ static int text_handler_boolean(struct frontend *obj, struct question *q)
 	}
 
 	do {
-		printf("  %d. %s%s", 1, question_get_text(obj, "debconf/yes", "Yes"), (1 == def ? " [*]" : "    "));
-		printf("  %d. %s%s", 2, question_get_text(obj, "debconf/no", "No"), (2 == def ? " [*]" : ""));
+		printf("  %d: %s%s", 1, question_get_text(obj, "debconf/yes", "Yes"), (1 == def ? " [*]" : "    "));
+		printf("  %d: %s%s", 2, question_get_text(obj, "debconf/no", "No"), (2 == def ? " [*]" : ""));
 		printf("\n");
 		if (def)
 			printf(question_get_text(obj, "debconf/text-prompt-default",

Reply to: