centralkey: Key:centralkey
change: Key:change
change:lanes: Key:change:lanes
+ changesets_count: ChangesetKey:changesets count
changing_table: Key:changing table
changing_table:adult: Key:changing table:adult
changing_table:count: Key:changing table:count
horse_scale: Key:horse scale
hospital:level:CN: Key:hospital:level:CN
hospital:level:DE: Key:hospital:level:DE
+ host: Key:host
hot_water: Key:hot water
house: Key:house
hov: Key:hov
memorial:subject:wikidata: Key:memorial:subject:wikidata
memorial:subject:wikipedia: Key:memorial:subject:wikipedia
memorial:type: Key:memorial:type
+ merge_conflict_resolved: ChangesetKey:merge conflict resolved
message: Key:message
mhs:inscription_date: Key:mhs:inscription date
microbrewery: Key:microbrewery
$cnt = stick_content_in_hash("tag", "Template:${lang}ValueDescription", \%feature);
ok(1, " Got $cnt value pages");
$count{value} += $cnt;
+
+ # ChangesetKey pages
+ ok(1, " Getting changeset key pages");
+ $cnt = stick_content_in_hash("key", "Template:${lang}ChangesetKeyDescription", \%feature, "ChangesetKey");
+ ok(1, " Got $cnt changeset key pages");
+ $count{changesetkey} += $cnt;
}
-ok(1, "Got a total of $count{$_} ${_}s") for qw[ key keyprefix value ];
+ok(1, "Got a total of $count{$_} ${_}s") for qw[ key keyprefix changesetkey value ];
# Dump to .yml file
open my $out, ">", $out_file or die "Can't open file '$out_file' supplied on the command line";
sub stick_content_in_hash
{
- my ($key, $title, $hash) = @_;
+ my ($key, $title, $hash, $namespace) = @_;
my $ukey = ucfirst $key;
+ $namespace ||= $ukey;
my $space_to_underscore = sub {
my $txt = shift;
my $title = $link->{title};
my $lang;
my $key_name;
- if ($title =~ /^$ukey:(?<key_name>.*?)$/) {
+ if ($title =~ /^($namespace|$ukey):(?<key_name>.*?)$/) {
# English by default
$lang = "en";
$key_name = $space_to_underscore->($+{key_name});