* Makefile.am (EXTRA_DIST): Add liece.xbm and liece.xpm.
[elisp/liece.git] / lisp / liece-intl.el
1 ;;; liece-intl.el --- Localized messages for IRC.
2 ;; Copyright (C) 1998-2000 Daiki Ueno
3
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
5 ;; Created: 1998-12-30
6 ;; Revised: 1999-09-03
7 ;; Keywords: IRC, liece
8
9 ;; This file is part of Liece.
10
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26
27 ;;; Commentary:
28 ;; 
29
30 ;;; Code:
31
32 (eval-when-compile
33   (require 'cl)
34   (require 'liece-compat))
35
36 (require 'gettext)
37
38 (defgroup liece-intl nil
39   "Convert messages to localized them"
40   :group 'liece-vars)
41
42 (defcustom liece-intl-catalogue-directory nil
43   "Normal position of PO files."
44   :type 'directory
45   :group 'liece-intl)
46
47 (defcustom liece-intl-use-localized-messages t
48   "If non-nil display localized messages."
49   :type 'boolean
50   :group 'liece-intl)
51   
52 (defvar liece-intl-message-alist nil)
53 (defvar liece-intl-default-mime-charset 'x-ctext)
54 (defvar liece-intl-mime-charset nil)
55 (defvar liece-intl-domain "liece")
56
57 ;;;###liece-autoload
58 (defmacro liece-intl-get-msgstr (msgid)
59   `(if liece-intl-use-localized-messages
60        (dgettext liece-intl-domain ,msgid)
61      ,msgid))
62
63 ;;;###liece-autoload
64 (defalias '_ 'liece-intl-get-msgstr)
65
66 (defun liece-intl-load-catalogue ()
67   (if (null liece-intl-catalogue-directory)
68       (setq liece-intl-catalogue-directory
69             (liece-locate-path "po")))
70   (bind-text-domain liece-intl-domain liece-intl-catalogue-directory))
71
72 (provide 'liece-intl)
73
74 ;;; liece-intl.el ends here