[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
*locale-path*
. If use-cache is nil
the
locale will be forcibly reloaded from path otherwise the cached locale will be returned.
If the locale cannot be found and errorp is not nil an error of type locale-error
will be signalled.
locale
locale.
(format t "~:/cl-l10n:format-number/" 1002932) prints `1,002,932` |
locale-int-curr-symbol
will be used instead of the default locale-currency-symbol
(format t "~/cl-l10n:format-money/" 188232.2322) prints `R188,232.23` ;; and (format t "~:/cl-l10n:format-money/" 188232.2322) prints `ZAR 188,232.23` |
universal-time
ut as a locale specific time to stream.
Equivalent to (format-time stream ut show-date show-time locale fmt time-zone)
.
universal-time
ut as a locale specific time to stream.
The format of the time printed is controlled by show-time and show-date.
show-time and show-date are not nil
locale-d-t-fmt
show-time and show-date are nil
locale-t-fmt-ampm
or locale-t-fmt
if locale-t-fmt-ampm
has
no apparent value.
show-time is not nil and show-date is nil
show-date is not nil and show-time is nil
If fmt is not nil then show-date and show-time are ignored and fmt is used as the format control string. See the Notes Section for the defined control characters which can be used.
Examples (assuming *locale* is "en_ZA" and a CL -2 Time Zone) @verbatim (format t "~:/cl-l10n:format-time/" 3192624000) prints `03/03/01'
(format t "~@/cl-l10n:format-time/" 3192624000) prints `18:00:00'
(format t "~:@/cl-l10n:format-time/" 3192624000) prints `Sat 03 Mar 2001 18:00:00 +0200'
(format t "~v,v/cl-l10n:format-time/" "fr_FR" "%A" 3192624000) prints `samedi'
(format t "~,v/cl-l10n:format-time/" "%A" 3192624000) prints `Saturday'
; The Time Zone can be overriden with an extra v argument (format t "~v,v,v/cl-l10n:format-time/" "en_ZA" "%A" -8 3192624000) print `Sunday'
cl-l10::format
into your package gives
you a few new format directives.
The new directives are ~U : Time and Date (universal-time),
~N : Numbers and ~M : Monetary values. All other format directives
are unchanged and work as normal. These new directives are
drop in replacements for the ~/cl-l10n:format-?/ calls.
@verbatim ;; These examples assume an en_ZA locale and a CL -2 Time Zone (in-package :cl-user)
(shadowing-import 'cl-l10n::format)
(format t "~:U" 3192624000) prints `03/03/2001'
(format t "~,vU" "%A" 3192624000) prints `Saturday'
(format t "~:N" 3192624000) prints `3,192,624,000'
(format t "~:M" 3192624000) prints `ZAR 3,192,624,000.00`
Tries very hard to make sense out of the argument time-string using locale and returns a single integer representing the universal time if successful. If not, it returns nil. If the :error-on-mismatch keyword is true, parse-time will signal an error instead of returning nil. Default values for each part of the time/date can be specified by the appropriate :default- keyword. These keywords can be given a numeric value or the keyword :current to set them to the current value. The default-default values are 00:00:00 on the current date, current time-zone.
Example, what date does the string "02/03/05" specify? parse-time will use the current locale or the locale-designator passed to it to determine the correct format for dates. In America (en_US) this date is the 3rd of February 2005, with an South African English (en_ZA) locale this date is the 2nd of March 2005 and with a Swedish locale (sv_SE) it's the 5th of March 2002.
Note. This is not my work but was done by Jim Healy and is a part of the CMUCL project, which has been modified to handle differt locales.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
standard-object
The class representing a loaded locale.
standard-object
The class representing a loaded category within a locale.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
error
Root CL-L10N condition which will be signalled when an exceptional situation occurs.
error
Error which is signalled when an error occurs when parsing numbers
or time strings.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |