example => "!*/Discussion",
description => "PageSpec controlling which pages are translatable",
link => "ikiwiki/PageSpec",
- safe => 0,
+ safe => 1,
rebuild => 1,
},
po_link_to => {
type => "string",
example => "current",
description => "internal linking behavior (default/current/negotiated)",
- safe => 0,
+ safe => 1,
rebuild => 1,
},
} #}}}
}
map {
islanguagecode($_)
- or error(sprintf(gettext("%s is not a valid language code"), $_));
+ or error(sprintf(gettext("%s is not a valid language code"), $_));
} ($config{po_master_language}{code}, keys %{$config{po_slave_languages}});
- if (! exists $config{po_link_to} ||
- ! defined $config{po_link_to}) {
- $config{po_link_to}="default";
- }
if (! exists $config{po_translatable_pages} ||
! defined $config{po_translatable_pages}) {
$config{po_translatable_pages}="";
}
- if ($config{po_link_to} eq "negotiated" && ! $config{usedirs}) {
- error(gettext("po_link_to=negotiated requires usedirs to be set"));
+ if (! exists $config{po_link_to} ||
+ ! defined $config{po_link_to}) {
+ $config{po_link_to}='default';
+ }
+ elsif (! grep {
+ $config{po_link_to} eq $_
+ } ('default', 'current', 'negotiated')) {
+ warn(sprintf(gettext('po_link_to=%s is not a valid setting, falling back to po_link_to=default'),
+ $config{po_link_to}));
+ $config{po_link_to}='default';
+ }
+ elsif ($config{po_link_to} eq "negotiated" && ! $config{usedirs}) {
+ warn(gettext('po_link_to=negotiated requires usedirs to be enabled, falling back to po_link_to=default'));
+ $config{po_link_to}='default';
}
push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/;
} #}}}
}
}
if (@pofiles) {
- refreshpofiles($file, @pofiles) ;
+ refreshpofiles($file, @pofiles);
map { IkiWiki::rcs_add($_); } @pofiles if ($config{rcs});
$updated_po_files = 1;
}