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