Re : prefs_msg_colors.c

"Fabien Vantard" <[email protected]>
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
hi,

Perhaps, we can use Q_() macro managing these kinds of cases. We have
to suffix (separated by a | character) the string by a context string
like this :

Q_("dialog title|Pick color for 'color %d'")

(Attached patch use this one).

regards.

> Index: prefs_msg_colors.c
> ===================================================================
> RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/prefs_msg_colors.c,v
> retrieving revision 1.1.2.24
> retrieving revision 1.1.2.25
> diff -u -r1.1.2.24 -r1.1.2.25
> --- prefs_msg_colors.c	25 Apr 2006 16:59:46 -0000	1.1.2.24
> +++ prefs_msg_colors.c	27 Apr 2006 09:13:40 -0000	1.1.2.25
> @@ -604,43 +604,45 @@
>  	gint c;
>
>  	/* custom colors */
> +	/* leave the extra space at the end of the title, this is for translators'
> convenience */
>  	for (c = 0; c < COLORLABELS; c++) {
>  		if (GPOINTER_TO_INT(type) == c) {
>  			/* TRANSLATORS: 'color %d' refers to the filtering/processing
>  			   rule name and should not be translated */
> -			title = g_strdup_printf(_("Pick color for 'color %d'"), c+1);
> +			title = g_strdup_printf(_("Pick color for 'color %d' "), c+1);
>  			rgbvalue = prefs_common.custom_colorlabel[c].color;
>  			break;
>  		}
>  	}
>  	/* other colors */
> +	/* leave the extra space at the end of the titles, this is for
> translators' convenience */
>  	if (c == COLORLABELS) {
>  		if(g_ascii_strcasecmp(type, "LEVEL1") == 0) {
> -			title = g_strdup(_("Pick color for quotation level 1"));
> +			title = g_strdup(_("Pick color for 1st level text "));
>  			rgbvalue = prefs_common.quote_level1_col;
>  		} else if(g_ascii_strcasecmp(type, "LEVEL2") == 0) {
> -			title = g_strdup(_("Pick color for quotation level 2"));
> +			title = g_strdup(_("Pick color for 2nd level text "));
>  			rgbvalue = prefs_common.quote_level2_col;
>  		} else if(g_ascii_strcasecmp(type, "LEVEL3") == 0) {
> -			title = g_strdup(_("Pick color for quotation level 3"));
> +			title = g_strdup(_("Pick color for 3rd level text "));
>  			rgbvalue = prefs_common.quote_level3_col;
>  		} else if(g_ascii_strcasecmp(type, "LEVEL1BG") == 0) {
> -			title = g_strdup(_("Pick color for quotation level 1 background"));
> +			title = g_strdup(_("Pick color for 1st level text background "));
>  			rgbvalue = prefs_common.quote_level1_bgcol;
>  		} else if(g_ascii_strcasecmp(type, "LEVEL2BG") == 0) {
> -			title = g_strdup(_("Pick color for quotation level 2 background"));
> +			title = g_strdup(_("Pick color for 2nd level text background "));
>  			rgbvalue = prefs_common.quote_level2_bgcol;
>  		} else if(g_ascii_strcasecmp(type, "LEVEL3BG") == 0) {
> -			title = g_strdup(_("Pick color for quotation level 3 background"));
> +			title = g_strdup(_("Pick color for 3rd level text background "));
>  			rgbvalue = prefs_common.quote_level3_bgcol;
>  		} else if(g_ascii_strcasecmp(type, "URI") == 0) {
> -			title = g_strdup(_("Pick color for URI"));
> +			title = g_strdup(_("Pick color for links "));
>  			rgbvalue = prefs_common.uri_col;
>  		} else if(g_ascii_strcasecmp(type, "TGTFLD") == 0) {
>  			title = g_strdup(_("Pick color for target folder"));
>  			rgbvalue = prefs_common.tgt_folder_col;
>  		} else if(g_ascii_strcasecmp(type, "SIGNATURE") == 0) {
> -			title = g_strdup(_("Pick color for signatures"));
> +			title = g_strdup(_("Pick color for signatures "));
>  			rgbvalue = prefs_common.signature_col;
>  		} else if(g_ascii_strcasecmp(type, "NEW") == 0) {
>  			title = g_strdup(_("Pick color for folder"));
2.2.0-rc1_i18n_use_Q_macro.patch (text/x-diff, 3.3 KB)
--- src/prefs_msg_colors.c.orig	2006-04-27 16:08:34.000000000 +0200
+++ src/prefs_msg_colors.c	2006-04-27 16:11:06.000000000 +0200
@@ -604,45 +604,43 @@
 	gint c;
 
 	/* custom colors */
-	/* leave the extra space at the end of the title, this is for translators' convenience */
 	for (c = 0; c < COLORLABELS; c++) {
 		if (GPOINTER_TO_INT(type) == c) {
 			/* TRANSLATORS: 'color %d' refers to the filtering/processing 
 			   rule name and should not be translated */
-			title = g_strdup_printf(_("Pick color for 'color %d' "), c+1);
+			title = g_strdup_printf(Q_("dialog title|Pick color for 'color %d'"), c+1);
 			rgbvalue = prefs_common.custom_colorlabel[c].color;
 			break;
 		}
 	}
 	/* other colors */
-	/* leave the extra space at the end of the titles, this is for translators' convenience */
 	if (c == COLORLABELS) {
 		if(g_ascii_strcasecmp(type, "LEVEL1") == 0) {
-			title = g_strdup(_("Pick color for 1st level text "));
+			title = g_strdup(Q_("dialog title|Pick color for 1st level text"));
 			rgbvalue = prefs_common.quote_level1_col;
 		} else if(g_ascii_strcasecmp(type, "LEVEL2") == 0) {
-			title = g_strdup(_("Pick color for 2nd level text "));
+			title = g_strdup(Q_("dialog title|Pick color for 2nd level text"));
 			rgbvalue = prefs_common.quote_level2_col;
 		} else if(g_ascii_strcasecmp(type, "LEVEL3") == 0) {
-			title = g_strdup(_("Pick color for 3rd level text "));
+			title = g_strdup(Q_("dialog title|Pick color for 3rd level text"));
 			rgbvalue = prefs_common.quote_level3_col;
 		} else if(g_ascii_strcasecmp(type, "LEVEL1BG") == 0) {
-			title = g_strdup(_("Pick color for 1st level text background "));
+			title = g_strdup(Q_("dialog title|Pick color for 1st level text background"));
 			rgbvalue = prefs_common.quote_level1_bgcol;
 		} else if(g_ascii_strcasecmp(type, "LEVEL2BG") == 0) {
-			title = g_strdup(_("Pick color for 2nd level text background "));
+			title = g_strdup(Q_("dialog title|Pick color for 2nd level text background"));
 			rgbvalue = prefs_common.quote_level2_bgcol;
 		} else if(g_ascii_strcasecmp(type, "LEVEL3BG") == 0) {
-			title = g_strdup(_("Pick color for 3rd level text background "));
+			title = g_strdup(Q_("dialog title|Pick color for 3rd level text background"));
 			rgbvalue = prefs_common.quote_level3_bgcol;
 		} else if(g_ascii_strcasecmp(type, "URI") == 0) {
-			title = g_strdup(_("Pick color for links "));
+			title = g_strdup(Q_("dialog title|Pick color for links"));
 			rgbvalue = prefs_common.uri_col;
 		} else if(g_ascii_strcasecmp(type, "TGTFLD") == 0) {
 			title = g_strdup(_("Pick color for target folder"));
 			rgbvalue = prefs_common.tgt_folder_col;
 		} else if(g_ascii_strcasecmp(type, "SIGNATURE") == 0) {
-			title = g_strdup(_("Pick color for signatures "));
+			title = g_strdup(Q_("dialog title|Pick color for signatures"));
 			rgbvalue = prefs_common.signature_col;
 		} else if(g_ascii_strcasecmp(type, "NEW") == 0) {
 			title = g_strdup(_("Pick color for folder"));
--- tools/update-po.orig	2006-04-27 16:13:39.000000000 +0200
+++ tools/update-po	2006-04-27 16:15:06.000000000 +0200
@@ -33,7 +33,7 @@
 
 sources = \$(shell cat po/POTFILES.in)
 po/messages.pot: \$(sources) po/POTFILES.in
-	xgettext --keyword=N_ --keyword=_ --file=po/POTFILES.in \
+	xgettext --keyword=N_ --keyword=_ --keyword=Q_ --file=po/POTFILES.in \
 	        --output=po/messages.pot
 EOF
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.