/[cmucl]/src/code/intl.lisp
ViewVC logotype

Diff of /src/code/intl.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.6 by rtoy, Tue Feb 9 13:22:58 2010 UTC revision 1.1.2.7 by rtoy, Tue Feb 9 23:40:35 2010 UTC
# Line 80  Line 80 
80       (the (unsigned-byte 8) (read-byte stream))))       (the (unsigned-byte 8) (read-byte stream))))
81    
82  (defun locate-domain-file (domain locale locale-dir)  (defun locate-domain-file (domain locale locale-dir)
83    (flet ((path (locale base)    ;; The default locale-dir includes search lists.  If we get called
84             (merge-pathnames (make-pathname :directory (list :relative locale    ;; before the search lists are initialized, we lose.  The search
85                                                              "LC_MESSAGES")    ;; lists are initialized in environment-init, which sets
86                                             :name domain :type "mo")    ;; *environment-list-initialized*.  This way, we return NIL to
87                              base)))    ;; indicate there's no domain file to use.
88      (let ((locale (or (gethash locale *locale-aliases*) locale)))    (when lisp::*environment-list-initialized*
89        (dolist (base (if (listp locale-dir) locale-dir (list locale-dir)))      (flet ((path (locale base)
90          (let ((probe               (merge-pathnames (make-pathname :directory (list :relative locale
91                 (or (probe-file (path locale base))                                                                "LC_MESSAGES")
92                     (let ((dot (position #\. locale)))                                               :name domain :type "mo")
93                       (and dot (probe-file (path (subseq locale 0 dot) base))))                                base)))
94                     (let ((at (position #\@ locale)))        (let ((locale (or (gethash locale *locale-aliases*) locale)))
95                       (and at (probe-file (path (subseq locale 0 at) base))))          (dolist (base (if (listp locale-dir) locale-dir (list locale-dir)))
96                     (let ((us (position #\_ locale)))            (let ((probe
97                       (and us (probe-file (path (subseq locale 0 us) base)))))))                   (or (probe-file (path locale base))
98            (when probe (return probe)))))))                       (let ((dot (position #\. locale)))
99                           (and dot (probe-file (path (subseq locale 0 dot) base))))
100                         (let ((at (position #\@ locale)))
101                           (and at (probe-file (path (subseq locale 0 at) base))))
102                         (let ((us (position #\_ locale)))
103                           (and us (probe-file (path (subseq locale 0 us) base)))))))
104                (when probe (return probe))))))))
105    
106  (defun find-encoding (domain)  (defun find-encoding (domain)
107    (when (null (domain-entry-encoding domain))    (when (null (domain-entry-encoding domain))

Legend:
Removed from v.1.1.2.6  
changed lines
  Added in v.1.1.2.7

  ViewVC Help
Powered by ViewVC 1.1.5