- # build %translations, using istranslation's side-effect
- foreach my $page (keys %pagesources) {
- istranslation($page);
- }
-
- # refresh/create POT and PO files as needed
- my $updated_po_files=0;
- foreach my $page (keys %pagesources) {
- my $pageneedsbuild = grep { $_ eq $pagesources{$page} } @$needsbuild;
- if (istranslatable($page)) {
- my $file=srcfile($pagesources{$page});
- if ($pageneedsbuild || ! -e potfile($file)) {
- refreshpot($file);
- }
- my @pofiles;
- foreach my $lang (keys %{$config{po_slave_languages}}) {
- my $pofile=pofile($file, $lang);
- if ($pageneedsbuild || ! -e $pofile) {
- push @pofiles, $pofile;
- }
- }
- if (@pofiles) {
- refreshpofiles($file, @pofiles) ;
- map { IkiWiki::rcs_add($_); } @pofiles if ($config{rcs});
- $updated_po_files = 1;
- }
- }
- }
-
- # check staged changes in and trigger a wiki refresh.
- if ($updated_po_files) {
- if ($config{rcs}) {
- IkiWiki::disable_commit_hook();
- IkiWiki::rcs_commit_staged(gettext("updated PO files"),
- "refreshpofiles", "127.0.0.1");
- IkiWiki::enable_commit_hook();
- IkiWiki::rcs_update();
- }
- IkiWiki::refresh();
- IkiWiki::saveindex();
- # refresh module's private variables
- undef %filtered;
- undef %translations;
- foreach my $page (keys %pagesources) {
- istranslation($page);
- }
- }