aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Rojas <jerojasro@devnull.li>2010-07-19 01:11:28 -0500
committerJavier Rojas <jerojasro@devnull.li>2010-07-19 01:11:28 -0500
commit194817b63d2241e8764f01ad64a2aaaa0b6bf5b3 (patch)
tree7e6ed4db598577081d27617be76f530ff635f78d
parentcfed58f2908886c222c7305b1be4044de800fc6d (diff)
parent0ddc89123ebfa6b3b763e1a918b6d38282cee625 (diff)
downloadikiwiki-194817b63d2241e8764f01ad64a2aaaa0b6bf5b3.tar
ikiwiki-194817b63d2241e8764f01ad64a2aaaa0b6bf5b3.tar.gz
Merge branch 'master' of git://git.ikiwiki.info
-rw-r--r--IkiWiki.pm11
-rw-r--r--IkiWiki/Plugin/po.pm13
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/404_plugin_and_lighttpd.mdwn2
-rw-r--r--doc/plugins/404.mdwn4
-rw-r--r--doc/plugins/po.mdwn14
-rw-r--r--doc/todo/Fix_selflink_in_po_plugin.mdwn2
-rw-r--r--doc/users/weakish.mdwn2
8 files changed, 41 insertions, 8 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 2cf0ad819..0c0b7bd4c 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1118,6 +1118,15 @@ sub urlto ($$;$) {
return beautify_urlpath($link);
}
+sub isselflink ($$) {
+ # Plugins can override this function to support special types
+ # of selflinks.
+ my $page=shift;
+ my $link=shift;
+
+ return $page eq $link;
+}
+
sub htmllink ($$$;@) {
my $lpage=shift; # the page doing the linking
my $page=shift; # the page that will contain the link (different for inline)
@@ -1143,7 +1152,7 @@ sub htmllink ($$$;@) {
}
return "<span class=\"selflink\">$linktext</span>"
- if length $bestlink && $page eq $bestlink &&
+ if length $bestlink && isselflink($page, $bestlink) &&
! defined $opts{anchor};
if (! $destsources{$bestlink}) {
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 903a9500f..224412676 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -64,6 +64,8 @@ sub import {
inject(name => "IkiWiki::cgiurl", call => \&mycgiurl);
$origsubs{'rootpage'}=\&IkiWiki::rootpage;
inject(name => "IkiWiki::rootpage", call => \&myrootpage);
+ $origsubs{'isselflink'}=\&IkiWiki::isselflink;
+ inject(name => "IkiWiki::isselflink", call => \&myisselflink);
}
}
@@ -675,6 +677,17 @@ sub myrootpage (@) {
return $rootpage;
}
+sub myisselflink ($$) {
+ my $page=shift;
+ my $link=shift;
+
+ return 1 if $origsubs{'isselflink'}->($page, $link);
+ if (istranslation($page)) {
+ return $origsubs{'isselflink'}->(masterpage($page), $link);
+ }
+ return;
+}
+
# ,----
# | Blackboxes for private data
# `----
diff --git a/debian/changelog b/debian/changelog
index b7387a050..db828f580 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,7 @@ ikiwiki (3.20100705) UNRELEASED; urgency=low
* Made much more robust in cases where multiple source files produce
conflicting files/directories in the destdir.
* Updated French program translation from Philippe Batailler. Closes: #589423
+ * po: Fix selflink display on tranlsated pages. (intrigeri)
-- Joey Hess <joeyh@debian.org> Mon, 05 Jul 2010 13:59:42 -0400
diff --git a/doc/bugs/404_plugin_and_lighttpd.mdwn b/doc/bugs/404_plugin_and_lighttpd.mdwn
index ffbad8add..e478d98c3 100644
--- a/doc/bugs/404_plugin_and_lighttpd.mdwn
+++ b/doc/bugs/404_plugin_and_lighttpd.mdwn
@@ -1,4 +1,4 @@
-Lighttpd apparently sets REDIRECT_STATUS=200 for the server.error-handler-404 page. This breaks the 404 plugin which checks this variable for 404 before processing the URI. It also doesn't seem to set REDIRECT_URL.
+Lighttpd apparently sets REDIRECT_STATUS=200 for the server.error-handler-404 page. This breaks the [[plugins/404]] plugin which checks this variable for 404 before processing the URI. It also doesn't seem to set REDIRECT_URL.
I was able to fix my server to check the REQUEST_URI for ikiwiki.cgi and to continue processing if it was not found, passing $ENV{SEVER_NAME} . $ENV{REQUEST_URI} as the first parameter to cgi_page_from_404. However, my perl is terrible and I just made it work rather than figuring out exactly what to do to get it to work on both lighttpd and apache.
diff --git a/doc/plugins/404.mdwn b/doc/plugins/404.mdwn
index 53dace3c9..bf033202a 100644
--- a/doc/plugins/404.mdwn
+++ b/doc/plugins/404.mdwn
@@ -13,8 +13,4 @@ file:
(The path here needs to be whatever the path is to the ikiwiki.cgi from
the root of your web server.)
-Or put something like this in the wiki's Lighttpd (>=1.4.17) configuration file:
-
- server.error-handler-404 = "/ikiwiki.cgi"
-
diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn
index 2dc5ffdc8..53327c1da 100644
--- a/doc/plugins/po.mdwn
+++ b/doc/plugins/po.mdwn
@@ -297,6 +297,10 @@ to an array to support this. (If twere done, twere best done quickly.)
>>> Joey, which of these solutions do you prefer? Or another one?
>>> I tend to prefer the last one. --[[intrigeri]]
+>>>> I prefer the pipe separator, I think. I'm concerned that there is
+>>>> no way to really sanely represent complex data structures in web
+>>>> setup. --[[Joey]]
+
Pagespecs
---------
@@ -351,6 +355,16 @@ update. --[[Joey]]
> * The ENCODING\n part is due to an inconsistency in po4a, which
> I've just send a patch for. --[[intrigeri]]
+New pages not translatable
+--------------------------
+
+Today I added a new English page to l10n.ikiwiki.info. When I saved,
+the page did not have the translation links at the top. I waited until
+the po plugin had, in the background, created the po files, and refreshed;
+still did not see the translation links. Only when I touched the page
+source and refreshed did it finally add the translation links.
+I can reproduce this bug in a test site. --[[Joey]]
+
Ugly messages with empty files
------------------------------
diff --git a/doc/todo/Fix_selflink_in_po_plugin.mdwn b/doc/todo/Fix_selflink_in_po_plugin.mdwn
index c4f6662ce..b276c075d 100644
--- a/doc/todo/Fix_selflink_in_po_plugin.mdwn
+++ b/doc/todo/Fix_selflink_in_po_plugin.mdwn
@@ -5,7 +5,7 @@ isn't. --[[intrigeri]]
Fixed in my po branch. --[[intrigeri]]
-[[!tag patch]]
+[[!tag patch done]]
> bump?
diff --git a/doc/users/weakish.mdwn b/doc/users/weakish.mdwn
index 30a14d303..a5f252e75 100644
--- a/doc/users/weakish.mdwn
+++ b/doc/users/weakish.mdwn
@@ -1,3 +1,3 @@
email: weakish@gmail.com
-openid: <http://weakish.pigro.net>
+website: <http://weakish.github.com>