-
Notifications
You must be signed in to change notification settings - Fork 0
/
amelinium.i18n.html
33 lines (33 loc) · 35.2 KB
/
amelinium.i18n.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>amelinium.i18n documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Amelinium</span> <span class="project-version">1.0.1</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li><li class="depth-1 "><a href="20_hypermedia.html"><div class="inner"><span>Hypermedia-driven</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="amelinium.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>amelinium</span></div></a></li><li class="depth-2 branch"><a href="amelinium.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-2"><a href="amelinium.api.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>api</span></div></a></li><li class="depth-3"><a href="amelinium.api.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4"><a href="amelinium.api.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3"><a href="amelinium.api.url.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>url</span></div></a></li><li class="depth-2 branch"><a href="amelinium.app.html"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>app</span></div></a></li><li class="depth-2"><a href="amelinium.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>algo</span></div></div></li><li class="depth-4 branch"><a href="amelinium.auth.algo.append.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>append</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.fail.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fail</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.pbkdf2.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pbkdf2</span></div></a></li><li class="depth-4"><a href="amelinium.auth.algo.scrypt.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scrypt</span></div></a></li><li class="depth-3 branch"><a href="amelinium.auth.pwd.html"><div class="inner"><span class="tree" style="top: -145px;"><span class="top" style="height: 154px;"></span><span class="bottom"></span></span><span>pwd</span></div></a></li><li class="depth-3"><a href="amelinium.auth.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-2"><a href="amelinium.common.html"><div class="inner"><span class="tree" style="top: -238px;"><span class="top" style="height: 247px;"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-3"><a href="amelinium.common.oplog.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>oplog</span></div></a></li><li class="depth-4"><a href="amelinium.common.oplog.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.populators.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-3"><a href="amelinium.common.swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>swagger</span></div></a></li><li class="depth-2 branch"><a href="amelinium.core.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><a href="amelinium.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3"><a href="amelinium.db.sql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sql</span></div></a></li><li class="depth-2 branch"><a href="amelinium.errors.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-2"><a href="amelinium.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>client</span></div></div></li><li class="depth-4"><a href="amelinium.http.client.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.handler.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-3"><a href="amelinium.http.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.coercion.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>coercion</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.content.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>content</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.debug.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>debug</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.format.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>format</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.headers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>headers</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.language.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>language</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.lazy-req.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>lazy-req</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.populators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.remote-ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>remote-ip</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.roles.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>roles</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-4"><a href="amelinium.http.middleware.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.router.html"><div class="inner"><span class="tree" style="top: -424px;"><span class="top" style="height: 433px;"></span><span class="bottom"></span></span><span>router</span></div></a></li><li class="depth-3"><a href="amelinium.http.server.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.server.jetty.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>jetty</span></div></a></li><li class="depth-4"><a href="amelinium.http.server.undertow.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>undertow</span></div></a></li><li class="depth-2 current"><a href="amelinium.i18n.html"><div class="inner"><span class="tree" style="top: -672px;"><span class="top" style="height: 681px;"></span><span class="bottom"></span></span><span>i18n</span></div></a></li><li class="depth-3"><a href="amelinium.i18n.pluralizers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pluralizers</span></div></a></li><li class="depth-2 branch"><a href="amelinium.identity.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-2 branch"><a href="amelinium.locale.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>locale</span></div></a></li><li class="depth-2 branch"><a href="amelinium.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>model</span></div></div></li><li class="depth-3 branch"><a href="amelinium.model.confirmation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>confirmation</span></div></a></li><li class="depth-3"><a href="amelinium.model.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>proto</span></div></div></li><li class="depth-3 branch"><a href="amelinium.proto.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.proto.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.schemas.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>schemas</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></div></li><li class="depth-3"><a href="amelinium.server.ssl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ssl</span></div></a></li><li class="depth-2 branch"><a href="amelinium.system.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>system</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></div></li><li class="depth-3 branch"><a href="amelinium.types.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.types.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.utils.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="amelinium.web.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>web</span></div></a></li><li class="depth-3"><a href="amelinium.web.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4 branch"><a href="amelinium.web.controller.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-4"><a href="amelinium.web.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.js.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>js</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.taggers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>taggers</span></div></a></li><li class="depth-3"><a href="amelinium.web.url.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>url</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="amelinium.i18n.html#var-*handle-missing-keys*"><div class="inner"><span>*handle-missing-keys*</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-init-translations"><div class="inner"><span>init-translations</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-lang"><div class="inner"><span>lang</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-missing-key"><div class="inner"><span>missing-key</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-no-default"><div class="inner"><span>no-default</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-prep-pluralizer"><div class="inner"><span>prep-pluralizer</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-prep-translations"><div class="inner"><span>prep-translations</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-tr"><div class="inner"><span>tr</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-tr-sub"><div class="inner"><span>tr-sub</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-translate"><div class="inner"><span>translate</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-translate-sub"><div class="inner"><span>translate-sub</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-translate-sub-with"><div class="inner"><span>translate-sub-with</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-translate-with"><div class="inner"><span>translate-with</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-translation-fn"><div class="inner"><span>translation-fn</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-translations"><div class="inner"><span>translations</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-translator"><div class="inner"><span>translator</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-translator-sub"><div class="inner"><span>translator-sub</span></div></a></li><li class="depth-1"><a href="amelinium.i18n.html#var-wrap-translate"><div class="inner"><span>wrap-translate</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">amelinium.i18n</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>I18N support for amelinium</p>
</div></div><div class="public anchor" id="var-*handle-missing-keys*"><h3>*handle-missing-keys*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L26">view source</a></div></div><div class="public anchor" id="var-init-translations"><h3>init-translations</h3><div class="usage"><code>(init-translations config)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L298">view source</a></div></div><div class="public anchor" id="var-lang"><h3>lang</h3><div class="usage"><code>(lang req)</code></div><div class="doc"><div class="markdown"><p>Tries to obtain a language from a request map (<code>:language/id</code> key). Falls back to a default language (<code>:language/default</code>) if the first one is <code>nil</code>. Returns a keyword.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L30">view source</a></div></div><div class="public anchor" id="var-missing-key"><h3>missing-key</h3><div class="usage"><code>(missing-key f locale k)</code></div><div class="doc"><div class="markdown"><p>Returns a warning string for a missing key (defined under a special key <code>:amelinium/missing-key</code>) if the dynamic variable <code>*handle-missing-keys*</code> is set to a truthy value. Otherwise it returns <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L236">view source</a></div></div><div class="public anchor" id="var-no-default"><h3>no-default</h3><h4 class="type">macro</h4><div class="usage"><code>(no-default & body)</code></div><div class="doc"><div class="markdown"><p>Sets <code>*handle-missing-keys*</code> dynamic variable to <code>false</code>, causing translation functions to return <code>nil</code> when translation key is not found instead of a warning string. Also, when used with <code>translation-fn</code>, <code>translator</code> or <code>translator-sub</code> causes generated function to always behave that way.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L225">view source</a></div></div><div class="public anchor" id="var-prep-pluralizer"><h3>prep-pluralizer</h3><div class="usage"><code>(prep-pluralizer config lang translations)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L263">view source</a></div></div><div class="public anchor" id="var-prep-translations"><h3>prep-translations</h3><div class="usage"><code>(prep-translations config)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L292">view source</a></div></div><div class="public anchor" id="var-tr"><h3>tr</h3><div class="usage"><code>(tr req key)</code><code>(tr req key x)</code><code>(tr req key x y)</code><code>(tr req key x y & more)</code></div><div class="doc"><div class="markdown"><p>Returns a translation string for the given locale (obtained from a request map) and the keyword <code>key</code> using a translation function (obtained from a request map or a <code>Match</code> object). Any optional arguments are passed as they are.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> (which can be set using <code>no-default</code> macro) then the function will return <code>nil</code> when a key is missing instead of a warning string.</p>
<p>If a translation function <code>tr</code> was generated (using <code>translation-fn</code>, <code>translator</code> or <code>translator-sub</code>) with <code>*handle-missing-keys*</code> dynamic variable set to <code>false</code> or <code>nil</code> then it will always return <code>nil</code> when a key is missing, regardless of current value of <code>*handle-missing-keys*</code> in the calling context.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L187">view source</a></div></div><div class="public anchor" id="var-tr-sub"><h3>tr-sub</h3><div class="usage"><code>(tr-sub req key-ns key-name)</code><code>(tr-sub req key-ns key-name x)</code><code>(tr-sub req key-ns key-name x y)</code><code>(tr-sub req key-ns key-name x y & more)</code></div><div class="doc"><div class="markdown"><p>Returns a translation string for the given locale (obtained from a request map), the namespace name <code>key-ns</code> and the key name <code>key-name</code>. Useful to translate nested keys which are translated to fully-qualified keywords. The translation function will be obtained by calling <code>translator</code> on <code>req</code> (which may be a request map or a <code>Match</code> object). Any additional arguments are passed as they are.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> (which can be set using <code>no-default</code> macro) then the function will return <code>nil</code> when a key is missing instead of a warning string.</p>
<p>If a translation function <code>tr</code> was generated (using <code>translation-fn</code>, <code>translator</code> or <code>translator-sub</code>) with <code>*handle-missing-keys*</code> dynamic variable set to <code>false</code> or <code>nil</code> then it will always return <code>nil</code> when a key is missing, regardless of current value of <code>*handle-missing-keys*</code> in the calling context.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L205">view source</a></div></div><div class="public anchor" id="var-translate"><h3>translate</h3><div class="usage"><code>(translate req locale key)</code><code>(translate req locale key x)</code><code>(translate req locale key x y)</code><code>(translate req locale key x y & more)</code></div><div class="doc"><div class="markdown"><p>Returns a translation string for the given <code>locale</code> (language ID) and the keyword <code>key</code> using a translation function obtained from the given request map (<code>req</code>) by calling <code>translator</code> function on it. Any optional arguments are passed as they are.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> (which can be set using <code>no-default</code> macro) then the function will return <code>nil</code> when a key is missing instead of a warning string.</p>
<p>If a translation function <code>tr</code> was generated (using <code>translation-fn</code>, <code>translator</code> or <code>translator-sub</code>) with <code>*handle-missing-keys*</code> dynamic variable set to <code>false</code> or <code>nil</code> then it will always return <code>nil</code> when a key is missing, regardless of current value of <code>*handle-missing-keys*</code> in the calling context.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L148">view source</a></div></div><div class="public anchor" id="var-translate-sub"><h3>translate-sub</h3><div class="usage"><code>(translate-sub req locale key-ns key-name)</code><code>(translate-sub req locale key-ns key-name x)</code><code>(translate-sub req locale key-ns key-name x y)</code><code>(translate-sub req locale key-ns key-name x y & more)</code></div><div class="doc"><div class="markdown"><p>Returns a translation string for the given <code>locale</code> (language ID), the namespace name <code>ns-name</code> and the key name <code>key-name</code>. Useful to translate nested keys which are translated to fully-qualified keywords. The translation function will be obtained by calling <code>translator</code> on <code>req</code> (which may be a request map or a <code>Match</code> object). Any additional arguments are passed as they are.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> (which can be set using <code>no-default</code> macro) then the function will return <code>nil</code> when a key is missing instead of a warning string.</p>
<p>If a translation function <code>tr</code> was generated (using <code>translation-fn</code>, <code>translator</code> or <code>translator-sub</code>) with <code>*handle-missing-keys*</code> dynamic variable set to <code>false</code> or <code>nil</code> then it will always return <code>nil</code> when a key is missing, regardless of current value of <code>*handle-missing-keys*</code> in the calling context.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L167">view source</a></div></div><div class="public anchor" id="var-translate-sub-with"><h3>translate-sub-with</h3><div class="usage"><code>(translate-sub-with tf locale key-ns key-name)</code><code>(translate-sub-with tf locale key-ns key-name x)</code><code>(translate-sub-with tf locale key-ns key-name x y)</code><code>(translate-sub-with tf locale key-ns key-name x y & more)</code></div><div class="doc"><div class="markdown"><p>Returns a translation string for the given <code>locale</code> (language ID), the namespace name <code>ns-name</code> and the key name <code>key-name</code>, using the given translation function <code>tf</code>. Useful to translate nested keys which are translated to fully-qualified keywords. Any additional arguments are passed as they are.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> (which can be set using <code>no-default</code> macro) then the function will return <code>nil</code> when a key is missing instead of a warning string.</p>
<p>If a translation function <code>tr</code> was generated (using <code>translation-fn</code>, <code>translator</code> or <code>translator-sub</code>) with <code>*handle-missing-keys*</code> dynamic variable set to <code>false</code> or <code>nil</code> then it will always return <code>nil</code> when a key is missing, regardless of current value of <code>*handle-missing-keys*</code> in the calling context.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L129">view source</a></div></div><div class="public anchor" id="var-translate-with"><h3>translate-with</h3><div class="usage"><code>(translate-with tf locale key)</code><code>(translate-with tf locale key x)</code><code>(translate-with tf locale key x y)</code><code>(translate-with tf locale key x y & more)</code></div><div class="doc"><div class="markdown"><p>Returns a translation string for the given <code>locale</code> (language ID) and the keyword <code>key</code> using a translation function <code>tf</code>. Any optional arguments are passed as they are.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> (which can be set using <code>no-default</code> macro) then the function will return <code>nil</code> when a key is missing instead of a warning string.</p>
<p>If a translation function <code>tr</code> was generated (using <code>translation-fn</code>, <code>translator</code> or <code>translator-sub</code>) with <code>*handle-missing-keys*</code> dynamic variable set to <code>false</code> or <code>nil</code> then it will always return <code>nil</code> when a key is missing, regardless of current value of <code>*handle-missing-keys*</code> in the calling context.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L111">view source</a></div></div><div class="public anchor" id="var-translation-fn"><h3>translation-fn</h3><div class="usage"><code>(translation-fn req-or-match)</code></div><div class="doc"><div class="markdown"><p>Tries to obtain translation function from a route data in a request map or a <code>Match</code> object and if that fails from a request map itself. Falls back to a global variable <code>amelinium.i18n/translations</code>.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> then the generated translation function will always generate <code>nil</code> when a key is missing, ignoring dynamic binding.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L37">view source</a></div></div><div class="public anchor" id="var-translations"><h3>translations</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L24">view source</a></div></div><div class="public anchor" id="var-translator"><h3>translator</h3><div class="usage"><code>(translator req-or-match)</code><code>(translator req-or-match locale)</code></div><div class="doc"><div class="markdown"><p>Tries to obtain translation function from a route data in a request map or a <code>Match</code> object and if that fails from a request map itself. Falls back to a global variable <code>amelinium.i18n/translations</code>.</p>
<p>When <code>locale</code> is given it will generate a translation function with predefined translator and locale. If it’s not given, it will use language obtained from the context map <code>req</code>.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> then the generated translation function will always generate <code>nil</code> when a key is missing, ignoring dynamic binding.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L60">view source</a></div></div><div class="public anchor" id="var-translator-sub"><h3>translator-sub</h3><div class="usage"><code>(translator-sub req-or-match)</code><code>(translator-sub req-or-match locale)</code></div><div class="doc"><div class="markdown"><p>Tries to obtain translation function from a route data in a request map or a <code>Match</code> object and if that fails from a request map itself. Falls back to a global variable <code>amelinium.i18n/translations</code>. The translation function will accept <code>key-ns</code> and <code>key-name</code> arguments which will be used to build a keyword with the given namespace and name. This keyword will be used as a translation key.</p>
<p>When <code>locale</code> is given it will generate a translation function with predefined translator and locale. If it’s not given, it will use language obtained from the context map <code>req</code>.</p>
<p>If <code>*handle-missing-keys*</code> dynamic variable is set to <code>false</code> or <code>nil</code> then the generated translation function will always generate <code>nil</code> when a key is missing, ignoring dynamic binding.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L83">view source</a></div></div><div class="public anchor" id="var-wrap-translate"><h3>wrap-translate</h3><div class="usage"><code>(wrap-translate f)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/i18n.clj#L243">view source</a></div></div></div></body></html>