+} #}}}
+
+sub match_istranslatable ($;@) { #{{{
+ my $page=shift;
+ my $wanted=shift;
+
+ my %params=@_;
+ my $file=exists $params{file} ? $params{file} : $pagesources{$page};
+ if (! defined $file) {
+ return IkiWiki::FailReason->new("no file specified");
+ }
+
+ if (defined pagetype($file) && pagetype($file) eq 'po') {
+ return IkiWiki::FailReason->new("is a PO file");
+ }
+ if ($file =~ /\.pot$/) {
+ return IkiWiki::FailReason->new("is a POT file");
+ }
+
+ foreach my $registering_page (keys %pagestate) {
+ if (exists $pagestate{$registering_page}{po_translatable}) {
+ foreach my $pagespec (sort keys %{$pagestate{$registering_page}{po_translatable}}) {
+ if (pagespec_match($page, $pagespec, location => $registering_page)) {
+ return IkiWiki::SuccessReason->new("is set as translatable on $registering_page");
+ }
+ }
+ }
+ }