[NUUG fiksgatami] [patch] Make more strings translatable in fixmystreet

Matthew Somerville matthew at mysociety.org
Tue Jan 27 12:25:45 CET 2009


Petter Reinholdtsen wrote:
> Note that I just discovered that this part of the patch is incorrect.
> Variables are expacted before the translated string is looked up, not
> after.  I'll make and test a new patch.

The normal way to do this is to use sprintf(), e.g.
   sprintf(_("Your name is %s"), $name);
or
   sprintf(nget("%d report in past week", "%d reports in past week", 
$n), $n);

As with that example, could you please use the correct Locale::gettext 
nget() function for dealing with strings that vary depending upon 
plurals, as not all languages are simply N != 1.

ATB,
Matthew


More information about the fiksgatami mailing list