writing: script names in separate include
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 23 May 2010 14:51:08 +0000 (14:51 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 23 May 2010 14:51:08 +0000 (14:51 +0000)
writing-script.inc.pl [new file with mode: 0644]
writing.plp

diff --git a/writing-script.inc.pl b/writing-script.inc.pl
new file mode 100644 (file)
index 0000000..c0081f7
--- /dev/null
@@ -0,0 +1,60 @@
+{
+arab     => 'Arabic',
+armi     => 'Aramaic',
+bali     => 'Balinese',
+beng     => 'Bengali',
+brah     => 'Brahmi',
+cham     => 'Cham',
+copt     => 'Coptic',
+cyrl     => 'Cyrillic',
+deva     => 'Devanagari',
+ethi     => 'Ethiopic',
+goth     => 'Gothic',
+grek     => 'Greek',
+gujr     => 'Gujarati',
+guru     => 'Gurmukhi', # ਪੰਜਾਬੀ     ੧
+hans     => 'Chinese',
+hant     => 'Chinese',
+hebr     => 'Hebrew',
+ipa      => 'IPA',
+iso      => 'ISO',
+ital     => 'Old_Italic',
+java     => 'Javanese',
+kali     => 'Kayah_Li',
+khmr     => 'Khmer',
+knda     => 'Kannada',
+lana     => 'Tai_Tham',
+laoo     => 'Lao',
+latn     => 'Latin',
+lepc     => 'Lepcha',
+lyci     => 'Lycian',
+lydi     => 'Lydian',
+mlym     => 'Malayalam', # മലയാളം   ൧
+mymr     => 'Myanmar',
+olck     => 'Ol_Chiki',
+orya     => 'Oriya', # ଓଡ଼ିଆ
+osma     => 'Osmanya',
+phnx     => 'Phoenician',
+samr     => 'Samaritan',
+saur     => 'Saurashtra',
+sinh     => 'Sinhala',
+sund     => 'Sundanese',
+syrc     => 'Syriac',
+talu     => 'New_Tai_Lue',
+taml     => 'Tamil', # தமிழ்         ௧
+telu     => 'Telugu',
+teng     => 'Tengwar',
+tglg     => 'Baybayin',
+thai     => 'Thai', # ไทย
+tibt     => 'Tibetan',
+tlh      => 'Klingon',
+
+digits_latn     => 'Arabic_(Western)',
+digits_latnlat  => 'Roman',
+digits_brai     => 'Braille_[⠼+]',
+       arabindi => 'Arabic_-_Indic',
+       arabpers => 'Arabic_-_Indic_(Alt)',
+digits_brahnumb => 'Brahmi',
+       lanahora => 'Tai_Tham_Hora',
+       suzhou   => 'Hangzhou',
+}
index 4187d01..5308df7 100644 (file)
@@ -31,66 +31,8 @@ unless (exists $get{v}) {
        $glyphs->{digraph}--;
 }
 
-my %scriptname = (
-       arab     => 'Arabic',
-       armi     => 'Aramaic',
-       bali     => 'Balinese',
-       beng     => 'Bengali',
-       brah     => 'Brahmi',
-       cham     => 'Cham',
-       copt     => 'Coptic',
-       cyrl     => 'Cyrillic',
-       deva     => 'Devanagari',
-       ethi     => 'Ethiopic',
-       goth     => 'Gothic',
-       grek     => 'Greek',
-       gujr     => 'Gujarati',
-       guru     => 'Gurmukhi', # ਪੰਜਾਬੀ     ੧
-       hans     => 'Chinese',
-       hant     => 'Chinese',
-       hebr     => 'Hebrew',
-       ipa      => 'IPA',
-       iso      => 'ISO',
-       ital     => 'Old_Italic',
-       java     => 'Javanese',
-       kali     => 'Kayah_Li',
-       khmr     => 'Khmer',
-       knda     => 'Kannada',
-       lana     => 'Tai_Tham',
-       laoo     => 'Lao',
-       latn     => '<a href="/latin">Latin</a>',
-       lepc     => 'Lepcha',
-       lyci     => 'Lycian',
-       lydi     => 'Lydian',
-       mlym     => 'Malayalam', # മലയാളം   ൧
-       mymr     => 'Myanmar',
-       olck     => 'Ol_Chiki',
-       orya     => 'Oriya', # ଓଡ଼ିଆ
-       osma     => 'Osmanya',
-       phnx     => 'Phoenician',
-       samr     => 'Samaritan',
-       saur     => 'Saurashtra',
-       sinh     => 'Sinhala',
-       sund     => 'Sundanese',
-       syrc     => 'Syriac',
-       talu     => 'New_Tai_Lue',
-       taml     => 'Tamil', # தமிழ்         ௧
-       telu     => 'Telugu',
-       teng     => 'Tengwar',
-       tglg     => 'Baybayin',
-       thai     => 'Thai', # ไทย
-       tibt     => 'Tibetan',
-       tlh      => 'Klingon',
-
-       digits_latn     => 'Arabic_(Western)',
-       digits_latnlat  => 'Roman',
-       digits_brai     => 'Braille_[⠼+]',
-              arabindi => 'Arabic_-_Indic',
-              arabpers => 'Arabic_-_Indic_(Alt)',
-       digits_brahnumb => 'Brahmi',
-              lanahora => 'Tai_Tham_Hora',
-              suzhou   => 'Hangzhou',
-);
+my $scriptname = do 'writing-script.inc.pl';
+$_ = qq{<a href="/latin">$_</a>} for $scriptname->{latn} || ();
 
 for (
        [phnx => 'Phoenician'],
@@ -106,7 +48,7 @@ for (
        }
        $glyphs->print($title => [map {
                ref $_ eq 'ARRAY' ? @$_ : map { ".>$_" }
-                       $scriptname{$source.'_'.$_} || $scriptname{$_} || $_
+                       $scriptname->{$source.'_'.$_} || $scriptname->{$_} || $_
        } @table]);
 }