/[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.4 by rtoy, Sun Apr 18 16:47:37 2010 UTC revision 1.5 by rtoy, Mon Apr 19 12:18:16 2010 UTC
# Line 47  Line 47 
47  (defvar *locale* "C")  (defvar *locale* "C")
48    
49  (defvar *default-domain* nil  (defvar *default-domain* nil
50    _N"The message-lookup domain used by INTL:GETTEXT and INTL:NGETTEXT.    "The message-lookup domain used by INTL:GETTEXT and INTL:NGETTEXT.
51    Use (INTL:TEXTDOMAIN \"whatever\") in each source file to set this.")    Use (INTL:TEXTDOMAIN \"whatever\") in each source file to set this.")
52  (defvar *loaded-domains* (make-hash-table :test 'equal))  (defvar *loaded-domains* (make-hash-table :test 'equal))
53  (defvar *locale-aliases* (make-hash-table :test 'equal))  (defvar *locale-aliases* (make-hash-table :test 'equal))
# Line 526  Line 526 
526       (setf *default-domain* ,domain)))       (setf *default-domain* ,domain)))
527    
528  (defmacro gettext (string)  (defmacro gettext (string)
529    _N"Look up STRING in the current message domain and return its translation."    "Look up STRING in the current message domain and return its translation."
530    `(dgettext ,*default-domain* ,string))    `(dgettext ,*default-domain* ,string))
531    
532  (defmacro ngettext (singular plural n)  (defmacro ngettext (singular plural n)
533    _N"Look up the singular or plural form of a message in the current domain."    "Look up the singular or plural form of a message in the current domain."
534    `(dngettext ,*default-domain* ,singular ,plural ,n))    `(dngettext ,*default-domain* ,singular ,plural ,n))
535    
536  (declaim (inline dgettext))  (declaim (inline dgettext))
537  (defun dgettext (domain string)  (defun dgettext (domain string)
538    _N"Look up STRING in the specified message domain and return its translation."    "Look up STRING in the specified message domain and return its translation."
539    #+(or)(declare (optimize (speed 3) (space 2) (safety 0)))    #+(or)(declare (optimize (speed 3) (space 2) (safety 0)))
540    (let ((domain (and domain (find-domain domain *locale*))))    (let ((domain (and domain (find-domain domain *locale*))))
541      (or (and domain (domain-lookup string domain)) string)))      (or (and domain (domain-lookup string domain)) string)))
542    
543  (defun dngettext (domain singular plural n)  (defun dngettext (domain singular plural n)
544    _N"Look up the singular or plural form of a message in the specified domain."    "Look up the singular or plural form of a message in the specified domain."
545    (declare (type integer n)    (declare (type integer n)
546             #+(or)(optimize (speed 3) (space 2) (safety 0)))             #+(or)(optimize (speed 3) (space 2) (safety 0)))
547    (let* ((domain (and domain (find-domain domain *locale*)))    (let* ((domain (and domain (find-domain domain *locale*)))

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.5