my $page=$params{page};
my $ext=$params{ext};
- if (! IkiWiki::PageSpec::match_istranslation($page, $page)) {
- return;
- }
-
- my ($masterpage, $lang) = ($page =~ /(.*)[.]([a-z]{2})$/);
- if (! $config{usedirs} || $page eq 'index') {
- return $masterpage.".".$ext.".".$lang;
+ if (IkiWiki::PageSpec::match_istranslation($page, $page)) {
+ my ($masterpage, $lang) = ($page =~ /(.*)[.]([a-z]{2})$/);
+ if (! $config{usedirs} || $page eq 'index') {
+ return $masterpage . "." . $lang . "." . $ext;
+ }
+ else {
+ return $masterpage . "/index." . $lang . "." . $ext;
+ }
}
else {
- return $masterpage."/index.".$ext.".".$lang;
+ if (! $config{usedirs} || $page eq 'index') {
+ return $page . "." . $config{po_master_language}{code} . "." . $ext;
+ }
+ else {
+ return $page . "/index." . $config{po_master_language}{code} . "." . $ext;
+ }
}
} #}}}