From: Frederic Marchal Date: Mon, 22 Dec 2014 13:00:43 +0000 (+0100) Subject: Translatable "generated by" message X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d230c53e9acbc78935b5ecca00f391d7174b16f5;p=thirdparty%2Fsarg.git Translatable "generated by" message The string telling the user what program produced the report and when was not easy to translate because it was split in pieces. --- diff --git a/smartfilter.c b/smartfilter.c index cea5751..a0eb8a4 100644 --- a/smartfilter.c +++ b/smartfilter.c @@ -33,6 +33,7 @@ void smartfilter_report(void) char buf[MAXLEN]; char url[MAXLEN]; + char pgmurl[250]; char csort[255]; char smart_in[MAXLEN]; char smart_ou[MAXLEN]; @@ -114,6 +115,7 @@ void smartfilter_report(void) fputs("\n",fp_ou); fputs("\n",fp_ou); fprintf(fp_ou,"%s%s%s%s%s\n",HeaderBgColor,FontSize,_("USERID"),HeaderBgColor,FontSize,_("IP/NAME"),HeaderBgColor,FontSize,_("DATE/TIME"),HeaderBgColor,FontSize,_("ACCESSED SITE"),HeaderBgColor,FontSize,_("SMARTFILTER")); + snprintf(pgmurl,sizeof(pgmurl),"%s-%s",URL,PGM,VERSION); while(fgets(buf,sizeof(buf),fp_in)!=NULL) { getword_start(&gwarea,buf); @@ -137,7 +139,12 @@ void smartfilter_report(void) fputs("\n",fp_user); if(ShowSargInfo) { zdate(ftime, sizeof(ftime), DateFormat); - fprintf(fp_user,"

%s %s-%s %s %s
\n",_("Generated by"),URL,PGM,VERSION,_("on"),ftime); + fputs("

",fp_user); + /* TRANSLATORS: The first %s is an html tag with a link to the sarg + * website. The second %s is the report generation time. + */ + fprintf(fp_user,_("Generated by %s on %s"),pgmurl,ftime); + fputs("
\n",fp_user); } fputs("\n\n",fp_user); fclose(fp_user); @@ -191,7 +198,9 @@ void smartfilter_report(void) if(ShowSargInfo) { zdate(ftime, sizeof(ftime), DateFormat); - fprintf(fp_ou,"

%s %s-%s %s %s
\n",_("Generated by"),URL,PGM,VERSION,_("on"),ftime); + fputs("

",fp_ou); + fprintf(fp_ou,_("Generated by %s on %s"),pgmurl,ftime); + fputs("
\n",fp_ou); } fputs("\n\n",fp_user); @@ -201,7 +210,9 @@ void smartfilter_report(void) fputs("\n",fp_user); if(ShowSargInfo) { zdate(ftime, sizeof(ftime), DateFormat); - fprintf(fp_user,"

%s %s-%s %s %s
\n",_("Generated by"),URL,PGM,VERSION,_("on"),ftime); + fputs("

",fp_user); + fprintf(fp_user,_("Generated by %s on %s"),pgmurl,ftime); + fputs("
\n",fp_user); } fputs("\n\n",fp_user); fclose(fp_user); diff --git a/util.c b/util.c index fa50221..0365c59 100644 --- a/util.c +++ b/util.c @@ -1656,10 +1656,14 @@ char *get_size(const char *path, const char *file) void show_info(FILE *fp_ou) { char ftime[127]; + char pgmurl[250]; if(!ShowSargInfo) return; zdate(ftime, sizeof(ftime), DateFormat); - fprintf(fp_ou,"
%s %s-%s %s %s
\n",_("Generated by"),URL,PGM,VERSION,_("on"),ftime); + fputs("
",fp_ou); + snprintf(pgmurl,sizeof(pgmurl),"%s-%s",URL,PGM,VERSION); + fprintf(fp_ou,_("Generated by %s on %s"),pgmurl,ftime); + fputs("
\n",fp_ou); } void show_sarg(FILE *fp_ou, int depth)