]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Make currentlang() usable when po is not enabled, so it can be used in example blog... currentlang
authorJoey Hess <joey@kitenet.net>
Mon, 13 Sep 2010 19:12:07 +0000 (15:12 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 13 Sep 2010 19:12:07 +0000 (15:12 -0400)
IkiWiki.pm
IkiWiki/Plugin/po.pm
debian/changelog
doc/ikiwiki/pagespec.mdwn

index 6da281999f0b4c035805626f11d6e244c105d69f..87e03468ae557bc3996205f62040bc4e00597a54 100644 (file)
@@ -2628,6 +2628,10 @@ sub match_ip ($$;@) {
        }
 }
 
+sub match_currentlang ($$;@) {
+       return 1; # stub
+}
+
 package IkiWiki::SortSpec;
 
 # This is in the SortSpec namespace so that the $a and $b that sort() uses
index a79e7d7f0ee56f579ff4e261cd97028533de3099..7626fec7e07018a761e7f85f264a8ae47a3d76b6 100644 (file)
@@ -1305,6 +1305,7 @@ sub match_lang ($$;@) {
        }
 }
 
+no warnings 'redefine'; # overriding stub version
 sub match_currentlang ($$;@) {
        my $page=shift;
        shift;
@@ -1322,6 +1323,7 @@ sub match_currentlang ($$;@) {
                return IkiWiki::FailReason->new("file language is $lang, whereas current language is $currentlang");
        }
 }
+use warnings 'redefine';
 
 sub match_needstranslation ($$;@) {
        my $page=shift;
index 3428aa6d395b3b11780e800449ee1eab24754927..8f4f7e1bdce2bd2503c117069a3ca5e9cc3ff078 100644 (file)
@@ -17,6 +17,8 @@ ikiwiki (3.20100832) UNRELEASED; urgency=low
     information earlier than the delete hook.
   * actiontabs: Improve tab padding.
   * blueview: Fix display of links to translated pages in the page header.
+  * Make currentlang() usable when po is not enabled, so it can be used
+    in example blog's PageSpecs.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 07 Sep 2010 12:08:05 -0400
 
index 6aec561ae7f34ff986792cac4b3f38679a9d8cfb..0c4b1893be6ef6e414da18b4576d5e39746e70a1 100644 (file)
@@ -55,6 +55,8 @@ Some more elaborate limits can be added to what matches using these functions:
 * "`comment_pending(glob)`" - matches unmoderated, pending comments.
 * "`postcomment(glob)`" - matches only when comments are being 
   posted to a page matching the specified glob
+* "`currentlang()`" - always matches, unless [[translation|po]] is
+  enabled
 
 For example, to match all pages in a blog that link to the page about music
 and were written in 2005: