[pmwiki-users] New {$$ } and {( )} markups [Was: Can any of the form recipes do this?]
Patrick R. Michaud
pmichaud at pobox.com
Tue Apr 3 20:17:09 CDT 2007
On Tue, Apr 03, 2007 at 07:29:16PM -0400, The Editor wrote:
> On 4/3/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >Also, strftime has the advantage that with i18n it produces date
> >information formatted for languages other than English. For
> >example, if a site is configured for German, then the above
> >would produce:
> >
> > {(time %B {$Name})} # März
> > {(time %A {$Name})} # Donnerstag
> >
> > {(time %c {$Name})} # Do 15 Mär 2007 00:00:00 CDT
>
> Once again though the ZAP markup approach is much easier than trying
> to set locales and all that. At least from what I could read of it...
There's absolutely *zero* difference in the two approaches in terms
of site configuration.
If a site is using internationalization (i18n) as given in the
PmWiki.Internationalizations page, then PmWiki will have already
taken care of setting the locale for the admin. The local is set
automatically when the administrator switches the site to a
different language -- usually this is a simple call to XLPage().
For example, to switch a site's prompts to German, an administrator
simply installs the i18n-de.zip package and then does
XLPage('de', 'PmWikiDe.XLPage');
Once a site has done this, no extra configuration is required to get
non-English dates and times to work -- any dates and times produced
using strftime() will _automatically_ appear in whatever language the
administrator has chosen. To see this at work, take a look at
the dates and times on each of:
http://www.pmwiki.org/wiki/PmWikiFr/RecentChanges
http://www.pmwiki.org/wiki/PmWikiPtBr/RecentChanges
http://www.pmwiki.org/wiki/PmWikiEs/RecentChanges
http://www.pmwiki.org/wiki/PmWikiRo/RecentChanges
None of these require any special configuration beyond calling the
XLPage() function used to configure the site prompts.
But if a markup or system uses PHP's date() function to format
dates and times, then all one gets is English dates, period.
So, since there's zero additional configuration required by a site
admin to get non-English dates using strftime(), it seems to me
that it's the obvious way to go.
Pm
More information about the pmwiki-users
mailing list