From 1610b1e9e6ebfd84ff6c7ccad0839cca06ccae42 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 Jul 2009 12:38:40 +0200 Subject: [PATCH 1/4] update --- IkiWiki/Plugin/po.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 6aacca53a..2060ff208 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -152,13 +152,19 @@ sub checkconfig () { push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/; # Translated versions of the underlays are added if available. - foreach my $underlay ("basewiki", map { m/^\Q$config{underlaydirbase}\E\/*(.*)/ } reverse @{$config{underlaydirs}}) { + foreach my $underlay ("basewiki", + map { m/^\Q$config{underlaydirbase}\E\/*(.*)/ } + reverse @{$config{underlaydirs}}) { next if $underlay=~/^locale\//; - # Add underlays containing the po files for slave languages. + # Underlay containing pot files. + add_underlay("locale/pot/$underlay") + if -d "$config{underlaydirbase}/locale/pot/$underlay"; + + # Underlays containing the po files for slave languages. foreach my $ll (keys %{$config{po_slave_languages}}) { - add_underlay("locale/mo/$underlay") - if -d "$config{underlaydirbase}/locale/mo/$underlay"; + add_underlay("locale/po/$ll/$underlay") + if -d "$config{underlaydirbase}/locale/po/$ll/$underlay"; } if ($config{po_master_language}{code} ne 'en') { From cebffa917fa39f45b3a7cff51b93a4e548343db8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 Jul 2009 12:39:21 +0200 Subject: [PATCH 2/4] improve invalid gettext message (and gettext it as translators will see this!) --- IkiWiki/Plugin/po.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 2060ff208..d65b4288d 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -1094,8 +1094,8 @@ sub isvalidpo ($) { if ($res) { return IkiWiki::SuccessReason->new("valid gettext data"); } - return IkiWiki::FailReason->new("invalid gettext data, go back ". - "to previous page to go on with edit"); + return IkiWiki::FailReason->new(gettext("invalid gettext data, go back ". + "to previous page to continue edit")); } # ,---- From 637f32480cf8b21009de4d8a83f00a9a3cc04ecd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 Jul 2009 12:40:44 +0200 Subject: [PATCH 3/4] turn off pot file underlay again --- IkiWiki/Plugin/po.pm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index d65b4288d..70d678897 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -157,10 +157,6 @@ sub checkconfig () { reverse @{$config{underlaydirs}}) { next if $underlay=~/^locale\//; - # Underlay containing pot files. - add_underlay("locale/pot/$underlay") - if -d "$config{underlaydirbase}/locale/pot/$underlay"; - # Underlays containing the po files for slave languages. foreach my $ll (keys %{$config{po_slave_languages}}) { add_underlay("locale/po/$ll/$underlay") From 8effd4885464ea0fc974c304453066ad5daafbf9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 Jul 2009 12:43:48 +0200 Subject: [PATCH 4/4] one issue with basewiki translations --- doc/plugins/po.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 36b44cd7f..f69f84ae9 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -268,6 +268,17 @@ 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 -------------