Skip to content
Snippets Groups Projects
Commit 6a1850a3 authored by rtoy's avatar rtoy
Browse files

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.
parent 8887d945
No related branches found
No related tags found
No related merge requests found
;; 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
......@@ -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")
......
;;; -*- 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment