changeset 22057:9b0a64c31e1c

(locale-translation-file-name): New variable. (command-line): Use it to decode locale aliases.
author Richard M. Stallman <rms@gnu.org>
date Thu, 14 May 1998 03:55:13 +0000
parents cc1d87834752
children 8299c71438c4
files lisp/startup.el
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Thu May 14 03:54:50 1998 +0000
+++ b/lisp/startup.el	Thu May 14 03:55:13 1998 +0000
@@ -329,6 +329,9 @@
 		 string)
   :group 'auto-save)
 
+(defvar locale-translation-file-name "/usr/share/locale/locale.alias"
+  "*File name for the system's file of locale-name aliases.")
+
 (defvar init-file-debug nil)
 
 (defvar init-file-had-error nil)
@@ -482,6 +485,17 @@
 	       (and (not (equal string "")) string))
 	     (let ((string (getenv "LANG")))
 	       (and (not (equal string "")) string)))))
+    ;; Translate "swedish" into "sv_SE.ISO-8859-1", and so on,
+    ;; using the translation file that GNU/Linux systems have.
+    (and ctype
+	 (not (string-match iso-8859-n-locale-regexp ctype))
+	 (file-exists-p locale-translation-file-name)
+	 (with-temp-buffer
+	   (insert-file-contents locale-translation-file-name)
+	   (if (re-search-forward (concat "^" ctype "[ \t]*") nil t)
+	       (setq ctype (buffer-substring (point)
+					     (progn (end-of-line) (point)))))))
+    ;; Now see if the locale specifies an ISO 8859 character set.
     (when (and ctype
 	       (string-match iso-8859-n-locale-regexp ctype))
       (let (charset (which (match-string 1 ctype)))