diff options
-rw-r--r-- | IkiWiki/Plugin/po.pm | 15 | ||||
-rw-r--r-- | doc/basewiki/index.mdwn | 2 | ||||
-rw-r--r-- | doc/plugins/po.mdwn | 11 |
3 files changed, 16 insertions, 12 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 0ae4adcfc..e9dc9dd8c 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -827,6 +827,21 @@ sub refreshpofiles ($@) { foreach my $pofile (@pofiles) { IkiWiki::prep_writefile(basename($pofile),dirname($pofile)); + + if (! -e $pofile) { + # If the po file exists in an underlay, copy it + # from there. + my ($pobase)=$pofile=~/^\Q$config{srcdir}\E\/?(.*)$/; + foreach my $dir (@{$config{underlaydirs}}) { + if (-e "$dir/$pobase") { + File::Copy::syscopy("$dir/$pobase",$pofile) + or error("po(refreshpofiles) ". + sprintf(gettext("failed to copy underlay PO file to %s"), + $pofile)); + } + } + } + if (-e $pofile) { system("msgmerge", "--previous", "-q", "-U", "--backup=none", $pofile, $potfile) == 0 or error("po(refreshpofiles) ". diff --git a/doc/basewiki/index.mdwn b/doc/basewiki/index.mdwn index 05834e079..4187c1162 100644 --- a/doc/basewiki/index.mdwn +++ b/doc/basewiki/index.mdwn @@ -4,4 +4,4 @@ All wikis are supposed to have a [[SandBox]], so this one does too. ---- -This wiki is powered by [ikiwiki](http://ikiwiki.info/). +This wiki is powered by [[ikiwiki]]. diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 0c8110563..2fbf67016 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -277,17 +277,6 @@ That used to be so, but the bug was fixed. Does this mean that po might be replacing the only link on a page, in error? --[[Joey]] -Bug when editing underlay file ------------------------------- - -While I've gotten translated underlays working, there is a bug -if the wiki is currently using a page from the underlay, and the master -language version is edited. This causes the edited page to be saved -to srcdir.. and all the translations get set to 0% and their -po files have the translated strings "emptied". What's really going on -is that these are entirely new po files not based on the old ones -in the basewiki, and thus lacking translations. --[[Joey]] - Documentation ------------- |