From 6a1850a32f3e02e29d8d5303bb394e2d439dd988 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Sun, 18 Apr 2010 16:47:37 +0000
Subject: [PATCH] From Paul Foley.  Translatable strings are recorded only if
 *TRANSLATIONS* is non-NIL.

Use boot-2010-04-1 to bootstrap this.

code/intl.lisp:
o Change default for *TRANSLATIONS* to NIL to disable translations.
o Add TRANSLATION-ENABLE and TRANSLATION-DISABLE.

code/exports.lisp:
o Update exports list for new functions in INTL.
o Remove *TRANSLATABLE-DUMP-STREAM* which no longer exists.

bootfiles/20a/boot-2010-04-1.lisp:
o New bootstrap file.
---
 bootfiles/20a/boot-2010-04-1.lisp |  5 +++++
 code/exports.lisp                 |  6 +++---
 code/intl.lisp                    | 20 +++++++++++++++-----
 3 files changed, 23 insertions(+), 8 deletions(-)
 create mode 100644 bootfiles/20a/boot-2010-04-1.lisp

diff --git a/bootfiles/20a/boot-2010-04-1.lisp b/bootfiles/20a/boot-2010-04-1.lisp
new file mode 100644
index 000000000..0a1988a64
--- /dev/null
+++ b/bootfiles/20a/boot-2010-04-1.lisp
@@ -0,0 +1,5 @@
+;; Bootstrap changes to intl, because the build scripts access
+;; functions that don't exist in the previous version of intl.  Just
+;; load the old bootstrap for simplicity instead of just defining the
+;; necessary functions.
+(load "target:bootfiles/20a/boot-2010-02-1")
\ No newline at end of file
diff --git a/code/exports.lisp b/code/exports.lisp
index 0009d3592..39350644d 100644
--- a/code/exports.lisp
+++ b/code/exports.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.295 2010/04/14 16:39:51 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.296 2010/04/18 16:47:37 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -592,9 +592,9 @@
 
 (defpackage "INTL"
   (:use "COMMON-LISP")
-  (:export "*LOCALE-DIRECTORIES*" "*TRANSLATABLE-DUMP-STREAM*" "DGETTEXT" "DNGETTEXT"
+  (:export "*LOCALE-DIRECTORIES*" "DGETTEXT" "DNGETTEXT"
 	   "GETTEXT" "INSTALL" "NGETTEXT" "READ-TRANSLATABLE-STRING" "SETLOCALE"
-	   "TEXTDOMAIN"))
+	   "TEXTDOMAIN" "TRANSLATION-ENABLE" "TRANSLATION-DISABLE"))
 
 (defpackage "LISP"
   (:use "COMMON-LISP" "EXTENSIONS" "KERNEL" "SYSTEM" "DEBUG" "BIGNUM" "INTL")
diff --git a/code/intl.lisp b/code/intl.lisp
index 3ba665648..fa7c793e7 100644
--- a/code/intl.lisp
+++ b/code/intl.lisp
@@ -1,6 +1,6 @@
 ;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: INTL -*-
 
-;;; $Revision: 1.3 $
+;;; $Revision: 1.4 $
 ;;; Copyright 1999-2010 Paul Foley (mycroft@actrix.gen.nz)
 ;;;
 ;;; Permission is hereby granted, free of charge, to any person obtaining
@@ -23,7 +23,7 @@
 ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 ;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 ;;; DAMAGE.
-(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/intl.lisp,v 1.3 2010/04/14 16:39:52 rtoy Exp $")
+(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/intl.lisp,v 1.4 2010/04/18 16:47:37 rtoy Exp $")
 
 (in-package "INTL")
 
@@ -558,18 +558,28 @@
 (defvar *translator-comment* nil)
 
 #-runtime
-(defvar *translations* (make-hash-table :test 'equal))
+(defvar *translations* nil)
+
+#-runtime
+(defun translation-enable ()
+  (setq *translations* (or *translations* (make-hash-table :test 'equal)))
+  t)
+
+#-runtime
+(defun translation-disable ()
+  (setq *translations* nil))
 
 #-runtime
 (defun note-translatable (domain string &optional plural)
-  (when domain
+  (when (and domain *translations*)
     (let* ((hash (or (gethash domain *translations*)
 		     (setf (gethash domain *translations*)
 			   (make-hash-table :test 'equal))))
 	   (key (if plural (cons string plural) string))
 	   (val (or (gethash key hash) (cons nil nil))))
       (pushnew *translator-comment* (car val) :test #'equal)
-      (pushnew (enough-namestring *compile-file-truename*) (cdr val) :test #'equal)
+      (pushnew (and *compile-file-truename* (enough-namestring *compile-file-truename*))
+	       (cdr val) :test #'equal)
       ;; FIXME: How does this happen?  Need to figure this out and get
       ;; rid of this!
       (unless key
-- 
GitLab