[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Quote usage in gettexted WML

On Thu, Aug 18, 2011 at 10:42:51AM +0200, Gerfried Fuchs wrote:
> * Jeroen Schot <schot@A-Eskwadraat.nl> [2011-08-16 17:35:32 CEST]:
> > The files english/template/debian/{stat_tags,legal}.wml contain
> > constructs like:
> > 
> >     <: printf '<gettext domain="stats">...</gettext>', %0 :>
> > 
> > Note the single quotation marks ('). This causes breakage when the
> > translated string also contains single quotation marks. I recently
> > encountered this when trying to enable the Dutch translation for
> > devel/website/stats. I think the right solutions is to simply replace
> > the single quotation marks with double quotation marks.
> > 
> > I have attached a patch that does this. I can commit it myself if
> > there are no objections to it, but would be more confident if a
> > regular committer would do this.
>  Wouldn't that then instead break if the translated string contains
> double quotation marks, or more of an issue, $ or % or such?  Did you
> try to escape the single quote in the translated string with an \
> infront of it for that purpose (maybe double \\ needed to carry it
> over).

I don't think you can put unescaped double quotation marks in gettext
strings because they are delimited by double quotation marks in the po
file. Other files already use the same format, see
english/template/debian/wnpp.wml for example.

I haven't tried to escape the single quote in these strings because
that would be inconsistent: Unescaped single qoute can (and must?) be
used in all other gettext strings, even in the same po file. Example
from french/po/stats.fr.po:

	#: ../../stattrans.pl:209
	msgid "The original is newer than this translation"
	msgstr "L'original est plus récent que sa traduction"

Jeroen Schot

Reply to: