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