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