summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/po.pm22
1 files changed, 14 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 351b9c155..941f5629d 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -51,16 +51,22 @@ sub targetpage (@) { #{{{
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 . "." . $ext . "." . $lang;
+ }
+ else {
+ return $masterpage . "/index." . $ext . "." . $lang;
+ }
}
else {
- return $masterpage."/index.".$ext.".".$lang;
+ if (! $config{usedirs} || $page eq 'index') {
+ return $page . "." . $ext . "." . $config{po_master_language}{code};
+ }
+ else {
+ return $page . "/index." . $ext . "." . $config{po_master_language}{code};
+ }
}
} #}}}