61 lines
6.8 KiB
HTML
61 lines
6.8 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<title>CLiki: cl-l10n</title>
|
||
|
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
|
||
|
href="https://www.cliki.net/site/feed/article.atom?title=cl-l10n">
|
||
|
<link rel="stylesheet" href="static/css/style.css">
|
||
|
<link rel="stylesheet" href="static/css/colorize.css">
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<span class="hidden">CLiki - cl-l10n</span>
|
||
|
<div id="content"><div id="content-area"><div id="article-title">cl-l10n</div><div id="article">cl-l10n is a portable library for handling program localization. The <a href="https://common-lisp.net/project/cl-l10n/">project home</a> is at <a href="common-lisp.net.html" class="internal">common-lisp.net</a>.<p>It currently supports locale specific printing of numbers, monetary values and dates/<a href="time.html" class="internal">time</a>s, as well as provides support for <a href="string.html" class="internal">string</a> localization through a <a href="https://www.gnu.org/software/gettext/">gettext</a>-like mechanism.<p>It currently runs on <a href="SBCL.html" class="internal">SBCL</a>, <a href="ECL.html" class="internal">ECL</a>, <a href="ACL.html" class="internal">ACL</a>, <a href="CMUCL.html" class="internal">CMUCL</a>, <a href="CLISP.html" class="internal">CLISP</a>, and <a href="Lispworks.html" class="internal">Lispworks</a> although porting to new implementations should simply be a matter of defining a new <a href="https://quickref.common-lisp.net/uiop.html#index-getenv">getenv</a> function. <p>Depends on: <a href="uiop.html" class="internal">uiop</a>, <a href="alexandria.html" class="internal">alexandria</a>, <a href="iterate.html" class="internal">iterate</a>, <a href="cl-ppcre.html" class="internal">cl-ppcre</a>, <a href="bind.html" class="internal">bind</a>, <a href="cl-fad.html" class="internal">cl-fad</a>, <a href="flexi-streams.html" class="internal">flexi-streams</a>, <a href="cxml.html" class="internal">cxml</a>, <a href="local-time.html" class="internal">local-time</a>, <a href="closer-mop.html" class="internal">closer-mop</a><p>Repository: <a href="https://gitlab.common-lisp.net/cl-l10n/cl-l10n">https://gitlab.common-lisp.net/cl-l10n/cl-l10n</a><p>License: <a href="BSD.html" class="category">BSD</a> 3-Clause<p><img src="https://common-lisp.net/project/cl-l10n/files/p0rn.jpeg" alt="brief example"><p>Possibly evil features.<p>Beware of the misguiding documentation - in current (i.e. 0.4) version - <a href="https://common-lisp.net/project/cl-l10n/docs/cl-l10n_4.html">i18n API as described in documentation</a> doesn't match the source code at all.<p><a href="https://www.cliki.net/site/HyperSpec/Body/fun_format.html" class="hyperspec">FORMAT</a> and <a href="https://www.cliki.net/site/HyperSpec/Body/mac_formatter.html" class="hyperspec">FORMATTER</a> are unexported symbols in the cl-l10n package.
|
||
|
<a href="https://www.cliki.net/site/HyperSpec/Body/fun_shadowing-import.html" class="hyperspec">SHADOWING-IMPORT</a>ing them it will give you 3 new format directives.<p><ul>
|
||
|
<li>~N: For printing numbers.</li>
|
||
|
<li>~M: For formatting monetary values.</li>
|
||
|
<li>~U: For dates and times (universal time). </li>
|
||
|
</ul><p><h2>Examples</h2><p><div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_format.html" class="symbol">format</a> <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="symbol">nil</a> <span class="string">"~v,,vU"</span> <span class="string">"en_ZA"</span> 0 3321593252</span>)</span>
|
||
|
=> "Mon 04 Apr 2005 08:47:32 +0000"</span></div><p><div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_format.html" class="symbol">format</a> <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="symbol">nil</a> <span class="string">"~vN"</span> <span class="string">"en_ZA"</span> 19932.399</span>)</span>
|
||
|
=> "19,932.399"</span></div><p><div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_format.html" class="symbol">format</a> <a href="https://www.cliki.net/site/HyperSpec/Body/any_nil.html" class="symbol">nil</a> <span class="string">"~vM"</span> <span class="string">"sv_SE"</span> 19932.399</span>)</span>
|
||
|
=> "19 932,40 kr"</span></div><p>(I've found these to be a lot easier to use than <tt>~/cl-l10n:format-?/</tt> calls)<p><b>NB:</b> All output from these directives are dependent on the current
|
||
|
locale (but not on the phase of the moon).<p>Number and date/time parsing is also supported now (1 April 2005).<p><hr>
|
||
|
<a href="internationalization.html" class="category">internationalization</a></div></div>
|
||
|
<div id="footer" class="buttonbar"><ul><li><a href="cl-l10n.html">Current version</a></li>
|
||
|
<li><a href="https://www.cliki.net/site/history?article=cl-l10n">History</a></li>
|
||
|
<li><a href="https://www.cliki.net/site/backlinks?article=cl-l10n">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=cl-l10n&from-revision=3801246131">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
|
||
|
</div>
|
||
|
<div id="header-buttons" class="buttonbar">
|
||
|
<ul>
|
||
|
<li><a href="https://www.cliki.net/">Home</a></li>
|
||
|
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
|
||
|
<li><a href="CLiki.html">About</a></li>
|
||
|
<li><a href="Text Formatting.html">Text Formatting</a></li>
|
||
|
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
|
||
|
</ul>
|
||
|
<div id="search">
|
||
|
<form action="https://www.cliki.net/site/search">
|
||
|
<label for="search_query" class="hidden">Search CLiki</label>
|
||
|
<input type="text" name="query" id="search_query" value="" />
|
||
|
<input type="submit" value="search" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div id="pageheader">
|
||
|
<div id="header">
|
||
|
<span id="logo">CLiki</span>
|
||
|
<span id="slogan">the common lisp wiki</span>
|
||
|
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
|
||
|
<label for="login_name" class="hidden">Account name</label>
|
||
|
<input type="text" name="name" id="login_name" class="login_input" />
|
||
|
<label for= "login_password" class="hidden">Password</label>
|
||
|
<input type="password" name="password" id="login_password" class="login_input" />
|
||
|
<input type="submit" name="login" value="login" id="login_submit" /><br />
|
||
|
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
|
||
|
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body></html>
|