+sub file_pruned ($$) { #{{{
+ require File::Spec;
+ my $file=File::Spec->canonpath(shift);
+ my $base=File::Spec->canonpath(shift);
+ $file=~s#^\Q$base\E/*##;
+
+ my $regexp='('.join('|', @{$config{wiki_file_prune_regexps}}).')';
+ $file =~ m/$regexp/;
+} #}}}
+
+sub gettext { #{{{
+ # Only use gettext in the rare cases it's needed.
+ # This overrides future calls of this function.
+ if (exists $ENV{LANG} || exists $ENV{LC_ALL} || exists $ENV{LC_MESSAGES}) {
+ eval q{use Locale::gettext};
+ textdomain('ikiwiki');
+ return Locale::gettext::gettext(shift);
+ }
+ else {
+ return shift;
+ }
+} #}}}
+