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
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/>.
28 ;; This provides two commands: `language' is for everyday use, and
29 ;; `erc-cmd-LANG' provides the /LANG command to 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
46 ("az" .
"Azerbaijani")
52 ("bn" .
"Bengali; Bangla")
75 ("gd" .
"Scots Gaelic")
80 ("he" .
"Hebrew (formerly iw)")
85 ("ia" .
"Interlingua")
86 ("id" .
"Indonesian (formerly in)")
87 ("ie" .
"Interlingue")
96 ("kl" .
"Greenlandic")
106 ("lt" .
"Lithuanian")
107 ("lv" .
"Latvian, Lettish")
110 ("mk" .
"Macedonian")
123 ("om" .
"(Afan) Oromo")
127 ("ps" .
"Pashto, Pushto")
128 ("pt" .
"Portuguese")
130 ("rm" .
"Rhaeto-Romance")
134 ("rw" .
"Kinyarwanda")
138 ("sh" .
"Serbo-Croatian")
169 ("vi" .
"Vietnamese")
173 ("yi" .
"Yiddish (formerly ji)")
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: "
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
))))
208 (or lang
(concat language
": No such domain"))))
213 ;;; erc-lang.el ends here