+
+ # Translated versions of the underlays are added if available.
+ foreach my $underlay ("basewiki",
+ map { m/^\Q$config{underlaydirbase}\E\/*(.*)/ }
+ reverse @{$config{underlaydirs}}) {
+ next if $underlay=~/^locale\//;
+
+ # Underlays containing the po files for slave languages.
+ foreach my $ll (keys %{$config{po_slave_languages}}) {
+ add_underlay("po/$ll/$underlay")
+ if -d "$config{underlaydirbase}/po/$ll/$underlay";
+ }
+
+ if ($config{po_master_language}{code} ne 'en') {
+ # Add underlay containing translated source files
+ # for the master language.
+ add_underlay("locale/$config{po_master_language}{code}/$underlay");
+ }
+ }