use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
%pagestate %wikistate %renderedfiles %oldrenderedfiles
%pagesources %destsources %depends %hooks %forcerebuild
- $gettext_obj %loaded_plugins};
+ %loaded_plugins};
use Exporter q{import};
our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match
if (defined $config{locale}) {
if (POSIX::setlocale(&POSIX::LC_ALL, $config{locale})) {
$ENV{LANG}=$config{locale};
- $gettext_obj=undef;
+ define_gettext();
}
}
return "<a href=\"$bestlink\"@attrs>$linktext</a>";
}
+ sub openiduser ($) {
+ my $user=shift;
+
+ if ($user =~ m!^https?://! &&
+ eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) {
+ my $display;
+
+ if (Net::OpenID::VerifiedIdentity->can("DisplayOfURL")) {
+ # this works in at least 2.x
+ $display = Net::OpenID::VerifiedIdentity::DisplayOfURL($user);
+ }
+ else {
+ # this only works in 1.x
+ my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user);
+ $display=$oid->display;
+ }
+
+ # Convert "user.somehost.com" to "user [somehost.com]"
+ # (also "user.somehost.co.uk")
+ if ($display !~ /\[/) {
+ $display=~s/^([-a-zA-Z0-9]+?)\.([-.a-zA-Z0-9]+\.[a-z]+)$/$1 [$2]/;
+ }
+ # Convert "http://somehost.com/user" to "user [somehost.com]".
+ # (also "https://somehost.com/user/")
+ if ($display !~ /\[/) {
+ $display=~s/^https?:\/\/(.+)\/([^\/]+)\/?$/$2 [$1]/;
+ }
+ $display=~s!^https?://!!; # make sure this is removed
+ eval q{use CGI 'escapeHTML'};
+ error($@) if $@;
+ return escapeHTML($display);
+ }
+ return;
+ }
+
sub userlink ($) {
my $user=shift;
foreach my $line (split("\n", $params{content})) {
push @diff, $line if ! exists $old{$_};
}
- $params{content}=join("\n", @diff);
+ $params{diff}=join("\n", @diff);
}
my $ok;
return $file =~ m/$regexp/ && $file ne $base;
}
- sub gettext {
- # Only use gettext in the rare cases it's needed.
+ sub define_gettext () {
+ # If translation is needed, redefine the gettext function to do it.
+ # Otherwise, it becomes a quick no-op.
+ no warnings 'redefine';
if ((exists $ENV{LANG} && length $ENV{LANG}) ||
(exists $ENV{LC_ALL} && length $ENV{LC_ALL}) ||
(exists $ENV{LC_MESSAGES} && length $ENV{LC_MESSAGES})) {
- if (! $gettext_obj) {
- $gettext_obj=eval q{
+ *gettext=sub {
+ my $gettext_obj=eval q{
use Locale::gettext q{textdomain};
Locale::gettext->domain('ikiwiki')
};
- if ($@) {
- print STDERR "$@";
- $gettext_obj=undef;
+
+ if ($gettext_obj) {
+ $gettext_obj->get(shift);
+ }
+ else {
return shift;
}
- }
- return $gettext_obj->get(shift);
+ };
}
else {
- return shift;
+ *gettext=sub { return shift };
}
}
+ sub gettext {
+ define_gettext();
+ gettext(@_);
+ }
+
sub yesno ($) {
my $val=shift;
- ikiwiki (3.15) UNRELEASED; urgency=low
++ikiwiki (3.15) unstable; urgency=low
++
++ * Add new hooks: canremove, canrename, rename. (intrigeri)
++ * rename: Refactor subpage rename handling code into rename hook. (intrigeri)
++ * po: New plugin, suporting translation of wiki pages using po files.
++ (intrigeri)
++
++ -- Joey Hess <joeyh@debian.org> Tue, 02 Jun 2009 17:03:41 -0400
++
+ ikiwiki (3.14159) unstable; urgency=low
+
+ * svn: Fix rcs_rename to properly scope call to dirname.
+ * img: Pass the align parameter through to the generated img tag.
+ * Move OpenID pretty-printing from openid plugin to core (smcv)
+
+ -- Joey Hess <joeyh@debian.org> Thu, 16 Jul 2009 14:37:22 -0400
+
+ ikiwiki (3.1415) unstable; urgency=low
+
+ * img: Fix extra double quote with alt text. (smcv)
+ * Updated French debconf templates translation. Closes: #535103
+ * openid: Support Net::OpenID 2.x when pretty-printing
+ openids. (smcv)
+ * highlight: Fix utf-8 encoding bug. Closes: #535028
+
+ -- Joey Hess <joeyh@debian.org> Tue, 07 Jul 2009 16:25:05 -0400
+
+ ikiwiki (3.141) unstable; urgency=low
* comment: Make comment directives no longer use the internal "_comment"
form, and document the comment directive syntax.
name, to support several cases including mercurial's long user
names on the RecentChanges page, and urls with spaces being handled
by the 404 plugin.
- * Add new hooks: canremove, canrename, rename. (intrigeri)
- * rename: Refactor subpage rename handling code into rename hook. (intrigeri)
- * po: New plugin, suporting translation of wiki pages using po files.
- (intrigeri)
+ * Optimise use of gettext, and avoid ugly warnings if Locale::gettext
+ is not available. Closes: #532285
+ * meta: Add openid delegate parameter to allow delegating only
+ openid or openid2.
+ * Disable the Preferences link if no plugin with an auth hook is enabled.
+ * Updated French translation. Closes: #532654
+ * aggregate: Fix storing of changed md5.
+ * aggregate: Avoid resetting ctime when an item md5 changes.
- -- Joey Hess <joeyh@debian.org> Tue, 02 Jun 2009 17:03:41 -0400
+ -- Joey Hess <joeyh@debian.org> Fri, 12 Jun 2009 19:50:46 -0400
ikiwiki (3.14) unstable; urgency=low