/[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.1 by rtoy, Mon Feb 8 02:49:49 2010 UTC revision 1.1.2.2 by rtoy, Mon Feb 8 18:36:20 2010 UTC
# Line 23  Line 23 
23  ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE  ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
24  ;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH  ;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25  ;;; DAMAGE.  ;;; DAMAGE.
26  #+CMU (ext:file-comment "$Header$")  (ext:file-comment "$Header$")
27    
28  (in-package "INTL")  (in-package "INTL")
29    
30  (eval-when (:compile-toplevel :execute)  (eval-when (:compile-toplevel :execute)
31    (defparameter intl::*default-domain* "libintl")    (defparameter intl::*default-domain* "cmucl")
32    (unless (and (fboundp 'intl:read-translatable-string)    (unless (and (fboundp 'intl:read-translatable-string)
33                 (eq (get-macro-character #\_)                 (eq (get-macro-character #\_)
34                     (fdefinition 'intl:read-translatable-string)))                     (fdefinition 'intl:read-translatable-string)))
# Line 587  Line 587 
587         (let ((fn (get-macro-character #\_ nil)))         (let ((fn (get-macro-character #\_ nil)))
588           (if fn (funcall fn stream #\_) '_)))))           (if fn (funcall fn stream #\_) '_)))))
589    
590    ;; Process comments as usual, but look for lines that begin with
591    ;; "TRANSLATORS: ".  These lines are saved and written out as a
592    ;; translator comment for the next translatable string.
593  #-runtime  #-runtime
594  (defun read-comment (stream char)  (defun read-comment (stream char)
595    (declare (optimize (speed 0) (space 3) #-gcl (debug 0))    (declare (optimize (speed 0) (space 3) #-gcl (debug 0))
# Line 659  Line 662 
662    t)    t)
663    
664    
665    ;; Dump the translatable strings.  The output is written to a file in
666    ;; the directory OUTPUT-DIRECTORY and its name is the domain.
667  #-runtime  #-runtime
668  (defun dump-pot-files (&key copyright)  (defun dump-pot-files (&key copyright output-directory)
669    (declare (optimize (speed 0) (space 3) #-gcl (debug 1)))    (declare (optimize (speed 0) (space 3) #-gcl (debug 1)))
670    (labels ((b (key data)    (labels ((b (key data)
671               (format t "~@[~{~&#. ~A~}~%~]" (delete nil (car data)))               (format t "~@[~{~&#. ~A~}~%~]" (delete nil (car data)))
# Line 741  Line 746 
746                   (when i (write-char #\\ nil) (write-char (char string i) nil))                   (when i (write-char #\\ nil) (write-char (char string i) nil))
747                   (setq start (if i (1+ i) end)))))                   (setq start (if i (1+ i) end)))))
748             (a (domain hash)             (a (domain hash)
749               (format t "~&#@ ~A~2%" domain)               (with-open-file (*standard-output*
750               (format t "~&# SOME DESCRIPTIVE TITLE~%")                                (merge-pathnames (make-pathname :name domain
751               (format t "~@[~&# Copyright (C) YEAR ~A~%~]" copyright)                                                                :type "pot")
752               (format t "~&# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR~%")                                                 output-directory)
753               (format t "~&#~%#, fuzzy~%msgid \"\"~%msgstr \"\"~%")                                :direction :output
754               (format t "~&\"Project-Id-Version: PACKAGE VERSION\\n\"~%")                                :if-exists :new-version
755               (format t "~&\"Report-Msgid-Bugs-To: \\n\"~%")                                :external-format :utf8)
756               (format t "~&\"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\\n\"~%")                 (format t "~&#@ ~A~2%" domain)
757               (format t "~&\"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n\"~%")                 (format t "~&# SOME DESCRIPTIVE TITLE~%")
758               (format t "~&\"Language-Team: LANGUAGE <LL@li.org>\\n\"~%")                 (format t "~@[~&# Copyright (C) YEAR ~A~%~]" copyright)
759               (format t "~&\"MIME-Version: 1.0\\n\"~%")                 (format t "~&# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR~%")
760               (format t "~&\"Content-Type: text/plain; charset=UTF-8\\n\"~%")                 (format t "~&#~%#, fuzzy~%msgid \"\"~%msgstr \"\"~%")
761               (format t "~&\"Content-Transfer-Encoding: 8bit\\n\"~2%")                 (format t "~&\"Project-Id-Version: PACKAGE VERSION\\n\"~%")
762               (maphash #'b hash)))                 (format t "~&\"Report-Msgid-Bugs-To: \\n\"~%")
763                   (format t "~&\"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\\n\"~%")
764                   (format t "~&\"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n\"~%")
765                   (format t "~&\"Language-Team: LANGUAGE <LL@li.org>\\n\"~%")
766                   (format t "~&\"MIME-Version: 1.0\\n\"~%")
767                   (format t "~&\"Content-Type: text/plain; charset=UTF-8\\n\"~%")
768                   (format t "~&\"Content-Transfer-Encoding: 8bit\\n\"~2%")
769                   (maphash #'b hash))))
770      (maphash #'a *translations*)      (maphash #'a *translations*)
771      #+(or)      #+(or)
772      (clrhash *translations*))      (clrhash *translations*))

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.5