Abbreviated country names make for a better sheet.
Flag images have to be requested manually by getting ?show.
Makes most glyph styling apply to any table, including this one.
Enlarged text and uniform width remains .glyphs-specific, but colouring and
borders should be good to enforce for all (future) tables.
font-weight: normal; /* nice and subtle */
}
font-weight: normal; /* nice and subtle */
}
li table {
float: left;
position: relative; /* prevents buggy hovering if table-caption present in gecko */
}
li table {
float: left;
position: relative; /* prevents buggy hovering if table-caption present in gecko */
}
border-collapse: collapse;
}
border-collapse: collapse;
}
-.glyphs thead th, .glyphs td {
- text-align: center;
- width: 1.6em; /* regular interval */
-}
-.glyphs th, .glyphs td {
border-color: #778;
border: 1px solid #888;
background: #DDD;
}
border-color: #778;
border: 1px solid #888;
background: #DDD;
}
+thead th, td {
+ text-align: center;
+}
+
+/* character table */
+
+.glyphs thead th, .glyphs td {
+ width: 1.6em; /* regular interval */
+}
.glyphs tbody td {
font-size: 112%;
}
.glyphs tbody td {
font-size: 112%;
}
-.glyphs th,
-.glyphs thead td {
border: 0;
background: transparent !important;
}
.glyphs thead td {
width: auto; /* no glyph cells in header */
}
border: 0;
background: transparent !important;
}
.glyphs thead td {
width: auto; /* no glyph cells in header */
}
font-size: 50%; /* mostly insignificant here */
font-weight: normal;
}
font-size: 50%; /* mostly insignificant here */
font-weight: normal;
}
-.diinfo .glyphs tbody th {
text-align: right; /* variable width so keep near cells */
padding: 0 0.5em;
}
text-align: right; /* variable width so keep near cells */
padding: 0 0.5em;
}
# perl -MDBIx::Simple -MData::Dump=pp -e 'pp({DBIx::Simple->new("dbi:SQLite:dbname=locale.db")->query("SELECT country.code_alpha2, country.name, continent.name FROM country LEFT JOIN continent ON country.code_alpha2 = continent.country_code ORDER BY country.code_alpha2")->map_arrays(0)})'
{
# perl -MDBIx::Simple -MData::Dump=pp -e 'pp({DBIx::Simple->new("dbi:SQLite:dbname=locale.db")->query("SELECT country.code_alpha2, country.name, continent.name FROM country LEFT JOIN continent ON country.code_alpha2 = continent.country_code ORDER BY country.code_alpha2")->map_arrays(0)})'
{
-ac => ["Ascension (dependency of Saint Helena)", 'c-oc Xr', 'sh'],
+ac => ["Ascension (dependency of Saint Helena)", 'c-oc Xr', undef, 'sh'],
ad => ["Andorra", 'c-eu'],
ae => ["United Arab Emirates", 'c-as'],
af => ["Afghanistan", 'c-as'],
ad => ["Andorra", 'c-eu'],
ae => ["United Arab Emirates", 'c-as'],
af => ["Afghanistan", 'c-as'],
cm => ["Cameroon", 'c-af'],
cn => ["China", 'c-as'],
co => ["Colombia", 'c-sa'],
cm => ["Cameroon", 'c-af'],
cn => ["China", 'c-as'],
co => ["Colombia", 'c-sa'],
-cp => ["Clipperton (French possession)", 'c-na Xr', 'fr'],
+cp => ["Clipperton (French possession)", 'c-na Xr', undef, 'fr'],
cr => ["Costa Rica", 'c-na'],
cu => ["Cuba", 'c-na'],
cv => ["Cape Verde", 'c-af'],
cr => ["Costa Rica", 'c-na'],
cu => ["Cuba", 'c-na'],
cv => ["Cape Verde", 'c-af'],
de => ["Germany", 'c-eu'],
dj => ["Djibouti", 'c-af'],
dk => ["Denmark", 'c-eu'],
de => ["Germany", 'c-eu'],
dj => ["Djibouti", 'c-af'],
dk => ["Denmark", 'c-eu'],
-dg => ["Diego Garcia (British Territory)", 'c-as Xr', 'io'],
+dg => ["Diego Garcia (British Territory)", 'c-as Xr', undef, 'io'],
dm => ["Dominica", 'c-na'],
do => ["Dominican Republic", 'c-na'],
dz => ["Algeria", 'c-af'],
dm => ["Dominica", 'c-na'],
do => ["Dominican Republic", 'c-na'],
dz => ["Algeria", 'c-af'],
-ea => ["Ceuta and Melilla (Spanish cities outside EU territory)", 'c-af Xr', 'es'],
+ea => ["Ceuta and Melilla (Spanish cities outside EU territory)", 'c-af Xr', undef, 'es'],
ec => ["Ecuador", 'c-sa'],
ee => ["Estonia", 'c-eu'],
eg => ["Egypt", 'c-af'],
ec => ["Ecuador", 'c-sa'],
ee => ["Estonia", 'c-eu'],
eg => ["Egypt", 'c-af'],
fm => ["Micronesia, Federated States of", 'c-oc'],
fo => ["Faroe Islands", 'c-oc'],
fr => ["France", 'c-eu'],
fm => ["Micronesia, Federated States of", 'c-oc'],
fo => ["Faroe Islands", 'c-oc'],
fr => ["France", 'c-eu'],
-fx => ["Metropolitan France", 'c-eu Xr', 'fr'],
+fx => ["Metropolitan France", 'c-eu Xr', undef, 'fr'],
ga => ["Gabon", 'c-af'],
gb => ["United Kingdom", 'c-eu'],
gd => ["Grenada", 'c-na'],
ga => ["Gabon", 'c-af'],
gb => ["United Kingdom", 'c-eu'],
gd => ["Grenada", 'c-na'],
ie => ["Ireland", 'c-eu'],
il => ["Israel", 'c-as'],
in => ["India", 'c-as'],
ie => ["Ireland", 'c-eu'],
il => ["Israel", 'c-as'],
in => ["India", 'c-as'],
-io => ["British Indian Ocean Territory", 'c-oc'],
+io => ["British Indian Ocean Territory", 'c-oc', 'Chagos'],
iq => ["Iraq", 'c-as'],
ir => ["Iran, Islamic Republic of", 'c-as'],
is => ["Iceland", 'c-eu'],
iq => ["Iraq", 'c-as'],
ir => ["Iran, Islamic Republic of", 'c-as'],
is => ["Iceland", 'c-eu'],
ki => ["Kiribati", 'c-oc'],
km => ["Comoros", 'c-af'],
kn => ["Saint Kitts and Nevis", 'c-na'],
ki => ["Kiribati", 'c-oc'],
km => ["Comoros", 'c-af'],
kn => ["Saint Kitts and Nevis", 'c-na'],
-kp => ["Korea, Democratic People's Republic of", 'c-as'],
-kr => ["Korea, Republic of", 'c-as'],
+kp => ["Korea, Democratic People's Republic of", 'c-as', "North Korea"],
+kr => ["Korea, Republic of", 'c-as', "South Korea"],
kw => ["Kuwait", 'c-as'],
ky => ["Cayman Islands", 'c-oc'],
kz => ["Kazakhstan", 'c-as'],
kw => ["Kuwait", 'c-as'],
ky => ["Cayman Islands", 'c-oc'],
kz => ["Kazakhstan", 'c-as'],
-la => ["Lao People's Democratic Republic", 'c-as'],
+la => ["Lao People's Democratic Republic", 'c-as', "Lao"],
lb => ["Lebanon", 'c-as'],
lc => ["Saint Lucia", 'c-na'],
li => ["Liechtenstein", 'c-eu'],
lb => ["Lebanon", 'c-as'],
lc => ["Saint Lucia", 'c-na'],
li => ["Liechtenstein", 'c-eu'],
lt => ["Lithuania", 'c-eu'],
lu => ["Luxembourg", 'c-eu'],
lv => ["Latvia", 'c-eu'],
lt => ["Lithuania", 'c-eu'],
lu => ["Luxembourg", 'c-eu'],
lv => ["Latvia", 'c-eu'],
-ly => ["Libyan Arab Jamahiriya", 'c-af'],
+ly => ["Libyan Arab Jamahiriya", 'c-af', "Libya"],
ma => ["Morocco", 'c-af'],
mc => ["Monaco", 'c-eu'],
md => ["Moldova, Republic of", 'c-eu'],
ma => ["Morocco", 'c-af'],
mc => ["Monaco", 'c-eu'],
md => ["Moldova, Republic of", 'c-eu'],
-me => ["Republic of Montenegro", 'c-eu'],
+me => ["Montenegro, Republic of", 'c-eu'],
mg => ["Madagascar", 'c-af'],
mh => ["Marshall Islands", 'c-oc'],
mk => ["Macedonia, the Former Yugoslav Republic of", 'c-eu'],
mg => ["Madagascar", 'c-af'],
mh => ["Marshall Islands", 'c-oc'],
mk => ["Macedonia, the Former Yugoslav Republic of", 'c-eu'],
qa => ["Qatar", 'c-as'],
re => ["Reunion", 'c-oc'],
ro => ["Romania", 'c-eu'],
qa => ["Qatar", 'c-as'],
re => ["Reunion", 'c-oc'],
ro => ["Romania", 'c-eu'],
-rs => ["Republic of Serbia", 'c-eu'],
-ru => ["Russian Federation", 'c-eu'],
+rs => ["Serbia, Republic of", 'c-eu'],
+ru => ["Russian Federation", 'c-eu', "Russia"],
rw => ["Rwanda", 'c-af'],
sa => ["Saudi Arabia", 'c-as'],
sb => ["Solomon Islands", 'c-oc'],
rw => ["Rwanda", 'c-af'],
sa => ["Saudi Arabia", 'c-as'],
sb => ["Solomon Islands", 'c-oc'],
tz => ["Tanzania, United Republic of", 'c-af'],
ua => ["Ukraine", 'c-eu'],
ug => ["Uganda", 'c-af'],
tz => ["Tanzania, United Republic of", 'c-af'],
ua => ["Ukraine", 'c-eu'],
ug => ["Uganda", 'c-af'],
-uk => ["(United Kingdom)", 'c-eu Xr', 'gb'],
-um => ["United States Minor Outlying Islands", 'c-na'],
+uk => ["(United Kingdom)", 'c-eu Xr', undef, 'gb'],
+um => ["United States Minor Outlying Islands", 'c-na', 'U.S. isl.'],
us => ["United States", 'c-na'],
uy => ["Uruguay", 'c-sa'],
uz => ["Uzbekistan", 'c-as'],
va => ["Holy See (Vatican City State)", 'c-eu'],
vc => ["Saint Vincent and the Grenadines", 'c-na'],
ve => ["Venezuela", 'c-sa'],
us => ["United States", 'c-na'],
uy => ["Uruguay", 'c-sa'],
uz => ["Uzbekistan", 'c-as'],
va => ["Holy See (Vatican City State)", 'c-eu'],
vc => ["Saint Vincent and the Grenadines", 'c-na'],
ve => ["Venezuela", 'c-sa'],
-vg => ["Virgin Islands, British", 'c-na'],
-vi => ["Virgin Islands, U.S.", 'c-na'],
+vg => ["Virgin Islands, British", 'c-na', "British Virgin"],
+vi => ["Virgin Islands, U.S.", 'c-na', "U.S. Virgin"],
vn => ["Vietnam", 'c-as'],
vu => ["Vanuatu", 'c-oc'],
wf => ["Wallis and Futuna", 'c-oc'],
vn => ["Vietnam", 'c-as'],
vu => ["Vanuatu", 'c-oc'],
wf => ["Wallis and Futuna", 'c-oc'],
- printf '<table class="glyphs ccmap">';
+ printf '<table class="mcmap">';
print '<col>';
for my $section (qw{thead}) {
print "<$section><tr><th>↱";
print '<col>';
for my $section (qw{thead}) {
print "<$section><tr><th>↱";
print $code =~ /^x|^q[m-z]|^aa|^zz/ ? '<td class="X Co">' : '<td>';
next;
};
print $code =~ /^x|^q[m-z]|^aa|^zz/ ? '<td class="X Co">' : '<td>';
next;
};
- $code = $country->[2] if defined $country->[2];
- my $img = sprintf '<img src="/flag/%s.png" alt="%s">', $code, $code
- if -e "flag/$code.png";
+ my ($name, $class, $short, $ref) = @$country;
+ $ref ||= $code;
+ local $_ = $ref;
+ if (exists $get{show}) {
+ my $img = "flag/$ref.png";
+ $_ = sprintf '<img src="/%s" alt="%s">', $img, $ref if -e $img;
+ }
+ else {
+ $_ = $short || $name;
+ s/,.*//;
+ s/(?<=.)\(.*\)\s*//;
+ s/ republic\b//gi;
+ s/ islands?\b//gi;
+ s/\bthe //g;
+ s/ and / & /g;
+ s/\bsaint /st /gi;
+ s/South /S-/g;
+ s/North /N-/g;
+ s/New /n./g;
+ s/(\S)(\S+)-/$1-/g; # strip most chars preceding dash
+ s/(\S{4}[b-df-hj-np-tv-xz])(\S{2,})/$1./g; # abbreviate (at consonant)
+ $_ = quote($_);
+ }
+ $name =~ s/([^,]*), (.*)/$2 $1/;
printf "\n".'<td class="%s" title="%s">%s',
printf "\n".'<td class="%s" title="%s">%s',
- $img ? 'X '.$country->[1] : '', quote($country->[0]), $img;
+ $_ ? 'X '.$class : '', quote("$code: $name"), $_;
/* character properties */
/* character properties */
-.glyphs th, .glyphs td {
border-color: #333;
background: #181818;
}
border-color: #333;
background: #181818;
}