[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/international/mule-cmds.el,v
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/international/mule-cmds.el,v |
Date: |
Fri, 08 Feb 2008 20:43:17 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Glenn Morris <gm> 08/02/08 20:43:17
Index: mule-cmds.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/international/mule-cmds.el,v
retrieving revision 1.320
retrieving revision 1.321
diff -u -b -r1.320 -r1.321
--- mule-cmds.el 1 Feb 2008 16:01:17 -0000 1.320
+++ mule-cmds.el 8 Feb 2008 20:43:16 -0000 1.321
@@ -2422,6 +2422,19 @@
;; too, for setting things such as calendar holidays, ps-print paper
;; size, spelling dictionary.
+(defun locale-translate (locale)
+ "Expand LOCALE according to `locale-translation-file-name', if possible.
+For example, translate \"swedish\" into \"sv_SE.ISO8859-1\"."
+ (if locale-translation-file-name
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert-file-contents locale-translation-file-name)
+ (if (re-search-forward
+ (concat "^" (regexp-quote locale) ":?[ \t]+") nil t)
+ (buffer-substring (point) (line-end-position))
+ locale))
+ locale))
+
(defun set-locale-environment (&optional locale-name frame)
"Set up multi-lingual environment for using LOCALE-NAME.
This sets the language environment, the coding system priority,
@@ -2491,16 +2504,7 @@
(setq locale mac-system-locale))
(when locale
-
- ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
- ;; using the translation file that many systems have.
- (when locale-translation-file-name
- (with-temp-buffer
- (set-buffer-multibyte nil)
- (insert-file-contents locale-translation-file-name)
- (when (re-search-forward
- (concat "^" (regexp-quote locale) ":?[ \t]+") nil t)
- (setq locale (buffer-substring (point) (line-end-position))))))
+ (setq locale (locale-translate locale))
;; Leave the system locales alone if the caller did not specify
;; an explicit locale name, as their defaults are set from
@@ -2508,8 +2512,16 @@
;; want to set them to the same value as LC_CTYPE.
(when locale-name
(setq system-messages-locale locale)
- (setq system-time-locale locale))
+ (setq system-time-locale locale)))
+
+ (setq woman-locale
+ (or system-messages-locale
+ (let ((msglocale (getenv "LC_MESSAGES")))
+ (if (zerop (length msglocale))
+ locale
+ (locale-translate msglocale)))))
+ (when locale
(setq locale (downcase locale))
(let ((language-name