From 8285e1b22bde28469145dcce673d332f14cf51c4 Mon Sep 17 00:00:00 2001 From: ueno Date: Sun, 12 May 2002 02:57:37 +0000 Subject: [PATCH] Synch up with liece-2_0. --- lisp/ChangeLog | 9 +++++++++ lisp/gettext.el | 13 ++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ae290eb..6f64f80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2002-05-12 Daiki Ueno + + * gettext.el (gettext-default-locale): New variable. + (bind-text-domain): Use it. + +2002-05-07 Daiki Ueno + + * gettext.el (gettext-mapcar*): Eliminate recursion. + 2002-03-20 Daiki Ueno * gettext.el (bind-text-domain): Respect LC_ALL and LC_MESSAGES; diff --git a/lisp/gettext.el b/lisp/gettext.el index 5e9cbe9..c795e0e 100644 --- a/lisp/gettext.el +++ b/lisp/gettext.el @@ -47,6 +47,7 @@ (defvar gettext-message-domain-to-catalog-alist nil) (defvar gettext-default-message-domain "emacs") (defvar gettext-default-mime-charset default-mime-charset) +(defvar gettext-default-locale "C") (defconst gettext-msgid-regexp "msgid\\s-*\"") (defconst gettext-msgstr-regexp "msgstr\\s-*\"") @@ -133,10 +134,11 @@ (defun gettext-mapcar* (function &rest args) "Apply FUNCTION to successive cars of all ARGS. Return the list of results." - (unless (memq nil args) - (cons (apply function (mapcar #'car args)) - (apply #'gettext-mapcar* function - (mapcar #'cdr args))))) + (let (result) + (while (not (memq nil args)) + (push (apply function (mapcar #'car args)) result) + (setq args (mapcar #'cdr args))) + (nreverse result))) (defun gettext-load-message-catalogue (file) (with-temp-buffer @@ -244,7 +246,8 @@ Return the list of results." Here's how the path to message files is constructed under SunOS 5.0: {pathname}/{LANG}/LC_MESSAGES/{domain}.mo \[XEmacs I18N level 3 emulating function]" - (let* ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") (getenv "LANG"))) + (let* ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") (getenv "LANG") + gettext-default-locale)) (language (progn (string-match "\\([^_.]+\\)\\(_[^.]+\\)?\\(\\.[^@]+\\)?" lang) -- 1.7.10.4