Remove old and crusty Sun pkg
[packages] / xemacs-packages / erc / erc-lang.el
1 ;;; erc-lang.el --- provide the LANG command to ERC
2
3 ;; Copyright (C) 2002, 2004 Free Software Foundation, Inc.
4
5 ;; Author: Alex Schroeder <alex@gnu.org>
6 ;; Maintainer: Alex Schroeder <alex@gnu.org>
7 ;; Version: 1.0.0
8 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcLang
9 ;; Keywords: comm languages processes
10
11 ;; This file is part of GNU Emacs.
12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; any later version.
17
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ;; GNU General Public License for more details.
22
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 ;; Boston, MA 02110-1301, USA.
27
28 ;;; Commentary:
29
30 ;; This provides two commands: `language' is for everyday use, and
31 ;; `erc-cmd-LANG' provides the /LANG command to ERC.
32
33 ;;; Code:
34
35 (require 'erc)
36
37 (defvar iso-638-languages
38   '(("aa" . "Afar")
39     ("ab" . "Abkhazian")
40     ("af" . "Afrikaans")
41     ("am" . "Amharic")
42     ("ar" . "Arabic")
43     ("as" . "Assamese")
44     ("ay" . "Aymara")
45     ("az" . "Azerbaijani")
46     ("ba" . "Bashkir")
47     ("be" . "Byelorussian")
48     ("bg" . "Bulgarian")
49     ("bh" . "Bihari")
50     ("bi" . "Bislama")
51     ("bn" . "Bengali; Bangla")
52     ("bo" . "Tibetan")
53     ("br" . "Breton")
54     ("ca" . "Catalan")
55     ("co" . "Corsican")
56     ("cs" . "Czech")
57     ("cy" . "Welsh")
58     ("da" . "Danish")
59     ("de" . "German")
60     ("dz" . "Bhutani")
61     ("el" . "Greek")
62     ("en" . "English")
63     ("eo" . "Esperanto")
64     ("es" . "Spanish")
65     ("et" . "Estonian")
66     ("eu" . "Basque")
67     ("fa" . "Persian")
68     ("fi" . "Finnish")
69     ("fj" . "Fiji")
70     ("fo" . "Faroese")
71     ("fr" . "French")
72     ("fy" . "Frisian")
73     ("ga" . "Irish")
74     ("gd" . "Scots Gaelic")
75     ("gl" . "Galician")
76     ("gn" . "Guarani")
77     ("gu" . "Gujarati")
78     ("ha" . "Hausa")
79     ("he" . "Hebrew (formerly iw)")
80     ("hi" . "Hindi")
81     ("hr" . "Croatian")
82     ("hu" . "Hungarian")
83     ("hy" . "Armenian")
84     ("ia" . "Interlingua")
85     ("id" . "Indonesian (formerly in)")
86     ("ie" . "Interlingue")
87     ("ik" . "Inupiak")
88     ("is" . "Icelandic")
89     ("it" . "Italian")
90     ("iu" . "Inuktitut")
91     ("ja" . "Japanese")
92     ("jw" . "Javanese")
93     ("ka" . "Georgian")
94     ("kk" . "Kazakh")
95     ("kl" . "Greenlandic")
96     ("km" . "Cambodian")
97     ("kn" . "Kannada")
98     ("ko" . "Korean")
99     ("ks" . "Kashmiri")
100     ("ku" . "Kurdish")
101     ("ky" . "Kirghiz")
102     ("la" . "Latin")
103     ("ln" . "Lingala")
104     ("lo" . "Laothian")
105     ("lt" . "Lithuanian")
106     ("lv" . "Latvian, Lettish")
107     ("mg" . "Malagasy")
108     ("mi" . "Maori")
109     ("mk" . "Macedonian")
110     ("ml" . "Malayalam")
111     ("mn" . "Mongolian")
112     ("mo" . "Moldavian")
113     ("mr" . "Marathi")
114     ("ms" . "Malay")
115     ("mt" . "Maltese")
116     ("my" . "Burmese")
117     ("na" . "Nauru")
118     ("ne" . "Nepali")
119     ("nl" . "Dutch")
120     ("no" . "Norwegian")
121     ("oc" . "Occitan")
122     ("om" . "(Afan) Oromo")
123     ("or" . "Oriya")
124     ("pa" . "Punjabi")
125     ("pl" . "Polish")
126     ("ps" . "Pashto, Pushto")
127     ("pt" . "Portuguese")
128     ("qu" . "Quechua")
129     ("rm" . "Rhaeto-Romance")
130     ("rn" . "Kirundi")
131     ("ro" . "Romanian")
132     ("ru" . "Russian")
133     ("rw" . "Kinyarwanda")
134     ("sa" . "Sanskrit")
135     ("sd" . "Sindhi")
136     ("sg" . "Sangho")
137     ("sh" . "Serbo-Croatian")
138     ("si" . "Sinhalese")
139     ("sk" . "Slovak")
140     ("sl" . "Slovenian")
141     ("sm" . "Samoan")
142     ("sn" . "Shona")
143     ("so" . "Somali")
144     ("sq" . "Albanian")
145     ("sr" . "Serbian")
146     ("ss" . "Siswati")
147     ("st" . "Sesotho")
148     ("su" . "Sundanese")
149     ("sv" . "Swedish")
150     ("sw" . "Swahili")
151     ("ta" . "Tamil")
152     ("te" . "Telugu")
153     ("tg" . "Tajik")
154     ("th" . "Thai")
155     ("ti" . "Tigrinya")
156     ("tk" . "Turkmen")
157     ("tl" . "Tagalog")
158     ("tn" . "Setswana")
159     ("to" . "Tonga")
160     ("tr" . "Turkish")
161     ("ts" . "Tsonga")
162     ("tt" . "Tatar")
163     ("tw" . "Twi")
164     ("ug" . "Uighur")
165     ("uk" . "Ukrainian")
166     ("ur" . "Urdu")
167     ("uz" . "Uzbek")
168     ("vi" . "Vietnamese")
169     ("vo" . "Volapuk")
170     ("wo" . "Wolof")
171     ("xh" . "Xhosa")
172     ("yi" . "Yiddish (formerly ji)")
173     ("yo" . "Yoruba")
174     ("za" . "Zhuang")
175     ("zh" . "Chinese")
176     ("zu" . "Zulu"))
177   "Alist of ISO language codes and language names.
178 This is based on the technical contents of ISO 639:1988 (E/F)
179 \"Code for the representation of names of languages\".
180
181 Typed by Keld.Simonsen@dkuug.dk 1990-11-30
182    <ftp://dkuug.dk/i18n/ISO_639>
183 Minor corrections, 1992-09-08 by Keld Simonsen
184 Sundanese corrected, 1992-11-11 by Keld Simonsen
185 Telugu corrected, 1995-08-24 by Keld Simonsen
186 Hebrew, Indonesian, Yiddish corrected 1995-10-10 by Michael Everson
187 Inuktitut, Uighur, Zhuang added 1995-10-10 by Michael Everson
188 Sinhalese corrected, 1995-10-10 by Michael Everson
189 Faeroese corrected to Faroese, 1995-11-18 by Keld Simonsen
190 Sangro corrected to Sangho, 1996-07-28 by Keld Simonsen
191
192 Two-letter lower-case symbols are used.
193 The Registration Authority for ISO 639 is Infoterm, Osterreichisches
194 Normungsinstitut (ON), Postfach 130, A-1021 Vienna, Austria.")
195
196 (defun language (code)
197   "Return the language name for the ISO CODE."
198   (interactive (list (completing-read "ISO language code: "
199                                       iso-638-languages)))
200   (message (cdr (assoc code iso-638-languages))))
201
202 (defun erc-cmd-LANG (language)
203   "Display the language name for the language code given by LANGUAGE."
204   (let ((lang (cdr (assoc language iso-638-languages))))
205     (erc-display-message
206      nil 'notice 'active
207      (or lang (concat line ": No such domain"))))
208   t)
209
210 (provide 'erc-lang)
211
212 ;; arch-tag: 8ffb1563-cc03-4517-b067-16309d4ff97b
213 ;;; erc-lang.el ends here