erc-lang.el 5.8 KB

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