[PATCH] Add out-of-band DTMF support and dialpad to use it

David Woodhouse dwmw2 at infradead.org
Thu Oct 9 15:09:11 EDT 2014


On Thu, 2014-10-09 at 08:32 +0100, David Woodhouse wrote:
> 
> > Also, I think we should mark the letter mappings for translation.
> > There's a standard for this which covers many languages:
> >
> http://www.etsi.org/deliver/etsi_es/202100_202199/202130/01.01.01_60/es_202130v010101p.pdf
> > 
> > That covers more letters for what I assume is the "text messaging
> > context" as opposed to what would appear on buttons on phones. But
> if
> > you look at the entries above the digit, that seems to be what we're
> > interested in. Most follow the same Latin script that we have in the
> > U.S. but not all do: Greek and Russian do not.
> 
> That's really useful feedback; thanks. Definitely warrants a note for
> translators, and I suspect it even needs one on *each* translatable
> string in case they get split up by the translators' tools.
> 
> Incremental patch (for bikeshedding)...

I should have tested that better before responding. Here's a version
that doesn't use the result of dgettext(PACKAGE,"") in the buttons that
shouldn't have letters...

diff --git a/pidgin/gtkmedia.c b/pidgin/gtkmedia.c
index 4cea0a3..3d6d66c 100644
--- a/pidgin/gtkmedia.c
+++ b/pidgin/gtkmedia.c
@@ -764,11 +764,17 @@ phone_create_button(const gchar *text_hi, const gchar *text_lo)
 	GtkWidget *label_hi;
 	GtkWidget *label_lo;
 	GtkWidget *grid;
+	gchar *text_hi_local;
+
+	if (text_hi)
+		text_hi_local = dgettext(PACKAGE, text_hi);
+	else
+		text_hi_local = "";
 
 	grid = gtk_vbox_new(TRUE, 0);
 
 	button = gtk_button_new();
-	label_hi = gtk_label_new(text_hi);
+	label_hi = gtk_label_new(text_hi_local);
 	gtk_misc_set_alignment(GTK_MISC(label_hi), 0.5, 0.5);
 	gtk_box_pack_end(GTK_BOX(grid), label_hi, FALSE, TRUE, 0);
 	label_lo = gtk_label_new(text_lo);
@@ -785,18 +791,29 @@ static struct phone_label {
 	gchar *text;
 	gchar chr;
 } phone_labels[] = {
-	{"<b>1</b>", "", '1'},
-	{"<b>2</b>", "ABC", '2'},
-	{"<b>3</b>", "DEF", '3'},
-	{"<b>4</b>", "GHI", '4'},
-	{"<b>5</b>", "JKL", '5'},
-	{"<b>6</b>", "MNO", '6'},
-	{"<b>7</b>", "PQRS", '7'},
-	{"<b>8</b>", "TUV", '8'},
-	{"<b>9</b>", "WXYZ", '9'},
-	{"<b>*</b>", "", '*'},
-	{"<b>0</b>", "", '0'},
-	{"<b>#</b>", "", '#'},
+	{"<b>1</b>", NULL, '1'},
+	/* Translators note: These are the letters on the keys of a numeric
+	   keypad; translate according to §7.2.4 of
+	 http://www.etsi.org/deliver/etsi_es/202100_202199/202130/01.01.01_60/es_20213 */
+	 /* Letters on the '2' key of a numeric keypad */
+	{"<b>2</b>", N_("ABC"), '2'},
+	 /* Letters on the '3' key of a numeric keypad */
+	{"<b>3</b>", N_("DEF"), '3'},
+	 /* Letters on the '4' key of a numeric keypad */
+	{"<b>4</b>", N_("GHI"), '4'},
+	 /* Letters on the '5' key of a numeric keypad */
+	{"<b>5</b>", N_("JKL"), '5'},
+	 /* Letters on the '6' key of a numeric keypad */
+	{"<b>6</b>", N_("MNO"), '6'},
+	 /* Letters on the '7' key of a numeric keypad */
+	{"<b>7</b>", N_("PQRS"), '7'},
+	 /* Letters on the '8' key of a numeric keypad */
+	{"<b>8</b>", N_("TUV"), '8'},
+	 /* Letters on the '9' key of a numeric keypad */
+	{"<b>9</b>", N_("WXYZ"), '9'},
+	{"<b>*</b>", NULL, '*'},
+	{"<b>0</b>", NULL, '0'},
+	{"<b>#</b>", NULL, '#'},
 	{NULL, NULL, 0}
 };
 


-- 
dwmw2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <https://pidgin.im/pipermail/devel/attachments/20141009/41a48760/attachment.bin>


More information about the Devel mailing list