diff options
-rw-r--r-- | IkiWiki/Plugin/po.pm | 22 | ||||
-rw-r--r-- | doc/plugins/po.mdwn | 9 |
2 files changed, 19 insertions, 12 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}; + } } } #}}} diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 6690e5dea..326a6f39f 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -15,7 +15,7 @@ a "master" page, and is written in any supported format but PO. Example: `bla/page.mdwn` is a "master" Markdown page written in English; if `usedirs` is enabled, it is rendered as -`bla/page/index.html`, else as `bla/page.html`. +`bla/page/index.html.en`, else as `bla/page.html.en`. Translations of a "master" page into a "slave" language are called "slave" pages, and is a in gettext PO format. PO is thus promoted to @@ -56,9 +56,10 @@ default Debian Apache configuration. When `usedirs` is enabled, one has to set `DirectoryIndex index` for the wiki context. -Setting `DefaultLanguage LL` for the wiki context can be needed, to -ensure `bla/page/index.html` is served as `Content-Language: LL` -(replace `LL` with your default MIME language). +Setting `DefaultLanguage LL` (replace `LL` with your default MIME +language) for the wiki context can be needed, to ensure +`bla/page/index.html.en` is served as `Content-Language: LL`. +**FIXME**: is it still needed with the new `.html.en` naming convention? lighttpd -------- |