[katello-devel] How to format strings

Og Maciel omaciel at redhat.com
Fri Sep 21 13:24:51 UTC 2012


----- Original Message -----
> From: "Justin Sherrill" <jsherril at redhat.com>
> To: katello-devel at redhat.com
> Sent: Friday, September 21, 2012 9:13:25 AM
> Subject: Re: [katello-devel] How to format strings
> 
> >> Please if you are writing string, which you are passing to gettext
> >> function (aka _()), then user rather this notation:
> >>
> >> _("Couldn't find changeset '%s'") % params[:id]
> >>
> >> or
> >>
> >> _("Couldn't find changeset '%s' and '%s'") % [params[:id], foo]

Minor suggestion: escape quotes within the string itself

 _("Couldn't find changeset \"%s\"") % params[:id]

and 

_("Couldn't find changeset \"%s\" and \"%s\"") % [params[:id], foo]

Cheers,
-- 
Og Maciel

Senior QA Engineer
Red Hat, Inc.
+1.646.707.7723
irc: omaciel




More information about the katello-devel mailing list