- 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;
+ }