* liece-misc.el: Don't require pccl and broken.
[elisp/liece.git] / lisp / gettext.el
index 5e9cbe9..c795e0e 100644 (file)
@@ -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-*\"")
 (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)