[Geany-Devel] [geany/geany] d270e6: Parse compiler provided build date to use the translatable date format string

Colomban Wendling lists.ban at xxxxx
Sun Mar 17 16:42:00 UTC 2013


Le 17/03/2013 17:17, Christian Dywan a écrit :
> Branch:      refs/heads/master
> Author:      Christian Dywan <christian at twotoasts.de>
> Committer:   Enrico Tröger <enrico.troeger at uvena.de>
> Date:        Sun, 17 Mar 2013 16:17:09 UTC
> Commit:      d270e6c69082d114901af23b756a3375a5b5ce23
>              https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce23
> 
> Log Message:
> -----------
> Parse compiler provided build date to use the translatable date format string

I have a system with LANG=fr_FR.UTF-8.

Opening the about dialog with LANG=C results in:


(geany:23003): GLib-WARNING **:
/tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
converting results of strftime to UTF-8: Invalid byte sequence in
conversion input


(geany:23003): GLib-WARNING **:
/tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
converting results of strftime to UTF-8: Invalid byte sequence in
conversion input


(geany:23003): GLib-WARNING **:
/tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
converting results of strftime to UTF-8: Invalid byte sequence in
conversion input


(geany:23003): GLib-WARNING **:
/tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
converting results of strftime to UTF-8: Invalid byte sequence in
conversion input


(geany:23003): GLib-WARNING **:
/tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
converting results of strftime to UTF-8: Invalid byte sequence in
conversion input


(geany:23003): GLib-WARNING **:
/tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
converting results of strftime to UTF-8: Invalid byte sequence in
conversion input




And opening it without changing the LANG results in:


(geany:23294): Gtk-WARNING **: Failed to set text from markup due to
error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8
non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou
ultérieurement) » n'est pas valide

(geany:23294): Gtk-WARNING **: Failed to set text from markup due to
error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8
non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou
ultérieurement) » n'est pas valide

(geany:23294): Gtk-WARNING **: Failed to set text from markup due to
error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8
non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou
ultérieurement) » n'est pas valide



> 
> 
> Modified Paths:
> --------------
>     src/about.c
> 
> Modified: src/about.c
> 8 files changed, 7 insertions(+), 1 deletions(-)
> ===================================================================
> @@ -31,6 +31,7 @@
>  #include "support.h"
>  #include "geanywraplabel.h"
>  #include "main.h"
> +#include "templates.h"
>  
>  #include "gb.c"
>  
> @@ -152,6 +153,8 @@ static GtkWidget *create_dialog(void)
>  	gchar buffer[512];
>  	gchar buffer2[128];
>  	guint i, row = 0;
> +	struct tm builddate_tm;
> +	char builddate_local[255];
>  
>  	dialog = gtk_dialog_new();
>  
> @@ -224,7 +227,10 @@ static GtkWidget *create_dialog(void)
>  	gtk_label_set_justify(GTK_LABEL(builddate_label), GTK_JUSTIFY_CENTER);
>  	gtk_label_set_selectable(GTK_LABEL(builddate_label), TRUE);
>  	gtk_label_set_use_markup(GTK_LABEL(builddate_label), TRUE);
> -	g_snprintf(buffer2, sizeof(buffer2), _("(built on or after %s)"), __DATE__);
> +	memset(&builddate_tm, 0, sizeof(struct tm));
> +	strptime(__DATE__, "%b %d %Y", &builddate_tm);
> +	strftime(builddate_local, sizeof(builddate_local), GEANY_TEMPLATES_FORMAT_DATE, &builddate_tm);
> +	g_snprintf(buffer2, sizeof(buffer2), _("(built on or after %s)"), builddate_local);
>  	g_snprintf(buffer, sizeof(buffer), BUILDDATE, buffer2);
>  	gtk_label_set_markup(GTK_LABEL(builddate_label), buffer);
>  	gtk_misc_set_padding(GTK_MISC(builddate_label), 2, 2);
> 
> 
> 
> --------------
> This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
> _______________________________________________
> Commits mailing list
> Commits at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/commits
> 



More information about the Devel mailing list