mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 03:04:43 +03:00
deploy: 34f1ddfc8c
This commit is contained in:
parent
90555c6a8e
commit
7a0080e3f2
5
.build
5
.build
@ -1,5 +1,4 @@
|
||||
404.html
|
||||
Mix.Tasks.AnalyzePlans.html
|
||||
Mix.Tasks.CleanClickhouse.html
|
||||
Mix.Tasks.CreateFreeSubscription.html
|
||||
Mix.Tasks.DownloadCountryDatabase.html
|
||||
@ -240,8 +239,8 @@ dist/merriweather-latin-ext-300-normal-K6L27CZ5.woff2
|
||||
dist/merriweather-vietnamese-300-italic-EHHNZPUO.woff2
|
||||
dist/merriweather-vietnamese-300-normal-U376L4Z4.woff2
|
||||
dist/remixicon-NKANDIL5.woff2
|
||||
dist/search_data-92FB47FD.js
|
||||
dist/sidebar_items-CBF5BFFF.js
|
||||
dist/search_data-2D662DC1.js
|
||||
dist/sidebar_items-76FA772C.js
|
||||
index.html
|
||||
readme.html
|
||||
search.html
|
||||
|
2
404.html
2
404.html
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -1,210 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="generator" content="ExDoc v0.30.3">
|
||||
<meta name="project" content="Plausible v0.0.1">
|
||||
|
||||
<title>mix analyze_plans — Plausible v0.0.1</title>
|
||||
<link rel="stylesheet" href="dist/html-elixir-P5GXSCHE.css" />
|
||||
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
<script async src="dist/html-CGDDOCMI.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body data-type="tasks" class="page-task">
|
||||
<script>
|
||||
|
||||
try {
|
||||
var settings = JSON.parse(localStorage.getItem('ex_doc:settings') || '{}');
|
||||
|
||||
if (settings.theme === 'dark' ||
|
||||
((settings.theme === 'system' || settings.theme == null) &&
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||||
) {
|
||||
document.body.classList.add('dark')
|
||||
}
|
||||
} catch (error) { }
|
||||
</script>
|
||||
|
||||
<div class="main">
|
||||
|
||||
<button class="sidebar-button sidebar-toggle" aria-label="toggle sidebar">
|
||||
<i class="ri-menu-line ri-lg" title="Collapse/expand sidebar"></i>
|
||||
</button>
|
||||
|
||||
<section class="sidebar">
|
||||
<form class="sidebar-search" action="search.html">
|
||||
<button type="submit" class="search-button" aria-label="Submit Search">
|
||||
<i class="ri-search-2-line" aria-hidden="true" title="Submit search"></i>
|
||||
</button>
|
||||
<button type="button" tabindex="-1" class="search-close-button" aria-label="Cancel Search">
|
||||
<i class="ri-close-line ri-lg" aria-hidden="true" title="Cancel search"></i>
|
||||
</button>
|
||||
<label class="search-label">
|
||||
<p class="sr-only">Search</p>
|
||||
<input name="q" type="text" class="search-input" placeholder="Search..." aria-label="Input your search terms" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
|
||||
</label>
|
||||
</form>
|
||||
|
||||
<div class="autocomplete">
|
||||
<div class="autocomplete-results">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sidebar-header">
|
||||
|
||||
<a href="readme.html">
|
||||
<img src="assets/logo.png" alt="Plausible" class="sidebar-projectImage">
|
||||
</a>
|
||||
|
||||
<div class="sidebar-projectDetails">
|
||||
<a href="readme.html" class="sidebar-projectName" translate="no">
|
||||
Plausible
|
||||
</a>
|
||||
<div class="sidebar-projectVersion" translate="no">
|
||||
v0.0.1
|
||||
</div>
|
||||
</div>
|
||||
<ul class="sidebar-listNav">
|
||||
<li><a id="extras-list-link" href="#full-list">Pages</a></li>
|
||||
|
||||
<li><a id="modules-list-link" href="#full-list">Modules</a></li>
|
||||
|
||||
|
||||
<li><a id="tasks-list-link" href="#full-list"><span translate="no">Mix</span> Tasks</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="gradient"></div>
|
||||
<ul id="full-list"></ul>
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<output role="status" id="toast"></output>
|
||||
<div class="content-outer">
|
||||
<div id="content" class="content-inner">
|
||||
|
||||
<h1>
|
||||
<button class="icon-action display-settings">
|
||||
<i class="ri-settings-3-line"></i>
|
||||
<span class="sr-only">Settings</span>
|
||||
</button>
|
||||
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/mix/tasks/analyze_plans.ex#L1" title="View Source" class="icon-action" rel="help">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
|
||||
<span translate="no">mix analyze_plans</span>
|
||||
<small class="app-vsn" translate="no">(Plausible v0.0.1)</small>
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
<section id="summary" class="details-list">
|
||||
<h1 class="section-heading">
|
||||
<a class="hover-link" href="#summary">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
Summary
|
||||
</a>
|
||||
</h1>
|
||||
<div class="summary-functions summary">
|
||||
<h2>
|
||||
<a href="#functions">Functions</a>
|
||||
</h2>
|
||||
|
||||
<div class="summary-row">
|
||||
<div class="summary-signature">
|
||||
<a href="#run/1" translate="no">run(_)</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="summary-synopsis"><p>Callback implementation for <a href="https://hexdocs.pm/mix/Mix.Task.html#c:run/1"><code class="inline">Mix.Task.run/1</code></a>.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<section id="functions" class="details-list">
|
||||
<h1 class="section-heading">
|
||||
<a class="hover-link" href="#functions">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
Functions
|
||||
</a>
|
||||
</h1>
|
||||
<div class="functions-list">
|
||||
<section class="detail" id="run/1">
|
||||
|
||||
<div class="detail-header">
|
||||
<a href="#run/1" class="detail-link" title="Link to this function">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
<span class="sr-only">Link to this function</span>
|
||||
</a>
|
||||
<h1 class="signature" translate="no">run(_)</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/mix/tasks/analyze_plans.ex#L7" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Callback implementation for <a href="https://hexdocs.pm/mix/Mix.Task.html#c:run/1"><code class="inline">Mix.Task.run/1</code></a>.</p>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="footer">
|
||||
<p>
|
||||
|
||||
<span class="line">
|
||||
<button class="a-main footer-button display-quick-switch" title="Search HexDocs packages">
|
||||
Search HexDocs
|
||||
</button>
|
||||
|
||||
<a href="Plausible.epub" title="ePub version">
|
||||
Download ePub version
|
||||
</a>
|
||||
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p class="built-using">
|
||||
Built using
|
||||
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener" translate="no">ExDoc</a> (v0.30.3) for the
|
||||
|
||||
<a href="https://elixir-lang.org" title="Elixir" target="_blank" translate="no">Elixir programming language</a>
|
||||
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
<script>mermaid.initialize({startOnLoad: true})</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -1114,23 +1114,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="7464421991-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="7464421991-1">)</span><span class="w">
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="6155216714-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="6155216714-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="7464421991-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="6155216714-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="7464421991-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="6155216714-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="7464421991-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="7464421991-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="6155216714-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="6155216714-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="7464421991-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="7464421991-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="7464421991-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="7464421991-7">(</span><span class="n">i</span><span class="p" data-group-id="7464421991-7">)</span><span class="p" data-group-id="7464421991-6">}</span><span class="w"> </span><span class="k" data-group-id="7464421991-5">end</span><span class="p" data-group-id="7464421991-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7464421991-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="7464421991-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="7464421991-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="7464421991-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="6155216714-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="6155216714-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="6155216714-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="6155216714-7">(</span><span class="n">i</span><span class="p" data-group-id="6155216714-7">)</span><span class="p" data-group-id="6155216714-6">}</span><span class="w"> </span><span class="k" data-group-id="6155216714-5">end</span><span class="p" data-group-id="6155216714-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6155216714-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="6155216714-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="6155216714-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="6155216714-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="7464421991-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="7464421991-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="7464421991-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7464421991-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="7464421991-13">(</span><span class="p" data-group-id="7464421991-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="7464421991-12">]</span><span class="p" data-group-id="7464421991-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="6155216714-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="6155216714-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="6155216714-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6155216714-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="6155216714-13">(</span><span class="p" data-group-id="6155216714-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="6155216714-12">]</span><span class="p" data-group-id="6155216714-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -102,7 +102,7 @@ Plausible
|
||||
</button>
|
||||
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L20" title="View Source" class="icon-action" rel="help">
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L22" title="View Source" class="icon-action" rel="help">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
@ -154,6 +154,16 @@ Plausible
|
||||
|
||||
</div>
|
||||
|
||||
<div class="summary-row">
|
||||
<div class="summary-signature">
|
||||
<a href="#site_limit/1" translate="no">site_limit(user)</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="summary-synopsis"><p>Returns the limit of sites a user can have.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="summary-row">
|
||||
<div class="summary-signature">
|
||||
<a href="#subscription_interval/1" translate="no">subscription_interval(subscription)</a>
|
||||
@ -168,7 +178,7 @@ Plausible
|
||||
|
||||
</div>
|
||||
|
||||
<div class="summary-synopsis"><p>Returns the most appropriate plan for a user based on their usage during a
|
||||
<div class="summary-synopsis"><p>Returns the most appropriate plan for a user based on their usage during a
|
||||
given cycle.</p></div>
|
||||
|
||||
</div>
|
||||
@ -205,7 +215,7 @@ Functions
|
||||
</a>
|
||||
<h1 class="signature" translate="no">allowance(subscription)</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L118" class="icon-action" rel="help" title="View Source">
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L164" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
@ -215,6 +225,12 @@ Functions
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<div class="specs">
|
||||
|
||||
<pre translate="no"><span class="attribute">@spec</span> allowance(Plausible.Billing.Subscription.t()) :: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">non_neg_integer</a>() | nil</pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
</section>
|
||||
@ -229,7 +245,7 @@ Functions
|
||||
</a>
|
||||
<h1 class="signature" translate="no">find(product_id_or_subscription, scope \\ all())</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L83" class="icon-action" rel="help" title="View Source">
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L92" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
@ -262,7 +278,7 @@ Functions
|
||||
</a>
|
||||
<h1 class="signature" translate="no">for_user(user)</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L51" class="icon-action" rel="help" title="View Source">
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L60" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
@ -282,6 +298,35 @@ Functions
|
||||
still choose from old plans.</p>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="site_limit/1">
|
||||
|
||||
<div class="detail-header">
|
||||
<a href="#site_limit/1" class="detail-link" title="Link to this function">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
<span class="sr-only">Link to this function</span>
|
||||
</a>
|
||||
<h1 class="signature" translate="no">site_limit(user)</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L116" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<div class="specs">
|
||||
|
||||
<pre translate="no"><span class="attribute">@spec</span> site_limit(<a href="Plausible.Auth.User.html#t:t/0">Plausible.Auth.User.t</a>()) :: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">non_neg_integer</a>() | :unlimited</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<p>Returns the limit of sites a user can have.</p><p>For enterprise customers, returns :unlimited. The site limit is checked in a
|
||||
background job so as to avoid service disruption.</p>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="subscription_interval/1">
|
||||
|
||||
<div class="detail-header">
|
||||
@ -291,7 +336,7 @@ still choose from old plans.</p>
|
||||
</a>
|
||||
<h1 class="signature" translate="no">subscription_interval(subscription)</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L99" class="icon-action" rel="help" title="View Source">
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L146" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
@ -313,7 +358,7 @@ still choose from old plans.</p>
|
||||
</a>
|
||||
<h1 class="signature" translate="no">suggest(user, usage_during_cycle)</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L160" class="icon-action" rel="help" title="View Source">
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L204" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
@ -330,10 +375,10 @@ still choose from old plans.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<p>Returns the most appropriate plan for a user based on their usage during a
|
||||
given cycle.</p><p>If the usage during the cycle exceeds the enterprise-level threshold, or if
|
||||
the user already belongs to an enterprise plan, it suggests the :enterprise
|
||||
plan.</p><p>Otherwise, it recommends the plan where the cycle usage falls just under the
|
||||
<p>Returns the most appropriate plan for a user based on their usage during a
|
||||
given cycle.</p><p>If the usage during the cycle exceeds the enterprise-level threshold, or if
|
||||
the user already belongs to an enterprise plan, it suggests the :enterprise
|
||||
plan.</p><p>Otherwise, it recommends the plan where the cycle usage falls just under the
|
||||
plan's limit from the available options for the user.</p>
|
||||
</section>
|
||||
</section>
|
||||
@ -346,7 +391,7 @@ plan's limit from the available options for the user.</p>
|
||||
</a>
|
||||
<h1 class="signature" translate="no">yearly_product_ids()</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L69" class="icon-action" rel="help" title="View Source">
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/plans.ex#L78" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -198,18 +198,6 @@ Plausible
|
||||
|
||||
</div>
|
||||
|
||||
<div class="summary-row">
|
||||
<div class="summary-signature">
|
||||
<a href="#sites_limit/1" translate="no">sites_limit(user)</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="summary-synopsis"><p>Returns the number of sites that an account is allowed to have. Accounts for
|
||||
grandfathering old accounts to unlimited websites and ignores site limit on self-hosted
|
||||
installations.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="summary-row">
|
||||
<div class="summary-signature">
|
||||
<a href="#subscription_cancelled/1" translate="no">subscription_cancelled(params)</a>
|
||||
@ -480,7 +468,7 @@ Functions
|
||||
</a>
|
||||
<h1 class="signature" translate="no">paddle_api()</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/billing.ex#L329" class="icon-action" rel="help" title="View Source">
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/billing.ex#L286" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
@ -491,30 +479,6 @@ Functions
|
||||
<section class="docstring">
|
||||
|
||||
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="sites_limit/1">
|
||||
|
||||
<div class="detail-header">
|
||||
<a href="#sites_limit/1" class="detail-link" title="Link to this function">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
<span class="sr-only">Link to this function</span>
|
||||
</a>
|
||||
<h1 class="signature" translate="no">sites_limit(user)</h1>
|
||||
|
||||
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/billing/billing.ex#L165" class="icon-action" rel="help" title="View Source">
|
||||
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
|
||||
<span class="sr-only">View Source</span>
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Returns the number of sites that an account is allowed to have. Accounts for
|
||||
grandfathering old accounts to unlimited websites and ignores site limit on self-hosted
|
||||
installations.</p>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="subscription_cancelled/1">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -119,7 +119,7 @@ Plausible
|
||||
the set of natural languages that are preferred as a response to the request.
|
||||
Language tags function are provided in <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a>.</p><p>The format of an <code class="inline">Accept-Language</code> header is as follows in <code class="inline">ABNF</code> format:</p><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="nc">Accept</span><span class="o">-</span><span class="nc">Language</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"Accept-Language"</span><span class="w"> </span><span class="s">":"</span><span class="w">
|
||||
</span><span class="mi">1</span><span class="c1">#( language-range [ ";" "q" "=" qvalue ] )</span><span class="w">
|
||||
</span><span class="n">language</span><span class="o">-</span><span class="n">range</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p" data-group-id="3195642082-1">(</span><span class="w"> </span><span class="p" data-group-id="3195642082-2">(</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="mi">8</span><span class="nc">ALPHA</span><span class="w"> </span><span class="o">*</span><span class="p" data-group-id="3195642082-3">(</span><span class="w"> </span><span class="s">"-"</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="mi">8</span><span class="nc">ALPHA</span><span class="w"> </span><span class="p" data-group-id="3195642082-3">)</span><span class="w"> </span><span class="p" data-group-id="3195642082-2">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="s">"*"</span><span class="w"> </span><span class="p" data-group-id="3195642082-1">)</span></code></pre><p>Each language-range MAY be given an associated quality value which represents an
|
||||
</span><span class="n">language</span><span class="o">-</span><span class="n">range</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p" data-group-id="4446255606-1">(</span><span class="w"> </span><span class="p" data-group-id="4446255606-2">(</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="mi">8</span><span class="nc">ALPHA</span><span class="w"> </span><span class="o">*</span><span class="p" data-group-id="4446255606-3">(</span><span class="w"> </span><span class="s">"-"</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="mi">8</span><span class="nc">ALPHA</span><span class="w"> </span><span class="p" data-group-id="4446255606-3">)</span><span class="w"> </span><span class="p" data-group-id="4446255606-2">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="s">"*"</span><span class="w"> </span><span class="p" data-group-id="4446255606-1">)</span></code></pre><p>Each language-range MAY be given an associated quality value which represents an
|
||||
estimate of the user's preference for the languages specified by that range. The
|
||||
quality value defaults to "q=1". For example,</p><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="nc">Accept</span><span class="o">-</span><span class="ss">Language</span><span class="p">:</span><span class="w"> </span><span class="n">da</span><span class="p">,</span><span class="w"> </span><span class="n">en</span><span class="o">-</span><span class="n">gb</span><span class="p">;</span><span class="n">q</span><span class="o">=</span><span class="mf">0.8</span><span class="p">,</span><span class="w"> </span><span class="n">en</span><span class="p">;</span><span class="n">q</span><span class="o">=</span><span class="mf">0.7</span></code></pre><p>would mean: "I prefer Danish, but will accept British English and other types of English."</p>
|
||||
</section>
|
||||
@ -232,54 +232,54 @@ a configured <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.html"><code class="
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="5780057175-1">(</span><span class="s">"da;q=0.1,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="5780057175-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-3">%</span><span class="nc" data-group-id="5780057175-3">Cldr.LanguageTag</span><span class="p" data-group-id="5780057175-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="6441780970-1">(</span><span class="s">"da;q=0.1,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="6441780970-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-3">%</span><span class="nc" data-group-id="6441780970-3">Cldr.LanguageTag</span><span class="p" data-group-id="6441780970-3">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-4">[</span><span class="p" data-group-id="5780057175-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-5">%{</span><span class="p" data-group-id="5780057175-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-4">[</span><span class="p" data-group-id="6441780970-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-5">%{</span><span class="p" data-group-id="6441780970-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-6">%{</span><span class="p" data-group-id="5780057175-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-7">[</span><span class="p" data-group-id="5780057175-7">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-6">%{</span><span class="p" data-group-id="6441780970-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-7">[</span><span class="p" data-group-id="6441780970-7">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-8">%{</span><span class="p" data-group-id="5780057175-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-9">[</span><span class="p" data-group-id="5780057175-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-3">}</span><span class="p" data-group-id="5780057175-2">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-8">%{</span><span class="p" data-group-id="6441780970-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-9">[</span><span class="p" data-group-id="6441780970-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-3">}</span><span class="p" data-group-id="6441780970-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="5780057175-10">(</span><span class="s">"da;q=0.1,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="5780057175-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-12">%</span><span class="nc" data-group-id="5780057175-12">Cldr.LanguageTag</span><span class="p" data-group-id="5780057175-12">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="6441780970-10">(</span><span class="s">"da;q=0.1,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="6441780970-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-12">%</span><span class="nc" data-group-id="6441780970-12">Cldr.LanguageTag</span><span class="p" data-group-id="6441780970-12">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-13">[</span><span class="p" data-group-id="5780057175-13">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-14">%{</span><span class="p" data-group-id="5780057175-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-13">[</span><span class="p" data-group-id="6441780970-13">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-14">%{</span><span class="p" data-group-id="6441780970-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-15">%{</span><span class="p" data-group-id="5780057175-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-16">[</span><span class="p" data-group-id="5780057175-16">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-15">%{</span><span class="p" data-group-id="6441780970-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-16">[</span><span class="p" data-group-id="6441780970-16">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-17">%{</span><span class="p" data-group-id="5780057175-17">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5780057175-18">[</span><span class="p" data-group-id="5780057175-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-12">}</span><span class="p" data-group-id="5780057175-11">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-17">%{</span><span class="p" data-group-id="6441780970-17">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6441780970-18">[</span><span class="p" data-group-id="6441780970-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-12">}</span><span class="p" data-group-id="6441780970-11">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="5780057175-19">(</span><span class="s">"xx,yy;q=0.3"</span><span class="p" data-group-id="5780057175-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-20">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-21">{</span><span class="nc">Cldr.NoMatchingLocale</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"No configured locale could be matched to </span><span class="se">\"</span><span class="s">xx,yy;q=0.3</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="5780057175-21">}</span><span class="p" data-group-id="5780057175-20">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="6441780970-19">(</span><span class="s">"xx,yy;q=0.3"</span><span class="p" data-group-id="6441780970-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-20">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-21">{</span><span class="nc">Cldr.NoMatchingLocale</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"No configured locale could be matched to </span><span class="se">\"</span><span class="s">xx,yy;q=0.3</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="6441780970-21">}</span><span class="p" data-group-id="6441780970-20">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="5780057175-22">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="5780057175-22">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5780057175-23">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5780057175-24">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="5780057175-24">}</span><span class="p" data-group-id="5780057175-23">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="6441780970-22">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="6441780970-22">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6441780970-23">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6441780970-24">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="6441780970-24">}</span><span class="p" data-group-id="6441780970-23">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="parse/1">
|
||||
@ -340,95 +340,95 @@ wuth an error tuple for each invalid tag added at the end of the list.</p><h2 id
|
||||
Example
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="8589727545-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="8589727545-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-3">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-4">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-5">%</span><span class="nc" data-group-id="8589727545-5">Cldr.LanguageTag</span><span class="p" data-group-id="8589727545-5">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="6567876865-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="6567876865-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-3">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-4">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-5">%</span><span class="nc" data-group-id="6567876865-5">Cldr.LanguageTag</span><span class="p" data-group-id="6567876865-5">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-6">[</span><span class="p" data-group-id="8589727545-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-7">%{</span><span class="p" data-group-id="8589727545-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-6">[</span><span class="p" data-group-id="6567876865-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-7">%{</span><span class="p" data-group-id="6567876865-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-8">%{</span><span class="p" data-group-id="8589727545-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-9">[</span><span class="p" data-group-id="8589727545-9">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-8">%{</span><span class="p" data-group-id="6567876865-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-9">[</span><span class="p" data-group-id="6567876865-9">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:DK</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-10">%{</span><span class="p" data-group-id="8589727545-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-11">[</span><span class="p" data-group-id="8589727545-11">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-5">}</span><span class="p" data-group-id="8589727545-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-12">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-13">%</span><span class="nc" data-group-id="8589727545-13">Cldr.LanguageTag</span><span class="p" data-group-id="8589727545-13">{</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-10">%{</span><span class="p" data-group-id="6567876865-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-11">[</span><span class="p" data-group-id="6567876865-11">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-5">}</span><span class="p" data-group-id="6567876865-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-12">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-13">%</span><span class="nc" data-group-id="6567876865-13">Cldr.LanguageTag</span><span class="p" data-group-id="6567876865-13">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-14">[</span><span class="p" data-group-id="8589727545-14">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-15">%{</span><span class="p" data-group-id="8589727545-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-14">[</span><span class="p" data-group-id="6567876865-14">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-15">%{</span><span class="p" data-group-id="6567876865-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-16">%{</span><span class="p" data-group-id="8589727545-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-17">[</span><span class="p" data-group-id="8589727545-17">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-16">%{</span><span class="p" data-group-id="6567876865-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-17">[</span><span class="p" data-group-id="6567876865-17">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-18">%{</span><span class="p" data-group-id="8589727545-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-19">[</span><span class="p" data-group-id="8589727545-19">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-13">}</span><span class="p" data-group-id="8589727545-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-3">]</span><span class="p" data-group-id="8589727545-2">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-18">%{</span><span class="p" data-group-id="6567876865-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-19">[</span><span class="p" data-group-id="6567876865-19">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-13">}</span><span class="p" data-group-id="6567876865-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-3">]</span><span class="p" data-group-id="6567876865-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="8589727545-20">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="8589727545-20">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-21">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-22">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="8589727545-22">}</span><span class="p" data-group-id="8589727545-21">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="6567876865-20">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="6567876865-20">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-21">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-22">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="6567876865-22">}</span><span class="p" data-group-id="6567876865-21">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="8589727545-23">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="8589727545-23">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-24">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-25">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-26">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-27">%</span><span class="nc" data-group-id="8589727545-27">Cldr.LanguageTag</span><span class="p" data-group-id="8589727545-27">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="6567876865-23">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="6567876865-23">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-24">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-25">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-26">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-27">%</span><span class="nc" data-group-id="6567876865-27">Cldr.LanguageTag</span><span class="p" data-group-id="6567876865-27">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-28">[</span><span class="p" data-group-id="8589727545-28">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-29">%{</span><span class="p" data-group-id="8589727545-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-28">[</span><span class="p" data-group-id="6567876865-28">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-29">%{</span><span class="p" data-group-id="6567876865-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-30">%{</span><span class="p" data-group-id="8589727545-30">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-31">[</span><span class="p" data-group-id="8589727545-31">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-30">%{</span><span class="p" data-group-id="6567876865-30">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-31">[</span><span class="p" data-group-id="6567876865-31">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:DK</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-32">%{</span><span class="p" data-group-id="8589727545-32">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-33">[</span><span class="p" data-group-id="8589727545-33">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-27">}</span><span class="p" data-group-id="8589727545-26">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-34">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-35">%</span><span class="nc" data-group-id="8589727545-35">Cldr.LanguageTag</span><span class="p" data-group-id="8589727545-35">{</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-32">%{</span><span class="p" data-group-id="6567876865-32">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-33">[</span><span class="p" data-group-id="6567876865-33">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-27">}</span><span class="p" data-group-id="6567876865-26">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-34">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-35">%</span><span class="nc" data-group-id="6567876865-35">Cldr.LanguageTag</span><span class="p" data-group-id="6567876865-35">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-36">[</span><span class="p" data-group-id="8589727545-36">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-37">%{</span><span class="p" data-group-id="8589727545-37">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-36">[</span><span class="p" data-group-id="6567876865-36">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-37">%{</span><span class="p" data-group-id="6567876865-37">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-38">%{</span><span class="p" data-group-id="8589727545-38">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-39">[</span><span class="p" data-group-id="8589727545-39">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-38">%{</span><span class="p" data-group-id="6567876865-38">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-39">[</span><span class="p" data-group-id="6567876865-39">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-40">%{</span><span class="p" data-group-id="8589727545-40">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8589727545-41">[</span><span class="p" data-group-id="8589727545-41">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-35">}</span><span class="p" data-group-id="8589727545-34">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-42">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-43">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="8589727545-43">}</span><span class="p" data-group-id="8589727545-42">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8589727545-25">]</span><span class="p" data-group-id="8589727545-24">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-40">%{</span><span class="p" data-group-id="6567876865-40">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6567876865-41">[</span><span class="p" data-group-id="6567876865-41">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-35">}</span><span class="p" data-group-id="6567876865-34">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-42">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-43">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="6567876865-43">}</span><span class="p" data-group-id="6567876865-42">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6567876865-25">]</span><span class="p" data-group-id="6567876865-24">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="parse!/1">
|
||||
@ -473,92 +473,92 @@ wuth an error tuple for each invalid tag added at the end of the list.</p><h2 id
|
||||
Example
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="p" data-group-id="3950533083-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p" data-group-id="3950533083-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-2">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-3">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-4">%</span><span class="nc" data-group-id="3950533083-4">Cldr.LanguageTag</span><span class="p" data-group-id="3950533083-4">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="p" data-group-id="7153776986-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p" data-group-id="7153776986-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-2">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-3">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-4">%</span><span class="nc" data-group-id="7153776986-4">Cldr.LanguageTag</span><span class="p" data-group-id="7153776986-4">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-5">[</span><span class="p" data-group-id="3950533083-5">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-6">%{</span><span class="p" data-group-id="3950533083-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-5">[</span><span class="p" data-group-id="7153776986-5">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-6">%{</span><span class="p" data-group-id="7153776986-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-7">%{</span><span class="p" data-group-id="3950533083-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-8">[</span><span class="p" data-group-id="3950533083-8">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-7">%{</span><span class="p" data-group-id="7153776986-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-8">[</span><span class="p" data-group-id="7153776986-8">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:DK</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-9">%{</span><span class="p" data-group-id="3950533083-9">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-10">[</span><span class="p" data-group-id="3950533083-10">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-4">}</span><span class="p" data-group-id="3950533083-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-11">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-12">%</span><span class="nc" data-group-id="3950533083-12">Cldr.LanguageTag</span><span class="p" data-group-id="3950533083-12">{</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-9">%{</span><span class="p" data-group-id="7153776986-9">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-10">[</span><span class="p" data-group-id="7153776986-10">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-4">}</span><span class="p" data-group-id="7153776986-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-11">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-12">%</span><span class="nc" data-group-id="7153776986-12">Cldr.LanguageTag</span><span class="p" data-group-id="7153776986-12">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-13">[</span><span class="p" data-group-id="3950533083-13">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-14">%{</span><span class="p" data-group-id="3950533083-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-13">[</span><span class="p" data-group-id="7153776986-13">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-14">%{</span><span class="p" data-group-id="7153776986-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-15">%{</span><span class="p" data-group-id="3950533083-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-16">[</span><span class="p" data-group-id="3950533083-16">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-15">%{</span><span class="p" data-group-id="7153776986-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-16">[</span><span class="p" data-group-id="7153776986-16">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-17">%{</span><span class="p" data-group-id="3950533083-17">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-18">[</span><span class="p" data-group-id="3950533083-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-12">}</span><span class="p" data-group-id="3950533083-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-2">]</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-17">%{</span><span class="p" data-group-id="7153776986-17">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-18">[</span><span class="p" data-group-id="7153776986-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-12">}</span><span class="p" data-group-id="7153776986-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-2">]</span><span class="w">
|
||||
|
||||
</span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="w"> </span><span class="s">"invalid_tag"</span><span class="w">
|
||||
</span><span class="gt">** (Cldr.AcceptLanguageError) "Expected a BCP47 language tag. Could not parse the remaining "g" starting at position 11
|
||||
(ex_cldr) lib/cldr/accept_language.ex:304: Cldr.AcceptLanguage.parse!/1</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="p" data-group-id="3950533083-19">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="3950533083-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-20">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-21">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-22">%</span><span class="nc" data-group-id="3950533083-22">Cldr.LanguageTag</span><span class="p" data-group-id="3950533083-22">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="p" data-group-id="7153776986-19">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="7153776986-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-20">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-21">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-22">%</span><span class="nc" data-group-id="7153776986-22">Cldr.LanguageTag</span><span class="p" data-group-id="7153776986-22">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-23">[</span><span class="p" data-group-id="3950533083-23">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-24">%{</span><span class="p" data-group-id="3950533083-24">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-23">[</span><span class="p" data-group-id="7153776986-23">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-24">%{</span><span class="p" data-group-id="7153776986-24">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-25">%{</span><span class="p" data-group-id="3950533083-25">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-26">[</span><span class="p" data-group-id="3950533083-26">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-25">%{</span><span class="p" data-group-id="7153776986-25">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-26">[</span><span class="p" data-group-id="7153776986-26">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:DK</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-27">%{</span><span class="p" data-group-id="3950533083-27">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-28">[</span><span class="p" data-group-id="3950533083-28">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-22">}</span><span class="p" data-group-id="3950533083-21">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-29">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-30">%</span><span class="nc" data-group-id="3950533083-30">Cldr.LanguageTag</span><span class="p" data-group-id="3950533083-30">{</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-27">%{</span><span class="p" data-group-id="7153776986-27">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-28">[</span><span class="p" data-group-id="7153776986-28">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-22">}</span><span class="p" data-group-id="7153776986-21">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-29">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-30">%</span><span class="nc" data-group-id="7153776986-30">Cldr.LanguageTag</span><span class="p" data-group-id="7153776986-30">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-31">[</span><span class="p" data-group-id="3950533083-31">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-32">%{</span><span class="p" data-group-id="3950533083-32">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-31">[</span><span class="p" data-group-id="7153776986-31">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-32">%{</span><span class="p" data-group-id="7153776986-32">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-33">%{</span><span class="p" data-group-id="3950533083-33">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-34">[</span><span class="p" data-group-id="3950533083-34">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-33">%{</span><span class="p" data-group-id="7153776986-33">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-34">[</span><span class="p" data-group-id="7153776986-34">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-35">%{</span><span class="p" data-group-id="3950533083-35">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3950533083-36">[</span><span class="p" data-group-id="3950533083-36">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-30">}</span><span class="p" data-group-id="3950533083-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-37">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-38">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="3950533083-38">}</span><span class="p" data-group-id="3950533083-37">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3950533083-20">]</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-35">%{</span><span class="p" data-group-id="7153776986-35">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153776986-36">[</span><span class="p" data-group-id="7153776986-36">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-30">}</span><span class="p" data-group-id="7153776986-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-37">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-38">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="7153776986-38">}</span><span class="p" data-group-id="7153776986-37">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153776986-20">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -390,11 +390,11 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</h2>
|
||||
<p> MyApp.Cldr.Currency.currencies_for_locale "en"
|
||||
=> {:ok,
|
||||
%{</p><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="ss">FJD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1010756983-1">%</span><span class="nc" data-group-id="1010756983-1">Cldr.Currency</span><span class="p" data-group-id="1010756983-1">{</span><span class="w">
|
||||
%{</p><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="ss">FJD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9263722778-1">%</span><span class="nc" data-group-id="9263722778-1">Cldr.Currency</span><span class="p" data-group-id="9263722778-1">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="s">"FJD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1010756983-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollar"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollars"</span><span class="p" data-group-id="1010756983-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9263722778-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollar"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollars"</span><span class="p" data-group-id="9263722778-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
@ -404,12 +404,12 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"FJD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="1010756983-1">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">SUR</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1010756983-3">%</span><span class="nc" data-group-id="1010756983-3">Cldr.Currency</span><span class="p" data-group-id="1010756983-3">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="9263722778-1">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">SUR</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9263722778-3">%</span><span class="nc" data-group-id="9263722778-3">Cldr.Currency</span><span class="p" data-group-id="9263722778-3">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="s">"SUR"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1010756983-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet rouble"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet roubles"</span><span class="p" data-group-id="1010756983-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9263722778-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet rouble"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet roubles"</span><span class="p" data-group-id="9263722778-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
@ -419,7 +419,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"SUR"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="1010756983-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9263722778-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span><span class="w">
|
||||
</span><span class="err">}</span><span class="err">}</span></code></pre>
|
||||
</section>
|
||||
@ -470,11 +470,11 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</a>
|
||||
</h2>
|
||||
<p> MyApp.Cldr.Currency.currencies_for_locale! "en"
|
||||
=> %{</p><pre><code class="makeup elixir" translate="no"><span class="ss">FJD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5315183916-1">%</span><span class="nc" data-group-id="5315183916-1">Cldr.Currency</span><span class="p" data-group-id="5315183916-1">{</span><span class="w">
|
||||
=> %{</p><pre><code class="makeup elixir" translate="no"><span class="ss">FJD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153560185-1">%</span><span class="nc" data-group-id="7153560185-1">Cldr.Currency</span><span class="p" data-group-id="7153560185-1">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="s">"FJD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5315183916-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollar"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollars"</span><span class="p" data-group-id="5315183916-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153560185-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollar"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollars"</span><span class="p" data-group-id="7153560185-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
@ -484,12 +484,12 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"FJD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="5315183916-1">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">SUR</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5315183916-3">%</span><span class="nc" data-group-id="5315183916-3">Cldr.Currency</span><span class="p" data-group-id="5315183916-3">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153560185-1">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">SUR</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153560185-3">%</span><span class="nc" data-group-id="7153560185-3">Cldr.Currency</span><span class="p" data-group-id="7153560185-3">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="s">"SUR"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5315183916-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet rouble"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet roubles"</span><span class="p" data-group-id="5315183916-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7153560185-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet rouble"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet roubles"</span><span class="p" data-group-id="7153560185-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
@ -499,7 +499,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"SUR"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="5315183916-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153560185-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span></code></pre><p> }</p>
|
||||
</section>
|
||||
</section>
|
||||
@ -557,13 +557,13 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code</span><span class="p" data-group-id="2487103611-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="2487103611-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2487103611-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2487103611-3">%</span><span class="nc" data-group-id="2487103611-3">Cldr.Currency</span><span class="p" data-group-id="2487103611-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code</span><span class="p" data-group-id="9929026487-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="9929026487-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9929026487-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9929026487-3">%</span><span class="nc" data-group-id="9929026487-3">Cldr.Currency</span><span class="p" data-group-id="9929026487-3">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="s">"AUD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2487103611-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollar"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollars"</span><span class="p" data-group-id="2487103611-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9929026487-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollar"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollars"</span><span class="p" data-group-id="9929026487-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian Dollar"</span><span class="p">,</span><span class="w">
|
||||
@ -571,15 +571,15 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
</span><span class="ss">rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"A$"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="w">
|
||||
</span><span class="p" data-group-id="2487103611-3">}</span><span class="p" data-group-id="2487103611-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9929026487-3">}</span><span class="p" data-group-id="9929026487-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code</span><span class="p" data-group-id="2487103611-5">(</span><span class="s">"THB"</span><span class="p" data-group-id="2487103611-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2487103611-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2487103611-7">%</span><span class="nc" data-group-id="2487103611-7">Cldr.Currency</span><span class="p" data-group-id="2487103611-7">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code</span><span class="p" data-group-id="9929026487-5">(</span><span class="s">"THB"</span><span class="p" data-group-id="9929026487-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9929026487-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9929026487-7">%</span><span class="nc" data-group-id="9929026487-7">Cldr.Currency</span><span class="p" data-group-id="9929026487-7">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2487103611-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</span><span class="p" data-group-id="2487103611-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9929026487-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</span><span class="p" data-group-id="9929026487-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai Baht"</span><span class="p">,</span><span class="w">
|
||||
@ -587,7 +587,7 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
</span><span class="ss">rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="w">
|
||||
</span><span class="p" data-group-id="2487103611-7">}</span><span class="p" data-group-id="2487103611-6">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="9929026487-7">}</span><span class="p" data-group-id="9929026487-6">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_for_code!/2">
|
||||
@ -646,12 +646,12 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code!</span><span class="p" data-group-id="6541385096-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="6541385096-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6541385096-2">%</span><span class="nc" data-group-id="6541385096-2">Cldr.Currency</span><span class="p" data-group-id="6541385096-2">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code!</span><span class="p" data-group-id="9967538551-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="9967538551-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9967538551-2">%</span><span class="nc" data-group-id="9967538551-2">Cldr.Currency</span><span class="p" data-group-id="9967538551-2">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="s">"AUD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6541385096-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollar"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollars"</span><span class="p" data-group-id="6541385096-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9967538551-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollar"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollars"</span><span class="p" data-group-id="9967538551-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian Dollar"</span><span class="p">,</span><span class="w">
|
||||
@ -659,14 +659,14 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
</span><span class="ss">rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"A$"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="w">
|
||||
</span><span class="p" data-group-id="6541385096-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9967538551-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code!</span><span class="p" data-group-id="6541385096-4">(</span><span class="s">"THB"</span><span class="p" data-group-id="6541385096-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6541385096-5">%</span><span class="nc" data-group-id="6541385096-5">Cldr.Currency</span><span class="p" data-group-id="6541385096-5">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code!</span><span class="p" data-group-id="9967538551-4">(</span><span class="s">"THB"</span><span class="p" data-group-id="9967538551-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9967538551-5">%</span><span class="nc" data-group-id="9967538551-5">Cldr.Currency</span><span class="p" data-group-id="9967538551-5">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6541385096-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</span><span class="p" data-group-id="6541385096-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9967538551-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</span><span class="p" data-group-id="9967538551-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai Baht"</span><span class="p">,</span><span class="w">
|
||||
@ -674,7 +674,7 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
</span><span class="ss">rounding</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="w">
|
||||
</span><span class="p" data-group-id="6541385096-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="9967538551-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_from_locale/1">
|
||||
@ -715,11 +715,11 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="p" data-group-id="4042141782-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">locale</span><span class="p" data-group-id="4042141782-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="p" data-group-id="3052978357-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">locale</span><span class="p" data-group-id="3052978357-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_from_locale</span><span class="w"> </span><span class="n">locale</span><span class="w">
|
||||
</span><span class="ss">:USD</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="p" data-group-id="4042141782-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">locale</span><span class="p" data-group-id="4042141782-2">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="w"> </span><span class="s">"en-AU"</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="p" data-group-id="3052978357-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">locale</span><span class="p" data-group-id="3052978357-2">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="w"> </span><span class="s">"en-AU"</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_from_locale</span><span class="w"> </span><span class="n">locale</span><span class="w">
|
||||
</span><span class="ss">:AUD</span><span class="w">
|
||||
|
||||
@ -768,13 +768,13 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_history_for_locale</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="p" data-group-id="2081533830-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2081533830-2">%{</span><span class="w">
|
||||
</span><span class="ss">USD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2081533830-3">%{</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="ld">~D[1792-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="2081533830-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">USN</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2081533830-4">%{</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p" data-group-id="2081533830-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">USS</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2081533830-5">%{</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w"> </span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w"> </span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="ld">~D[2014-03-01]</span><span class="p" data-group-id="2081533830-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2081533830-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2081533830-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5218967437-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5218967437-2">%{</span><span class="w">
|
||||
</span><span class="ss">USD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5218967437-3">%{</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="ld">~D[1792-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5218967437-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">USN</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5218967437-4">%{</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p" data-group-id="5218967437-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">USS</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5218967437-5">%{</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w"> </span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w"> </span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="ld">~D[2014-03-01]</span><span class="p" data-group-id="5218967437-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5218967437-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5218967437-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_strings/3">
|
||||
@ -834,8 +834,8 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_strings</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3626343706-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3626343706-2">%{</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="7846775406-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7846775406-2">%{</span><span class="w">
|
||||
</span><span class="s">"mexican silver pesos"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:MXP</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"sudanese dinar"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:SDD</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"bad"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:BAD</span><span class="p">,</span><span class="w">
|
||||
@ -845,7 +845,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="s">"guyanaese dollars"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:GYD</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"equatorial guinean ekwele"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:GQE</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span><span class="w">
|
||||
</span><span class="p" data-group-id="3626343706-2">}</span><span class="p" data-group-id="3626343706-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="7846775406-2">}</span><span class="p" data-group-id="7846775406-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_strings!/3">
|
||||
@ -905,7 +905,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_strings!</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4127090848-1">%{</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9310394916-1">%{</span><span class="w">
|
||||
</span><span class="s">"mexican silver pesos"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:MXP</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"sudanese dinar"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:SDD</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"bad"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:BAD</span><span class="p">,</span><span class="w">
|
||||
@ -915,7 +915,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="s">"guyanaese dollars"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:GYD</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"equatorial guinean ekwele"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:GQE</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span><span class="w">
|
||||
</span><span class="p" data-group-id="4127090848-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="9310394916-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="current_currency_from_locale/1">
|
||||
@ -1004,7 +1004,7 @@ mapping is returned for that territory.</p><h2 id="current_territory_currencies/
|
||||
Example
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">current_territory_currencies</span><span class="p" data-group-id="9379119792-1">(</span><span class="p" data-group-id="9379119792-1">)</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">current_territory_currencies</span><span class="p" data-group-id="6099637104-1">(</span><span class="p" data-group-id="6099637104-1">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_currencies/0">
|
||||
@ -1097,10 +1097,10 @@ currency code</li></ul><h2 id="known_currency_code/1-returns" class="section-hea
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code</span><span class="w"> </span><span class="s">"AUD"</span><span class="w">
|
||||
</span><span class="p" data-group-id="9898020790-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:AUD</span><span class="p" data-group-id="9898020790-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1728169007-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:AUD</span><span class="p" data-group-id="1728169007-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code</span><span class="w"> </span><span class="s">"GGG"</span><span class="w">
|
||||
</span><span class="p" data-group-id="9898020790-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9898020790-3">{</span><span class="nc">Cldr.UnknownCurrencyError</span><span class="p">,</span><span class="w"> </span><span class="s">"The currency </span><span class="se">\"</span><span class="s">GGG</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="9898020790-3">}</span><span class="p" data-group-id="9898020790-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="1728169007-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1728169007-3">{</span><span class="nc">Cldr.UnknownCurrencyError</span><span class="p">,</span><span class="w"> </span><span class="s">"The currency </span><span class="se">\"</span><span class="s">GGG</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="1728169007-3">}</span><span class="p" data-group-id="1728169007-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_currency_code?/1">
|
||||
@ -1247,14 +1247,14 @@ such as <code class="inline">0.05</code>. Optional.</li></ul><h2 id="new/2-retur
|
||||
Example
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="9073115645-1">(</span><span class="ss">:XAE</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p">,</span><span class="w"> </span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="9073115645-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9073115645-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9073115645-3">%</span><span class="nc" data-group-id="9073115645-3">Cldr.Currency</span><span class="p" data-group-id="9073115645-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="5943773235-1">(</span><span class="ss">:XAE</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p">,</span><span class="w"> </span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="5943773235-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5943773235-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5943773235-3">%</span><span class="nc" data-group-id="5943773235-3">Cldr.Currency</span><span class="p" data-group-id="5943773235-3">{</span><span class="w">
|
||||
</span><span class="ss">alt_code</span><span class="p">:</span><span class="w"> </span><span class="ss">:XAE</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="ss">:XAE</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9073115645-4">%{</span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p" data-group-id="9073115645-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5943773235-4">%{</span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p" data-group-id="5943773235-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
@ -1264,11 +1264,11 @@ such as <code class="inline">0.05</code>. Optional.</li></ul><h2 id="new/2-retur
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"XAE"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="9073115645-3">}</span><span class="p" data-group-id="9073115645-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="9073115645-5">(</span><span class="ss">:XAH</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p" data-group-id="9073115645-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9073115645-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="s">"Required options are missing. Required options are [:name, :digits]"</span><span class="p" data-group-id="9073115645-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="9073115645-7">(</span><span class="ss">:XAE</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"XAE"</span><span class="p">,</span><span class="w"> </span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="9073115645-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9073115645-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9073115645-9">{</span><span class="nc">Cldr.CurrencyAlreadyDefined</span><span class="p">,</span><span class="w"> </span><span class="s">"Currency :XAE is already defined."</span><span class="p" data-group-id="9073115645-9">}</span><span class="p" data-group-id="9073115645-8">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5943773235-3">}</span><span class="p" data-group-id="5943773235-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="5943773235-5">(</span><span class="ss">:XAH</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p" data-group-id="5943773235-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5943773235-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="s">"Required options are missing. Required options are [:name, :digits]"</span><span class="p" data-group-id="5943773235-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="5943773235-7">(</span><span class="ss">:XAE</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"XAE"</span><span class="p">,</span><span class="w"> </span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="5943773235-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5943773235-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5943773235-9">{</span><span class="nc">Cldr.CurrencyAlreadyDefined</span><span class="p">,</span><span class="w"> </span><span class="s">"Currency :XAE is already defined."</span><span class="p" data-group-id="5943773235-9">}</span><span class="p" data-group-id="5943773235-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="pluralize/3">
|
||||
@ -1327,19 +1327,19 @@ default is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plaus
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="w">
|
||||
</span><span class="p" data-group-id="6094546299-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"US dollar"</span><span class="p" data-group-id="6094546299-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0057323983-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"US dollar"</span><span class="p" data-group-id="0057323983-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="w">
|
||||
</span><span class="p" data-group-id="6094546299-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"US dollars"</span><span class="p" data-group-id="6094546299-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0057323983-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"US dollars"</span><span class="p" data-group-id="0057323983-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">12</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6094546299-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"美元"</span><span class="p" data-group-id="6094546299-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0057323983-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"美元"</span><span class="p" data-group-id="0057323983-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">12</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6094546299-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"dollars des États-Unis"</span><span class="p" data-group-id="6094546299-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0057323983-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"dollars des États-Unis"</span><span class="p" data-group-id="0057323983-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6094546299-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"dollar des États-Unis"</span><span class="p" data-group-id="6094546299-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="0057323983-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"dollar des États-Unis"</span><span class="p" data-group-id="0057323983-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="strings_for_currency/2">
|
||||
@ -1382,7 +1382,7 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">strings_for_currency</span><span class="w"> </span><span class="ss">:AUD</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="p" data-group-id="2020889441-1">[</span><span class="s">"a$"</span><span class="p">,</span><span class="w"> </span><span class="s">"australian dollars"</span><span class="p">,</span><span class="w"> </span><span class="s">"aud"</span><span class="p">,</span><span class="w"> </span><span class="s">"australian dollar"</span><span class="p" data-group-id="2020889441-1">]</span></code></pre>
|
||||
</span><span class="p" data-group-id="8647575798-1">[</span><span class="s">"a$"</span><span class="p">,</span><span class="w"> </span><span class="s">"australian dollars"</span><span class="p">,</span><span class="w"> </span><span class="s">"aud"</span><span class="p">,</span><span class="w"> </span><span class="s">"australian dollar"</span><span class="p" data-group-id="8647575798-1">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -297,16 +297,16 @@ this specific locale..</p><h2 id="fallback_locale_names/1-arguments" class="sect
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locale_names</span><span class="p" data-group-id="9800946430-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="9800946430-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9800946430-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9800946430-3">[</span><span class="ss">:"fr-CA"</span><span class="p">,</span><span class="w"> </span><span class="ss">:fr</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="9800946430-3">]</span><span class="p" data-group-id="9800946430-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locale_names</span><span class="p" data-group-id="8116847298-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="8116847298-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8116847298-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8116847298-3">[</span><span class="ss">:"fr-CA"</span><span class="p">,</span><span class="w"> </span><span class="ss">:fr</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="8116847298-3">]</span><span class="p" data-group-id="8116847298-2">}</span><span class="w">
|
||||
|
||||
</span><span class="c1"># Fallbacks are typically formed by progressively</span><span class="w">
|
||||
</span><span class="c1"># stripping variant, territory and script from the</span><span class="w">
|
||||
</span><span class="c1"># given locale name. But not always - there are</span><span class="w">
|
||||
</span><span class="c1"># certain fallbacks that take a different path.</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locale_names</span><span class="p" data-group-id="9800946430-4">(</span><span class="ss">:nb</span><span class="p" data-group-id="9800946430-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9800946430-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9800946430-6">[</span><span class="ss">:nb</span><span class="p">,</span><span class="w"> </span><span class="ss">:no</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="9800946430-6">]</span><span class="p" data-group-id="9800946430-5">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locale_names</span><span class="p" data-group-id="8116847298-4">(</span><span class="ss">:nb</span><span class="p" data-group-id="8116847298-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8116847298-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8116847298-6">[</span><span class="ss">:nb</span><span class="p">,</span><span class="w"> </span><span class="ss">:no</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="8116847298-6">]</span><span class="p" data-group-id="8116847298-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="fallback_locales/1">
|
||||
@ -360,20 +360,20 @@ this specific locale.</p><h2 id="fallback_locales/1-arguments" class="section-he
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locales</span><span class="p" data-group-id="9298437626-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="9298437626-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9298437626-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9298437626-3">[</span><span class="p" data-group-id="9298437626-4">#</span><span class="nc" data-group-id="9298437626-4">Cldr.LanguageTag</span><span class="p" data-group-id="9298437626-4"><</span><span class="n">fr</span><span class="o">-</span><span class="nc">CA</span><span class="w"> </span><span class="p" data-group-id="9298437626-5">[</span><span class="n">validated</span><span class="p" data-group-id="9298437626-5">]</span><span class="p" data-group-id="9298437626-4">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9298437626-6">#</span><span class="nc" data-group-id="9298437626-6">Cldr.LanguageTag</span><span class="p" data-group-id="9298437626-6"><</span><span class="n">fr</span><span class="w"> </span><span class="p" data-group-id="9298437626-7">[</span><span class="n">validated</span><span class="p" data-group-id="9298437626-7">]</span><span class="p" data-group-id="9298437626-6">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9298437626-8">#</span><span class="nc" data-group-id="9298437626-8">Cldr.LanguageTag</span><span class="p" data-group-id="9298437626-8"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="9298437626-9">[</span><span class="n">validated</span><span class="p" data-group-id="9298437626-9">]</span><span class="p" data-group-id="9298437626-8">></span><span class="p" data-group-id="9298437626-3">]</span><span class="p" data-group-id="9298437626-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locales</span><span class="p" data-group-id="3216624409-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="3216624409-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3216624409-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3216624409-3">[</span><span class="p" data-group-id="3216624409-4">#</span><span class="nc" data-group-id="3216624409-4">Cldr.LanguageTag</span><span class="p" data-group-id="3216624409-4"><</span><span class="n">fr</span><span class="o">-</span><span class="nc">CA</span><span class="w"> </span><span class="p" data-group-id="3216624409-5">[</span><span class="n">validated</span><span class="p" data-group-id="3216624409-5">]</span><span class="p" data-group-id="3216624409-4">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3216624409-6">#</span><span class="nc" data-group-id="3216624409-6">Cldr.LanguageTag</span><span class="p" data-group-id="3216624409-6"><</span><span class="n">fr</span><span class="w"> </span><span class="p" data-group-id="3216624409-7">[</span><span class="n">validated</span><span class="p" data-group-id="3216624409-7">]</span><span class="p" data-group-id="3216624409-6">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3216624409-8">#</span><span class="nc" data-group-id="3216624409-8">Cldr.LanguageTag</span><span class="p" data-group-id="3216624409-8"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="3216624409-9">[</span><span class="n">validated</span><span class="p" data-group-id="3216624409-9">]</span><span class="p" data-group-id="3216624409-8">></span><span class="p" data-group-id="3216624409-3">]</span><span class="p" data-group-id="3216624409-2">}</span><span class="w">
|
||||
|
||||
</span><span class="c1"># Fallbacks are typically formed by progressively</span><span class="w">
|
||||
</span><span class="c1"># stripping variant, territory and script from the</span><span class="w">
|
||||
</span><span class="c1"># given locale name. But not always - there are</span><span class="w">
|
||||
</span><span class="c1"># certain fallbacks that take a different path.</span><span class="w">
|
||||
|
||||
</span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locales</span><span class="p" data-group-id="9298437626-10">(</span><span class="ss">:nb</span><span class="p" data-group-id="9298437626-10">)</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9298437626-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9298437626-12">[</span><span class="p" data-group-id="9298437626-13">#</span><span class="nc" data-group-id="9298437626-13">Cldr.LanguageTag</span><span class="p" data-group-id="9298437626-13"><</span><span class="n">nb</span><span class="w"> </span><span class="p" data-group-id="9298437626-14">[</span><span class="n">validated</span><span class="p" data-group-id="9298437626-14">]</span><span class="p" data-group-id="9298437626-13">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9298437626-15">#</span><span class="nc" data-group-id="9298437626-15">Cldr.LanguageTag</span><span class="p" data-group-id="9298437626-15"><</span><span class="n">no</span><span class="w"> </span><span class="p" data-group-id="9298437626-16">[</span><span class="n">validated</span><span class="p" data-group-id="9298437626-16">]</span><span class="p" data-group-id="9298437626-15">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9298437626-17">#</span><span class="nc" data-group-id="9298437626-17">Cldr.LanguageTag</span><span class="p" data-group-id="9298437626-17"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="9298437626-18">[</span><span class="n">validated</span><span class="p" data-group-id="9298437626-18">]</span><span class="p" data-group-id="9298437626-17">></span><span class="p" data-group-id="9298437626-12">]</span><span class="p" data-group-id="9298437626-11">}</span></code></pre>
|
||||
</span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locales</span><span class="p" data-group-id="3216624409-10">(</span><span class="ss">:nb</span><span class="p" data-group-id="3216624409-10">)</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3216624409-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3216624409-12">[</span><span class="p" data-group-id="3216624409-13">#</span><span class="nc" data-group-id="3216624409-13">Cldr.LanguageTag</span><span class="p" data-group-id="3216624409-13"><</span><span class="n">nb</span><span class="w"> </span><span class="p" data-group-id="3216624409-14">[</span><span class="n">validated</span><span class="p" data-group-id="3216624409-14">]</span><span class="p" data-group-id="3216624409-13">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3216624409-15">#</span><span class="nc" data-group-id="3216624409-15">Cldr.LanguageTag</span><span class="p" data-group-id="3216624409-15"><</span><span class="n">no</span><span class="w"> </span><span class="p" data-group-id="3216624409-16">[</span><span class="n">validated</span><span class="p" data-group-id="3216624409-16">]</span><span class="p" data-group-id="3216624409-15">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3216624409-17">#</span><span class="nc" data-group-id="3216624409-17">Cldr.LanguageTag</span><span class="p" data-group-id="3216624409-17"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="3216624409-18">[</span><span class="n">validated</span><span class="p" data-group-id="3216624409-18">]</span><span class="p" data-group-id="3216624409-17">></span><span class="p" data-group-id="3216624409-12">]</span><span class="p" data-group-id="3216624409-11">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="locale_for_territory/1">
|
||||
@ -504,15 +504,15 @@ generic top-level domain names.</p><h2 id="locale_from_host/2-examples" class="s
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="w"> </span><span class="s">"a.b.com.au"</span><span class="w">
|
||||
</span><span class="nc">Elixir.Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="2221699917-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="2221699917-1">)</span><span class="w">
|
||||
</span><span class="nc">Elixir.Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="5601478061-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="5601478061-1">)</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="p" data-group-id="2221699917-2">(</span><span class="s">"a.b.com.tv"</span><span class="p" data-group-id="2221699917-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2221699917-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2221699917-4">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">tv</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="2221699917-4">}</span><span class="p" data-group-id="2221699917-3">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="p" data-group-id="5601478061-2">(</span><span class="s">"a.b.com.tv"</span><span class="p" data-group-id="5601478061-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5601478061-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5601478061-4">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">tv</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="5601478061-4">}</span><span class="p" data-group-id="5601478061-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="p" data-group-id="2221699917-5">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="2221699917-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2221699917-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2221699917-7">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">com</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="2221699917-7">}</span><span class="p" data-group-id="2221699917-6">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="p" data-group-id="5601478061-5">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="5601478061-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5601478061-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5601478061-7">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">com</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="5601478061-7">}</span><span class="p" data-group-id="5601478061-6">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="new/1">
|
||||
@ -654,12 +654,12 @@ be a territory.</p><h2 id="territory_from_host/1-arguments" class="section-headi
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Locale</span><span class="o">.</span><span class="n">territory_from_host</span><span class="p" data-group-id="1549037303-1">(</span><span class="s">"a.b.com.au"</span><span class="p" data-group-id="1549037303-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1549037303-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:AU</span><span class="p" data-group-id="1549037303-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Locale</span><span class="o">.</span><span class="n">territory_from_host</span><span class="p" data-group-id="7809599115-1">(</span><span class="s">"a.b.com.au"</span><span class="p" data-group-id="7809599115-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7809599115-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:AU</span><span class="p" data-group-id="7809599115-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Cldr.Locale</span><span class="o">.</span><span class="n">territory_from_host</span><span class="p" data-group-id="1549037303-3">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="1549037303-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1549037303-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1549037303-5">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">com</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="1549037303-5">}</span><span class="p" data-group-id="1549037303-4">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Cldr.Locale</span><span class="o">.</span><span class="n">territory_from_host</span><span class="p" data-group-id="7809599115-3">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="7809599115-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7809599115-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7809599115-5">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">com</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="7809599115-5">}</span><span class="p" data-group-id="7809599115-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="territory_from_locale/1">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -426,31 +426,31 @@ The valid substitution keys are <code class="inline">:zero</code>, <code class="
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-1">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="1357637362-1">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-1">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="2959598656-1">}</span><span class="w">
|
||||
</span><span class="s">"one"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="1357637362-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="2959598656-2">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="1357637362-3">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="2959598656-3">}</span><span class="w">
|
||||
</span><span class="s">"other"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">22</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="1357637362-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">22</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="2959598656-4">}</span><span class="w">
|
||||
</span><span class="s">"other"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="1357637362-5">(</span><span class="mi">1</span><span class="p" data-group-id="1357637362-5">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="1357637362-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="2959598656-5">(</span><span class="mi">1</span><span class="p" data-group-id="2959598656-5">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="2959598656-6">}</span><span class="w">
|
||||
</span><span class="s">"one"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="1357637362-7">(</span><span class="mi">2</span><span class="p" data-group-id="1357637362-7">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="1357637362-8">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="2959598656-7">(</span><span class="mi">2</span><span class="p" data-group-id="2959598656-7">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="2959598656-8">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="1357637362-9">(</span><span class="mi">2</span><span class="p" data-group-id="1357637362-9">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-10">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="1357637362-10">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="2959598656-9">(</span><span class="mi">2</span><span class="p" data-group-id="2959598656-9">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-10">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="2959598656-10">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"ar"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-11">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="1357637362-11">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"ar"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-11">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="2959598656-11">}</span><span class="w">
|
||||
</span><span class="s">"few"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1357637362-12">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="1357637362-12">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2959598656-12">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="2959598656-12">}</span><span class="w">
|
||||
</span><span class="s">"other"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -439,7 +439,7 @@ to precompile all the known formats at compile time.</p><h2 id="decimal_format_l
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="c1">#=> Plausible.Cldr.Number.Format.Format.decimal_format_list</span><span class="w">
|
||||
</span><span class="p" data-group-id="2350547495-1">[</span><span class="s">"#"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##,##0%"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1080210459-1">[</span><span class="s">"#"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##,##0%"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"#,##,##0.###"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##,##0.00¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##,##0.00¤;(#,##,##0.00¤)"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"#,##,##0 %"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0%"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.###"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00 ¤"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"#,##0.00 ¤;(#,##0.00 ¤)"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00¤;(#,##0.00¤)"</span><span class="p">,</span><span class="w">
|
||||
@ -449,7 +449,7 @@ to precompile all the known formats at compile time.</p><h2 id="decimal_format_l
|
||||
</span><span class="s">"000 B ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 E ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 K ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 MRD ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Md ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mio'.' ¤"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"000 Mio ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mld ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mln ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mn ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mrd'.' ¤"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"000 Mrd ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mr ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 NT ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 N ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Tn ¤"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"000 Tr ¤"</span><span class="p">,</span><span class="w"> </span><span class="n">...</span><span class="p" data-group-id="2350547495-1">]</span></code></pre>
|
||||
</span><span class="s">"000 Tr ¤"</span><span class="p">,</span><span class="w"> </span><span class="n">...</span><span class="p" data-group-id="1080210459-1">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="decimal_format_list_for/1">
|
||||
@ -497,8 +497,8 @@ the known formats at compile time. Its use is not otherwise recommended.</p><h2
|
||||
Example
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">decimal_format_list_for</span><span class="p" data-group-id="3456322053-1">(</span><span class="ss">:en</span><span class="p" data-group-id="3456322053-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3456322053-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3456322053-3">[</span><span class="s">"#,##0%"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.###"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00;(#,##0.00)"</span><span class="p">,</span><span class="s">"#E0"</span><span class="p">,</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">decimal_format_list_for</span><span class="p" data-group-id="3790646494-1">(</span><span class="ss">:en</span><span class="p" data-group-id="3790646494-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3790646494-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3790646494-3">[</span><span class="s">"#,##0%"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.###"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00;(#,##0.00)"</span><span class="p">,</span><span class="s">"#E0"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"0 billion"</span><span class="p">,</span><span class="w"> </span><span class="s">"0 million"</span><span class="p">,</span><span class="w"> </span><span class="s">"0 thousand"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"0 trillion"</span><span class="p">,</span><span class="w"> </span><span class="s">"00 billion"</span><span class="p">,</span><span class="w"> </span><span class="s">"00 million"</span><span class="p">,</span><span class="w"> </span><span class="s">"00 thousand"</span><span class="p">,</span><span class="w"> </span><span class="s">"00 trillion"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"000 billion"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 million"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 thousand"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 trillion"</span><span class="p">,</span><span class="w"> </span><span class="s">"000B"</span><span class="p">,</span><span class="w"> </span><span class="s">"000K"</span><span class="p">,</span><span class="w">
|
||||
@ -506,7 +506,7 @@ the known formats at compile time. Its use is not otherwise recommended.</p><h2
|
||||
</span><span class="s">"¤#,##0.00"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤#,##0.00;(¤#,##0.00)"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤000B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤000K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤000M"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"¤000T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤00B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤00K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤00M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤00T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤0B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤0K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤0M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤0T"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"¤ #,##0.00"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ #,##0.00;(¤ #,##0.00)"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 000B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 000K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 000M"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"¤ 000T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0T"</span><span class="p" data-group-id="3456322053-3">]</span><span class="p" data-group-id="3456322053-2">}</span></code></pre>
|
||||
</span><span class="s">"¤ 000T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0T"</span><span class="p" data-group-id="3790646494-3">]</span><span class="p" data-group-id="3790646494-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_grouping_for/1">
|
||||
@ -559,8 +559,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">default_grouping_for</span><span class="p" data-group-id="5017472294-1">(</span><span class="ss">:en</span><span class="p" data-group-id="5017472294-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5017472294-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5017472294-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5017472294-4">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="5017472294-4">}</span><span class="p">,</span><span class="w"> </span><span class="ss">integer</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5017472294-5">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p" data-group-id="5017472294-5">}</span><span class="p" data-group-id="5017472294-3">}</span><span class="p" data-group-id="5017472294-2">}</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">default_grouping_for</span><span class="p" data-group-id="3079522343-1">(</span><span class="ss">:en</span><span class="p" data-group-id="3079522343-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3079522343-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3079522343-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3079522343-4">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="3079522343-4">}</span><span class="p">,</span><span class="w"> </span><span class="ss">integer</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3079522343-5">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p" data-group-id="3079522343-5">}</span><span class="p" data-group-id="3079522343-3">}</span><span class="p" data-group-id="3079522343-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_grouping_for!/1">
|
||||
@ -612,8 +612,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">default_grouping_for!</span><span class="p" data-group-id="8207888898-1">(</span><span class="ss">:en</span><span class="p" data-group-id="8207888898-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8207888898-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8207888898-3">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="8207888898-3">}</span><span class="p">,</span><span class="w"> </span><span class="ss">integer</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8207888898-4">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p" data-group-id="8207888898-4">}</span><span class="p" data-group-id="8207888898-2">}</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">default_grouping_for!</span><span class="p" data-group-id="5813867885-1">(</span><span class="ss">:en</span><span class="p" data-group-id="5813867885-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5813867885-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5813867885-3">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="5813867885-3">}</span><span class="p">,</span><span class="w"> </span><span class="ss">integer</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5813867885-4">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p" data-group-id="5813867885-4">}</span><span class="p" data-group-id="5813867885-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="formats_for/2">
|
||||
@ -670,18 +670,18 @@ by <a href="Plausible.Cldr.Number.System.html#number_systems_for/1"><code class=
|
||||
</span><span class="ss">percent</span><span class="p">:</span><span class="w"> </span><span class="s">"#,##0 %"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">scientific</span><span class="p">:</span><span class="w"> </span><span class="s">"#E0"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">standard</span><span class="p">:</span><span class="w"> </span><span class="s">"#,##0.###"</span><span class="w">
|
||||
</span><span class="ss">currency_short</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2252168527-1">[</span><span class="p" data-group-id="2252168527-2">{</span><span class="s">"1000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-3">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 k ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"0 k ¤"</span><span class="p" data-group-id="2252168527-3">]</span><span class="p" data-group-id="2252168527-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-4">{</span><span class="s">"10000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-5">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 k ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"00 k ¤"</span><span class="p" data-group-id="2252168527-5">]</span><span class="p" data-group-id="2252168527-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-6">{</span><span class="s">"100000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-7">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 k ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"000 k ¤"</span><span class="p" data-group-id="2252168527-7">]</span><span class="p" data-group-id="2252168527-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-8">{</span><span class="s">"1000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-9">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"0 M ¤"</span><span class="p" data-group-id="2252168527-9">]</span><span class="p" data-group-id="2252168527-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-10">{</span><span class="s">"10000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-11">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"00 M ¤"</span><span class="p" data-group-id="2252168527-11">]</span><span class="p" data-group-id="2252168527-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-12">{</span><span class="s">"100000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-13">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"000 M ¤"</span><span class="p" data-group-id="2252168527-13">]</span><span class="p" data-group-id="2252168527-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-14">{</span><span class="s">"1000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-15">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Md ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Md ¤"</span><span class="p" data-group-id="2252168527-15">]</span><span class="p" data-group-id="2252168527-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-16">{</span><span class="s">"10000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-17">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Md ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Md ¤"</span><span class="p" data-group-id="2252168527-17">]</span><span class="p" data-group-id="2252168527-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-18">{</span><span class="s">"100000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-19">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Md ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Md ¤"</span><span class="p" data-group-id="2252168527-19">]</span><span class="p" data-group-id="2252168527-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-20">{</span><span class="s">"1000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-21">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Bn ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Bn ¤"</span><span class="p" data-group-id="2252168527-21">]</span><span class="p" data-group-id="2252168527-20">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-22">{</span><span class="s">"10000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-23">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Bn ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Bn ¤"</span><span class="p" data-group-id="2252168527-23">]</span><span class="p" data-group-id="2252168527-22">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2252168527-24">{</span><span class="s">"100000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2252168527-25">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Bn ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Bn ¤"</span><span class="p" data-group-id="2252168527-25">]</span><span class="p" data-group-id="2252168527-24">}</span><span class="p" data-group-id="2252168527-1">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">currency_short</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3143338552-1">[</span><span class="p" data-group-id="3143338552-2">{</span><span class="s">"1000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-3">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 k ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"0 k ¤"</span><span class="p" data-group-id="3143338552-3">]</span><span class="p" data-group-id="3143338552-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-4">{</span><span class="s">"10000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-5">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 k ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"00 k ¤"</span><span class="p" data-group-id="3143338552-5">]</span><span class="p" data-group-id="3143338552-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-6">{</span><span class="s">"100000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-7">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 k ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"000 k ¤"</span><span class="p" data-group-id="3143338552-7">]</span><span class="p" data-group-id="3143338552-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-8">{</span><span class="s">"1000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-9">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"0 M ¤"</span><span class="p" data-group-id="3143338552-9">]</span><span class="p" data-group-id="3143338552-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-10">{</span><span class="s">"10000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-11">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"00 M ¤"</span><span class="p" data-group-id="3143338552-11">]</span><span class="p" data-group-id="3143338552-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-12">{</span><span class="s">"100000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-13">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"000 M ¤"</span><span class="p" data-group-id="3143338552-13">]</span><span class="p" data-group-id="3143338552-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-14">{</span><span class="s">"1000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-15">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Md ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Md ¤"</span><span class="p" data-group-id="3143338552-15">]</span><span class="p" data-group-id="3143338552-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-16">{</span><span class="s">"10000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-17">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Md ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Md ¤"</span><span class="p" data-group-id="3143338552-17">]</span><span class="p" data-group-id="3143338552-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-18">{</span><span class="s">"100000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-19">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Md ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Md ¤"</span><span class="p" data-group-id="3143338552-19">]</span><span class="p" data-group-id="3143338552-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-20">{</span><span class="s">"1000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-21">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Bn ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Bn ¤"</span><span class="p" data-group-id="3143338552-21">]</span><span class="p" data-group-id="3143338552-20">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-22">{</span><span class="s">"10000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-23">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Bn ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Bn ¤"</span><span class="p" data-group-id="3143338552-23">]</span><span class="p" data-group-id="3143338552-22">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3143338552-24">{</span><span class="s">"100000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3143338552-25">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Bn ¤"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Bn ¤"</span><span class="p" data-group-id="3143338552-25">]</span><span class="p" data-group-id="3143338552-24">}</span><span class="p" data-group-id="3143338552-1">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span><span class="w">
|
||||
</span><span class="err">}</span></code></pre>
|
||||
</section>
|
||||
@ -772,8 +772,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">minimum_grouping_digits_for</span><span class="p" data-group-id="0977185130-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0977185130-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0977185130-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p" data-group-id="0977185130-2">}</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">minimum_grouping_digits_for</span><span class="p" data-group-id="1293963057-1">(</span><span class="s">"en"</span><span class="p" data-group-id="1293963057-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1293963057-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p" data-group-id="1293963057-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="minimum_grouping_digits_for!/1">
|
||||
@ -825,7 +825,7 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">minimum_grouping_digits_for!</span><span class="p" data-group-id="2953707816-1">(</span><span class="s">"en"</span><span class="p" data-group-id="2953707816-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">minimum_grouping_digits_for!</span><span class="p" data-group-id="6563521459-1">(</span><span class="s">"en"</span><span class="p" data-group-id="6563521459-1">)</span><span class="w">
|
||||
</span><span class="mi">1</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -429,31 +429,31 @@ The valid substitution keys are <code class="inline">:zero</code>, <code class="
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-1">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="4579449701-1">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-1">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="6294208958-1">}</span><span class="w">
|
||||
</span><span class="s">"one"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="4579449701-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="6294208958-2">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="4579449701-3">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="6294208958-3">}</span><span class="w">
|
||||
</span><span class="s">"two"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">22</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="4579449701-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">22</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="6294208958-4">}</span><span class="w">
|
||||
</span><span class="s">"two"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4579449701-5">(</span><span class="mi">1</span><span class="p" data-group-id="4579449701-5">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="4579449701-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="6294208958-5">(</span><span class="mi">1</span><span class="p" data-group-id="6294208958-5">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="6294208958-6">}</span><span class="w">
|
||||
</span><span class="s">"one"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4579449701-7">(</span><span class="mi">2</span><span class="p" data-group-id="4579449701-7">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="4579449701-8">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="6294208958-7">(</span><span class="mi">2</span><span class="p" data-group-id="6294208958-7">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="6294208958-8">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4579449701-9">(</span><span class="mi">2</span><span class="p" data-group-id="4579449701-9">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-10">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="4579449701-10">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="6294208958-9">(</span><span class="mi">2</span><span class="p" data-group-id="6294208958-9">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-10">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="6294208958-10">}</span><span class="w">
|
||||
</span><span class="s">"two"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"ar"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-11">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="4579449701-11">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"ar"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-11">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="6294208958-11">}</span><span class="w">
|
||||
</span><span class="s">"other"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4579449701-12">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="4579449701-12">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6294208958-12">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"other"</span><span class="p" data-group-id="6294208958-12">}</span><span class="w">
|
||||
</span><span class="s">"other"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -349,9 +349,9 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
Example:
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Symbol</span><span class="o">.</span><span class="n">number_symbols_for</span><span class="p" data-group-id="4244149219-1">(</span><span class="ss">:th</span><span class="p" data-group-id="4244149219-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4244149219-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4244149219-3">%{</span><span class="w">
|
||||
</span><span class="ss">latn</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4244149219-4">%</span><span class="nc" data-group-id="4244149219-4">Cldr.Number.Symbol</span><span class="p" data-group-id="4244149219-4">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Symbol</span><span class="o">.</span><span class="n">number_symbols_for</span><span class="p" data-group-id="0052571234-1">(</span><span class="ss">:th</span><span class="p" data-group-id="0052571234-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0052571234-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0052571234-3">%{</span><span class="w">
|
||||
</span><span class="ss">latn</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0052571234-4">%</span><span class="nc" data-group-id="0052571234-4">Cldr.Number.Symbol</span><span class="p" data-group-id="0052571234-4">{</span><span class="w">
|
||||
</span><span class="ss">decimal</span><span class="p">:</span><span class="w"> </span><span class="s">"."</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">exponential</span><span class="p">:</span><span class="w"> </span><span class="s">"E"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">group</span><span class="p">:</span><span class="w"> </span><span class="s">","</span><span class="p">,</span><span class="w">
|
||||
@ -364,8 +364,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</span><span class="ss">plus_sign</span><span class="p">:</span><span class="w"> </span><span class="s">"+"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">superscripting_exponent</span><span class="p">:</span><span class="w"> </span><span class="s">"×"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">time_separator</span><span class="p">:</span><span class="w"> </span><span class="s">":"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4244149219-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">thai</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4244149219-5">%</span><span class="nc" data-group-id="4244149219-5">Cldr.Number.Symbol</span><span class="p" data-group-id="4244149219-5">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="0052571234-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">thai</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0052571234-5">%</span><span class="nc" data-group-id="0052571234-5">Cldr.Number.Symbol</span><span class="p" data-group-id="0052571234-5">{</span><span class="w">
|
||||
</span><span class="ss">decimal</span><span class="p">:</span><span class="w"> </span><span class="s">"."</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">exponential</span><span class="p">:</span><span class="w"> </span><span class="s">"E"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">group</span><span class="p">:</span><span class="w"> </span><span class="s">","</span><span class="p">,</span><span class="w">
|
||||
@ -378,8 +378,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</span><span class="ss">plus_sign</span><span class="p">:</span><span class="w"> </span><span class="s">"+"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">superscripting_exponent</span><span class="p">:</span><span class="w"> </span><span class="s">"×"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">time_separator</span><span class="p">:</span><span class="w"> </span><span class="s">":"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4244149219-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4244149219-3">}</span><span class="p" data-group-id="4244149219-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="0052571234-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0052571234-3">}</span><span class="p" data-group-id="0052571234-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_symbols_for/2">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -288,23 +288,23 @@ it is returned as is.</p><h2 id="number_system_for/2-examples" class="section-he
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="w">
|
||||
</span><span class="p" data-group-id="9744542351-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9744542351-2">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="9744542351-2">}</span><span class="p" data-group-id="9744542351-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5689408305-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5689408305-2">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="5689408305-2">}</span><span class="p" data-group-id="5689408305-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="w">
|
||||
</span><span class="p" data-group-id="9744542351-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9744542351-4">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="9744542351-4">}</span><span class="p" data-group-id="9744542351-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5689408305-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5689408305-4">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="5689408305-4">}</span><span class="p" data-group-id="5689408305-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"he"</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="w">
|
||||
</span><span class="p" data-group-id="9744542351-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9744542351-6">%{</span><span class="ss">rules</span><span class="p">:</span><span class="w"> </span><span class="s">"hebrew"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:algorithmic</span><span class="p" data-group-id="9744542351-6">}</span><span class="p" data-group-id="9744542351-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5689408305-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5689408305-6">%{</span><span class="ss">rules</span><span class="p">:</span><span class="w"> </span><span class="s">"hebrew"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:algorithmic</span><span class="p" data-group-id="5689408305-6">}</span><span class="p" data-group-id="5689408305-5">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="w">
|
||||
</span><span class="p" data-group-id="9744542351-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9744542351-8">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="9744542351-8">}</span><span class="p" data-group-id="9744542351-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5689408305-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5689408305-8">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="5689408305-8">}</span><span class="p" data-group-id="5689408305-7">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:finance</span><span class="w">
|
||||
</span><span class="p" data-group-id="9744542351-9">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5689408305-9">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9744542351-10">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"</span><span class="p" data-group-id="9744542351-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9744542351-9">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5689408305-10">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"</span><span class="p" data-group-id="5689408305-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5689408305-9">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_system_from_locale/1">
|
||||
@ -395,10 +395,10 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_names_for</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="p" data-group-id="1225557896-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1225557896-2">[</span><span class="ss">:latn</span><span class="p" data-group-id="1225557896-2">]</span><span class="p" data-group-id="1225557896-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5023056527-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5023056527-2">[</span><span class="ss">:latn</span><span class="p" data-group-id="5023056527-2">]</span><span class="p" data-group-id="5023056527-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_names_for</span><span class="w"> </span><span class="s">"zz"</span><span class="w">
|
||||
</span><span class="p" data-group-id="1225557896-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1225557896-4">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="1225557896-4">}</span><span class="p" data-group-id="1225557896-3">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5023056527-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5023056527-4">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="5023056527-4">}</span><span class="p" data-group-id="5023056527-3">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_system_names_for!/1">
|
||||
@ -480,13 +480,13 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_systems_for</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3392145392-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3392145392-2">%{</span><span class="ss">default</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">native</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="3392145392-2">}</span><span class="p" data-group-id="3392145392-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9728222698-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9728222698-2">%{</span><span class="ss">default</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">native</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="9728222698-2">}</span><span class="p" data-group-id="9728222698-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_systems_for</span><span class="w"> </span><span class="s">"th"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3392145392-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3392145392-4">%{</span><span class="ss">default</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">native</span><span class="p">:</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="3392145392-4">}</span><span class="p" data-group-id="3392145392-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9728222698-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9728222698-4">%{</span><span class="ss">default</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">native</span><span class="p">:</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="9728222698-4">}</span><span class="p" data-group-id="9728222698-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_systems_for</span><span class="w"> </span><span class="s">"zz"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3392145392-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3392145392-6">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="3392145392-6">}</span><span class="p" data-group-id="3392145392-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="9728222698-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9728222698-6">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="9728222698-6">}</span><span class="p" data-group-id="9728222698-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_systems_for!/1">
|
||||
@ -584,20 +584,20 @@ actual system name.</p><h2 id="system_name_from/2-examples" class="section-headi
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="n">ex</span><span class="o">></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="4887535812-1">(</span><span class="ss">:default</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="4887535812-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4887535812-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="4887535812-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="n">ex</span><span class="o">></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="7109047758-1">(</span><span class="ss">:default</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="7109047758-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7109047758-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="7109047758-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="4887535812-3">(</span><span class="s">"latn"</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="4887535812-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4887535812-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="4887535812-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="7109047758-3">(</span><span class="s">"latn"</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="7109047758-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7109047758-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="7109047758-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="4887535812-5">(</span><span class="ss">:native</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="4887535812-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4887535812-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="4887535812-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="7109047758-5">(</span><span class="ss">:native</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="7109047758-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7109047758-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="7109047758-6">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="4887535812-7">(</span><span class="ss">:nope</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="4887535812-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4887535812-8">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="7109047758-7">(</span><span class="ss">:nope</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="7109047758-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7109047758-8">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4887535812-9">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system :nope is unknown"</span><span class="p" data-group-id="4887535812-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4887535812-8">}</span></code></pre><p>Note that return value is not guaranteed to be a valid
|
||||
</span><span class="p" data-group-id="7109047758-9">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system :nope is unknown"</span><span class="p" data-group-id="7109047758-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7109047758-8">}</span></code></pre><p>Note that return value is not guaranteed to be a valid
|
||||
number system for the given locale as demonstrated in the third example.</p>
|
||||
</section>
|
||||
</section>
|
||||
@ -644,16 +644,16 @@ is recommended.</p></li></ul><h2 id="to_system/2-examples" class="section-headin
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">to_system</span><span class="w"> </span><span class="mi">123456</span><span class="p">,</span><span class="w"> </span><span class="ss">:hebr</span><span class="w">
|
||||
</span><span class="p" data-group-id="1565690995-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"קכ״ג׳תנ״ו"</span><span class="p" data-group-id="1565690995-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4005551335-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"קכ״ג׳תנ״ו"</span><span class="p" data-group-id="4005551335-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">to_system</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:hans</span><span class="w">
|
||||
</span><span class="p" data-group-id="1565690995-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"一百二十三"</span><span class="p" data-group-id="1565690995-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4005551335-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"一百二十三"</span><span class="p" data-group-id="4005551335-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">to_system</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:hant</span><span class="w">
|
||||
</span><span class="p" data-group-id="1565690995-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"一百二十三"</span><span class="p" data-group-id="1565690995-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4005551335-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"一百二十三"</span><span class="p" data-group-id="4005551335-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">to_system</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:hansfin</span><span class="w">
|
||||
</span><span class="p" data-group-id="1565690995-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"壹佰贰拾叁"</span><span class="p" data-group-id="1565690995-4">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="4005551335-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"壹佰贰拾叁"</span><span class="p" data-group-id="4005551335-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_system!/2">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -133,12 +133,12 @@ digits between number systems. For example from :arabic to :latn. Since genera
|
||||
transliteration map is slow, pairs of transliterations can be configured so that the
|
||||
transliteration map is created at compile time and therefore speeding up transliteration at
|
||||
run time.</p><p>To configure these transliteration pairs, add the to the <code class="inline">use Cldr</code> configuration
|
||||
in a backend module:</p><pre><code class="makeup elixir" translate="no"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">MyApp.Cldr</span><span class="w"> </span><span class="k" data-group-id="3904486859-1">do</span><span class="w">
|
||||
in a backend module:</p><pre><code class="makeup elixir" translate="no"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">MyApp.Cldr</span><span class="w"> </span><span class="k" data-group-id="1816141116-1">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3904486859-2">[</span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p" data-group-id="3904486859-2">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1816141116-2">[</span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p" data-group-id="1816141116-2">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">default_locale</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">precompile_transliterations</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3904486859-3">[</span><span class="p" data-group-id="3904486859-4">{</span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="3904486859-4">}</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3904486859-5">{</span><span class="ss">:arab</span><span class="p">,</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="3904486859-5">}</span><span class="p" data-group-id="3904486859-3">]</span><span class="w">
|
||||
</span><span class="k" data-group-id="3904486859-1">end</span></code></pre><p>Where each tuple in the list configures one transliteration map. In this example, two maps are
|
||||
</span><span class="ss">precompile_transliterations</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1816141116-3">[</span><span class="p" data-group-id="1816141116-4">{</span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="1816141116-4">}</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1816141116-5">{</span><span class="ss">:arab</span><span class="p">,</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="1816141116-5">}</span><span class="p" data-group-id="1816141116-3">]</span><span class="w">
|
||||
</span><span class="k" data-group-id="1816141116-1">end</span></code></pre><p>Where each tuple in the list configures one transliteration map. In this example, two maps are
|
||||
configured: from <code class="inline">:latn</code> to <code class="inline">:thai</code> and from <code class="inline">:arab</code> to <code class="inline">:thai</code>.</p><p>A list of configurable number systems is returned by <a href="https://hexdocs.pm/ex_cldr_numbers/2.31.3/Cldr.Number.System.html#systems_with_digits/0"><code class="inline">Cldr.Number.System.systems_with_digits/0</code></a>.</p><p>If a transliteration is requested between two number pairs that have not been configured for
|
||||
precompilation, a warning is logged.</p>
|
||||
</section>
|
||||
@ -252,22 +252,22 @@ and <a href="Plausible.Cldr.Number.System.html#number_systems_for/1"><code class
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="3952021041-1">(</span><span class="s">"123556"</span><span class="p" data-group-id="3952021041-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="0320624815-1">(</span><span class="s">"123556"</span><span class="p" data-group-id="0320624815-1">)</span><span class="w">
|
||||
</span><span class="s">"123556"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="3952021041-2">(</span><span class="s">"123,556.000"</span><span class="p">,</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="3952021041-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="0320624815-2">(</span><span class="s">"123,556.000"</span><span class="p">,</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="0320624815-2">)</span><span class="w">
|
||||
</span><span class="s">"123 556,000"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="3952021041-3">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="3952021041-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="0320624815-3">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="0320624815-3">)</span><span class="w">
|
||||
</span><span class="s">"123556"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="3952021041-4">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="s">"thai"</span><span class="p" data-group-id="3952021041-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="0320624815-4">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="s">"thai"</span><span class="p" data-group-id="0320624815-4">)</span><span class="w">
|
||||
</span><span class="s">"๑๒๓๕๕๖"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="3952021041-5">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="p" data-group-id="3952021041-5">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="0320624815-5">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="p" data-group-id="0320624815-5">)</span><span class="w">
|
||||
</span><span class="s">"๑๒๓๕๕๖"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="3952021041-6">(</span><span class="s">"Some number is: 123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="s">"thai"</span><span class="p" data-group-id="3952021041-6">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="0320624815-6">(</span><span class="s">"Some number is: 123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="s">"thai"</span><span class="p" data-group-id="0320624815-6">)</span><span class="w">
|
||||
</span><span class="s">"Some number is: ๑๒๓๕๕๖"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -412,19 +412,19 @@ using the Elixir standard library functions.</p><h2 id="parse/2-examples" class=
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="9524503103-1">(</span><span class="s">"+1.000,34"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p" data-group-id="9524503103-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9524503103-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mf">1000.34</span><span class="p" data-group-id="9524503103-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="9731176639-1">(</span><span class="s">"+1.000,34"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p" data-group-id="9731176639-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9731176639-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mf">1000.34</span><span class="p" data-group-id="9731176639-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="9524503103-3">(</span><span class="s">"-1_000_000.34"</span><span class="p" data-group-id="9524503103-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9524503103-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">1000000.34</span><span class="p" data-group-id="9524503103-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="9731176639-3">(</span><span class="s">"-1_000_000.34"</span><span class="p" data-group-id="9731176639-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9731176639-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">1000000.34</span><span class="p" data-group-id="9731176639-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="9524503103-5">(</span><span class="s">"1.000"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="9524503103-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9524503103-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mi">1000</span><span class="p" data-group-id="9524503103-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="9731176639-5">(</span><span class="s">"1.000"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="9731176639-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9731176639-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mi">1000</span><span class="p" data-group-id="9731176639-6">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="9524503103-7">(</span><span class="s">"+1.000,34"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="9524503103-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9524503103-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9524503103-9">{</span><span class="nc">Cldr.Number.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The string </span><span class="se">\"</span><span class="s">+1.000,34</span><span class="se">\"</span><span class="s"> could not be parsed as a number"</span><span class="p" data-group-id="9524503103-9">}</span><span class="p" data-group-id="9524503103-8">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="9731176639-7">(</span><span class="s">"+1.000,34"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="9731176639-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9731176639-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9731176639-9">{</span><span class="nc">Cldr.Number.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The string </span><span class="se">\"</span><span class="s">+1.000,34</span><span class="se">\"</span><span class="s"> could not be parsed as a number"</span><span class="p" data-group-id="9731176639-9">}</span><span class="p" data-group-id="9731176639-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_currencies/2">
|
||||
@ -496,17 +496,17 @@ financial instruments.</p></li></ul><h2 id="resolve_currencies/2-examples" class
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="4755439236-1">(</span><span class="s">"100 US dollars"</span><span class="p" data-group-id="4755439236-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="7417352765-1">(</span><span class="s">"100 US dollars"</span><span class="p" data-group-id="7417352765-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="w">
|
||||
</span><span class="p" data-group-id="4755439236-2">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="4755439236-2">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7417352765-2">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="7417352765-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="4755439236-3">(</span><span class="s">"100 eurosports"</span><span class="p" data-group-id="4755439236-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="p" data-group-id="4755439236-4">(</span><span class="ss">fuzzy</span><span class="p">:</span><span class="w"> </span><span class="mf">0.75</span><span class="p" data-group-id="4755439236-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4755439236-5">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:EUR</span><span class="p" data-group-id="4755439236-5">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="7417352765-3">(</span><span class="s">"100 eurosports"</span><span class="p" data-group-id="7417352765-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="p" data-group-id="7417352765-4">(</span><span class="ss">fuzzy</span><span class="p">:</span><span class="w"> </span><span class="mf">0.75</span><span class="p" data-group-id="7417352765-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7417352765-5">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:EUR</span><span class="p" data-group-id="7417352765-5">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="4755439236-6">(</span><span class="s">"100 dollars des États-Unis"</span><span class="p" data-group-id="4755439236-6">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="p" data-group-id="4755439236-7">(</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="4755439236-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4755439236-8">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="4755439236-8">]</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="7417352765-6">(</span><span class="s">"100 dollars des États-Unis"</span><span class="p" data-group-id="7417352765-6">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="p" data-group-id="7417352765-7">(</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="7417352765-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7417352765-8">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="7417352765-8">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_currency/2">
|
||||
@ -583,19 +583,19 @@ financial instruments.</p></li></ul><h2 id="resolve_currency/2-examples" class="
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="1637250607-1">(</span><span class="s">"US dollars"</span><span class="p" data-group-id="1637250607-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1637250607-2">[</span><span class="ss">:USD</span><span class="p" data-group-id="1637250607-2">]</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="0782842807-1">(</span><span class="s">"US dollars"</span><span class="p" data-group-id="0782842807-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0782842807-2">[</span><span class="ss">:USD</span><span class="p" data-group-id="0782842807-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="1637250607-3">(</span><span class="s">"100 eurosports"</span><span class="p">,</span><span class="w"> </span><span class="ss">fuzzy</span><span class="p">:</span><span class="w"> </span><span class="mf">0.75</span><span class="p" data-group-id="1637250607-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1637250607-4">[</span><span class="ss">:EUR</span><span class="p" data-group-id="1637250607-4">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="0782842807-3">(</span><span class="s">"100 eurosports"</span><span class="p">,</span><span class="w"> </span><span class="ss">fuzzy</span><span class="p">:</span><span class="w"> </span><span class="mf">0.75</span><span class="p" data-group-id="0782842807-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0782842807-4">[</span><span class="ss">:EUR</span><span class="p" data-group-id="0782842807-4">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="1637250607-5">(</span><span class="s">"dollars des États-Unis"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="1637250607-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1637250607-6">[</span><span class="ss">:USD</span><span class="p" data-group-id="1637250607-6">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="0782842807-5">(</span><span class="s">"dollars des États-Unis"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="0782842807-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0782842807-6">[</span><span class="ss">:USD</span><span class="p" data-group-id="0782842807-6">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="1637250607-7">(</span><span class="s">"not a known currency"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="1637250607-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1637250607-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1637250607-9">{</span><span class="nc">Cldr.UnknownCurrencyError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The currency </span><span class="se">\"</span><span class="s">not a known currency</span><span class="se">\"</span><span class="s"> is unknown or not supported"</span><span class="p" data-group-id="1637250607-9">}</span><span class="p" data-group-id="1637250607-8">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="0782842807-7">(</span><span class="s">"not a known currency"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="0782842807-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0782842807-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0782842807-9">{</span><span class="nc">Cldr.UnknownCurrencyError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The currency </span><span class="se">\"</span><span class="s">not a known currency</span><span class="se">\"</span><span class="s"> is unknown or not supported"</span><span class="p" data-group-id="0782842807-9">}</span><span class="p" data-group-id="0782842807-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_per/2">
|
||||
@ -659,13 +659,13 @@ The default is <code class="inline">options[:backend].get_locale()</code></li></
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_per</span><span class="w"> </span><span class="s">"11%"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3936322806-1">[</span><span class="s">"11"</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="3936322806-1">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5905765149-1">[</span><span class="s">"11"</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="5905765149-1">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_per</span><span class="w"> </span><span class="s">"% of linguists"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3936322806-2">[</span><span class="ss">:percent</span><span class="p">,</span><span class="w"> </span><span class="s">" of linguists"</span><span class="p" data-group-id="3936322806-2">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5905765149-2">[</span><span class="ss">:percent</span><span class="p">,</span><span class="w"> </span><span class="s">" of linguists"</span><span class="p" data-group-id="5905765149-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_per</span><span class="w"> </span><span class="s">"% of linguists %"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3936322806-3">[</span><span class="ss">:percent</span><span class="p">,</span><span class="w"> </span><span class="s">" of linguists "</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="3936322806-3">]</span></code></pre>
|
||||
</span><span class="p" data-group-id="5905765149-3">[</span><span class="ss">:percent</span><span class="p">,</span><span class="w"> </span><span class="s">" of linguists "</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="5905765149-3">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_pers/2">
|
||||
@ -722,9 +722,9 @@ The default is <code class="inline">options[:backend].get_locale()</code></li></
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="3878777130-1">(</span><span class="s">"100%"</span><span class="p" data-group-id="3878777130-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_pers</span><span class="p" data-group-id="3878777130-2">(</span><span class="p" data-group-id="3878777130-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3878777130-3">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="3878777130-3">]</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="0205111569-1">(</span><span class="s">"100%"</span><span class="p" data-group-id="0205111569-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_pers</span><span class="p" data-group-id="0205111569-2">(</span><span class="p" data-group-id="0205111569-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0205111569-3">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="0205111569-3">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="scan/2">
|
||||
@ -784,20 +784,20 @@ and any options provided are passed to that function.</p><h2 id="scan/2-examples
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="9788639649-1">(</span><span class="s">"£1_000_000.34"</span><span class="p" data-group-id="9788639649-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9788639649-2">[</span><span class="s">"£"</span><span class="p">,</span><span class="w"> </span><span class="mf">1000000.34</span><span class="p" data-group-id="9788639649-2">]</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="5827505849-1">(</span><span class="s">"£1_000_000.34"</span><span class="p" data-group-id="5827505849-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5827505849-2">[</span><span class="s">"£"</span><span class="p">,</span><span class="w"> </span><span class="mf">1000000.34</span><span class="p" data-group-id="5827505849-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="9788639649-3">(</span><span class="s">"I want £1_000_000 dollars"</span><span class="p" data-group-id="9788639649-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9788639649-4">[</span><span class="s">"I want £"</span><span class="p">,</span><span class="w"> </span><span class="mi">1000000</span><span class="p">,</span><span class="w"> </span><span class="s">" dollars"</span><span class="p" data-group-id="9788639649-4">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="5827505849-3">(</span><span class="s">"I want £1_000_000 dollars"</span><span class="p" data-group-id="5827505849-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5827505849-4">[</span><span class="s">"I want £"</span><span class="p">,</span><span class="w"> </span><span class="mi">1000000</span><span class="p">,</span><span class="w"> </span><span class="s">" dollars"</span><span class="p" data-group-id="5827505849-4">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="9788639649-5">(</span><span class="s">"The prize is 23"</span><span class="p" data-group-id="9788639649-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9788639649-6">[</span><span class="s">"The prize is "</span><span class="p">,</span><span class="w"> </span><span class="mi">23</span><span class="p" data-group-id="9788639649-6">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="5827505849-5">(</span><span class="s">"The prize is 23"</span><span class="p" data-group-id="5827505849-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5827505849-6">[</span><span class="s">"The prize is "</span><span class="p">,</span><span class="w"> </span><span class="mi">23</span><span class="p" data-group-id="5827505849-6">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="9788639649-7">(</span><span class="s">"The lottery number is 23 for the next draw"</span><span class="p" data-group-id="9788639649-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9788639649-8">[</span><span class="s">"The lottery number is "</span><span class="p">,</span><span class="w"> </span><span class="mi">23</span><span class="p">,</span><span class="w"> </span><span class="s">" for the next draw"</span><span class="p" data-group-id="9788639649-8">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="5827505849-7">(</span><span class="s">"The lottery number is 23 for the next draw"</span><span class="p" data-group-id="5827505849-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5827505849-8">[</span><span class="s">"The lottery number is "</span><span class="p">,</span><span class="w"> </span><span class="mi">23</span><span class="p">,</span><span class="w"> </span><span class="s">" for the next draw"</span><span class="p" data-group-id="5827505849-8">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="9788639649-9">(</span><span class="s">"The loss is -1.000 euros"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="9788639649-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9788639649-10">[</span><span class="s">"The loss is "</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mi">1000</span><span class="p">,</span><span class="w"> </span><span class="s">" euros"</span><span class="p" data-group-id="9788639649-10">]</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="5827505849-9">(</span><span class="s">"The loss is -1.000 euros"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="5827505849-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5827505849-10">[</span><span class="s">"The loss is "</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mi">1000</span><span class="p">,</span><span class="w"> </span><span class="s">" euros"</span><span class="p" data-group-id="5827505849-10">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_approx_string/2">
|
||||
@ -844,7 +844,7 @@ options.</p></li></ul><h2 id="to_approx_string/2-example" class="section-heading
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_approx_string</span><span class="w"> </span><span class="mi">1234</span><span class="w">
|
||||
</span><span class="p" data-group-id="4431675098-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"~1,234"</span><span class="p" data-group-id="4431675098-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="4738083687-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"~1,234"</span><span class="p" data-group-id="4738083687-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_at_least_string/2">
|
||||
@ -891,7 +891,7 @@ options.</p></li></ul><h2 id="to_at_least_string/2-example" class="section-headi
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_at_least_string</span><span class="w"> </span><span class="mi">1234</span><span class="w">
|
||||
</span><span class="p" data-group-id="8691076143-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,234+"</span><span class="p" data-group-id="8691076143-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5652899526-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,234+"</span><span class="p" data-group-id="5652899526-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_at_most_string/2">
|
||||
@ -938,7 +938,7 @@ options.</p></li></ul><h2 id="to_at_most_string/2-example" class="section-headin
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_at_most_string</span><span class="w"> </span><span class="mi">1234</span><span class="w">
|
||||
</span><span class="p" data-group-id="8268814665-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"≤1,234"</span><span class="p" data-group-id="8268814665-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="4616729283-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"≤1,234"</span><span class="p" data-group-id="4616729283-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_range_string/2">
|
||||
@ -985,7 +985,7 @@ options.</p></li></ul><h2 id="to_range_string/2-example" class="section-heading"
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_range_string</span><span class="w"> </span><span class="mi">1234</span><span class="o">..</span><span class="mi">5678</span><span class="w">
|
||||
</span><span class="p" data-group-id="0385700475-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,234–5,678"</span><span class="p" data-group-id="0385700475-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="0334024326-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,234–5,678"</span><span class="p" data-group-id="0334024326-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_string/2">
|
||||
@ -1104,21 +1104,21 @@ extensions.</p><h2 id="to_string/2-wrapping-format-elements" class="section-head
|
||||
</h2>
|
||||
<p>Wrapping elements is particularly useful when formatting a number with a
|
||||
currency symbol and the requirement is to have different HTML formatting
|
||||
applied to the symbol than the number. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="4731289074-1">(</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:currency</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">wrapper</span><span class="p">:</span><span class="w"> </span><span class="k" data-group-id="4731289074-2">fn</span><span class="w">
|
||||
applied to the symbol than the number. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="5869042763-1">(</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:currency</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">wrapper</span><span class="p">:</span><span class="w"> </span><span class="k" data-group-id="5869042763-2">fn</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_symbol</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>"</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="s">"</span>"</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:number</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>"</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="s">"</span>"</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_space</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="s">"<span>"</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="s">"</span>"</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="c">_other</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="n">string</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="k" data-group-id="4731289074-2">end</span><span class="p" data-group-id="4731289074-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4731289074-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>$</span><span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>100.00</span>"</span><span class="p" data-group-id="4731289074-3">}</span></code></pre><p>It is also possible and recommended to use the <a href="https://hexdocs.pm/phoenix_html/3.3.1/Phoenix.HTML.Tag.html#content_tag/3"><code class="inline">Phoenix.HTML.Tag.content_tag/3</code></a>
|
||||
</span><span class="gp unselectable">...> </span><span class="k" data-group-id="5869042763-2">end</span><span class="p" data-group-id="5869042763-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5869042763-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>$</span><span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>100.00</span>"</span><span class="p" data-group-id="5869042763-3">}</span></code></pre><p>It is also possible and recommended to use the <a href="https://hexdocs.pm/phoenix_html/3.3.1/Phoenix.HTML.Tag.html#content_tag/3"><code class="inline">Phoenix.HTML.Tag.content_tag/3</code></a>
|
||||
function if wrapping HTML tags since these will ensure HTML entities are
|
||||
correctly encoded. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="2914274004-1">(</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:currency</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">wrapper</span><span class="p">:</span><span class="w"> </span><span class="k" data-group-id="2914274004-2">fn</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_symbol</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="2914274004-3">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">class</span><span class="p">:</span><span class="w"> </span><span class="s">"symbol"</span><span class="p" data-group-id="2914274004-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:number</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="2914274004-4">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">class</span><span class="p">:</span><span class="w"> </span><span class="s">"number"</span><span class="p" data-group-id="2914274004-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_space</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="2914274004-5">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p" data-group-id="2914274004-5">)</span><span class="w">
|
||||
correctly encoded. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="0399402710-1">(</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:currency</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">wrapper</span><span class="p">:</span><span class="w"> </span><span class="k" data-group-id="0399402710-2">fn</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_symbol</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="0399402710-3">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">class</span><span class="p">:</span><span class="w"> </span><span class="s">"symbol"</span><span class="p" data-group-id="0399402710-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:number</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="0399402710-4">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">class</span><span class="p">:</span><span class="w"> </span><span class="s">"number"</span><span class="p" data-group-id="0399402710-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_space</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="0399402710-5">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p" data-group-id="0399402710-5">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="c">_other</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="n">string</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="k" data-group-id="2914274004-2">end</span><span class="p" data-group-id="2914274004-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2914274004-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>$</span><span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>100.00</span>"</span><span class="p" data-group-id="2914274004-6">}</span></code></pre><p>When formatting a number the format is parsed into format elements that might include
|
||||
</span><span class="gp unselectable">...> </span><span class="k" data-group-id="0399402710-2">end</span><span class="p" data-group-id="0399402710-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0399402710-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>$</span><span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>100.00</span>"</span><span class="p" data-group-id="0399402710-6">}</span></code></pre><p>When formatting a number the format is parsed into format elements that might include
|
||||
a currency symbol, a literal string, inserted text between a currency symbol and the
|
||||
currency amount, a percent sign, the number itself and several other elements. In
|
||||
some cases it is helpful to be apply specific formatting to each element.
|
||||
@ -1139,80 +1139,80 @@ inserted in the final formatted number.</p><h2 id="to_string/2-returns" class="s
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12,345"</span><span class="p" data-group-id="4011010163-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12,345"</span><span class="p" data-group-id="9236083402-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12 345"</span><span class="p" data-group-id="4011010163-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12 345"</span><span class="p" data-group-id="9236083402-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1345.32</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:EUR</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"es"</span><span class="p">,</span><span class="w"> </span><span class="ss">minimum_grouping_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1.345,32 €"</span><span class="p" data-group-id="4011010163-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1.345,32 €"</span><span class="p" data-group-id="9236083402-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1345.32</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:EUR</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"es"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1345,32 €"</span><span class="p" data-group-id="4011010163-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1345,32 €"</span><span class="p" data-group-id="9236083402-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="s">"USD"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12 345,00 $US"</span><span class="p" data-group-id="4011010163-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12 345,00 $US"</span><span class="p" data-group-id="9236083402-5">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="s">"#E0"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1.2345E4"</span><span class="p" data-group-id="4011010163-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1.2345E4"</span><span class="p" data-group-id="9236083402-6">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:accounting</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"THB 12,345.00"</span><span class="p" data-group-id="4011010163-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"THB 12,345.00"</span><span class="p" data-group-id="9236083402-7">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="o">-</span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:accounting</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-8">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"(THB 12,345.00)"</span><span class="p" data-group-id="4011010163-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-8">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"(THB 12,345.00)"</span><span class="p" data-group-id="9236083402-8">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:accounting</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"th"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-9">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"฿12,345.00"</span><span class="p" data-group-id="4011010163-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-9">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"฿12,345.00"</span><span class="p" data-group-id="9236083402-9">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:accounting</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">number_system</span><span class="p">:</span><span class="w"> </span><span class="ss">:native</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"฿๑๒,๓๔๕.๐๐"</span><span class="p" data-group-id="4011010163-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"฿๑๒,๓๔๕.๐๐"</span><span class="p" data-group-id="9236083402-10">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1244.30</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:long</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1 thousand"</span><span class="p" data-group-id="4011010163-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1 thousand"</span><span class="p" data-group-id="9236083402-11">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1244.30</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:long</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="s">"USD"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-12">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,244 US dollars"</span><span class="p" data-group-id="4011010163-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-12">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,244 US dollars"</span><span class="p" data-group-id="9236083402-12">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1244.30</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:short</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-13">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1K"</span><span class="p" data-group-id="4011010163-13">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-13">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1K"</span><span class="p" data-group-id="9236083402-13">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1244.30</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:short</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="s">"EUR"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-14">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"€1K"</span><span class="p" data-group-id="4011010163-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-14">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"€1K"</span><span class="p" data-group-id="9236083402-14">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-15">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one thousand two hundred thirty-four"</span><span class="p" data-group-id="4011010163-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-15">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one thousand two hundred thirty-four"</span><span class="p" data-group-id="9236083402-15">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout_verbose</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-16">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one thousand two hundred and thirty-four"</span><span class="p" data-group-id="4011010163-16">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-16">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one thousand two hundred and thirty-four"</span><span class="p" data-group-id="9236083402-16">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">1989</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout_year</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-17">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"nineteen eighty-nine"</span><span class="p" data-group-id="4011010163-17">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-17">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"nineteen eighty-nine"</span><span class="p" data-group-id="9236083402-17">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:ordinal</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-18">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"123rd"</span><span class="p" data-group-id="4011010163-18">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-18">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"123rd"</span><span class="p" data-group-id="9236083402-18">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:roman</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-19">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"CXXIII"</span><span class="p" data-group-id="4011010163-19">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9236083402-19">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"CXXIII"</span><span class="p" data-group-id="9236083402-19">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"th-u-nu-thai"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4011010163-20">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"๑๒๓"</span><span class="p" data-group-id="4011010163-20">}</span></code></pre><h2 id="to_string/2-errors" class="section-heading">
|
||||
</span><span class="p" data-group-id="9236083402-20">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"๑๒๓"</span><span class="p" data-group-id="9236083402-20">}</span></code></pre><h2 id="to_string/2-errors" class="section-heading">
|
||||
<a href="#to_string/2-errors">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
Errors
|
||||
</a>
|
||||
</h2>
|
||||
<p>An error tuple <code class="inline">{:error, reason}</code> will be returned if an error is detected.
|
||||
The two most likely causes of an error return are:</p><ul><li>A format cannot be compiled. In this case the error tuple will look like:</li></ul><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="2079688036-1">(</span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="s">"0#"</span><span class="p" data-group-id="2079688036-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2079688036-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2079688036-3">{</span><span class="nc">Cldr.FormatCompileError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Decimal format compiler: syntax error before: </span><span class="se">\"</span><span class="s">#</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="2079688036-3">}</span><span class="p" data-group-id="2079688036-2">}</span></code></pre><ul><li>The format style requested is not defined for the <code class="inline">locale</code> and
|
||||
The two most likely causes of an error return are:</p><ul><li>A format cannot be compiled. In this case the error tuple will look like:</li></ul><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="1997304053-1">(</span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="s">"0#"</span><span class="p" data-group-id="1997304053-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1997304053-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1997304053-3">{</span><span class="nc">Cldr.FormatCompileError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Decimal format compiler: syntax error before: </span><span class="se">\"</span><span class="s">#</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="1997304053-3">}</span><span class="p" data-group-id="1997304053-2">}</span></code></pre><ul><li>The format style requested is not defined for the <code class="inline">locale</code> and
|
||||
<code class="inline">number_system</code>. This happens typically when the number system is
|
||||
<code class="inline">:algorithmic</code> rather than the more common <code class="inline">:numeric</code>. In this case the error
|
||||
return looks like:</li></ul><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="6772775938-1">(</span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"he"</span><span class="p">,</span><span class="w"> </span><span class="ss">number_system</span><span class="p">:</span><span class="w"> </span><span class="s">"hebr"</span><span class="p" data-group-id="6772775938-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6772775938-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6772775938-3">{</span><span class="nc">Cldr.UnknownFormatError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The locale :he with number system :hebr does not define a format :standard"</span><span class="p" data-group-id="6772775938-3">}</span><span class="p" data-group-id="6772775938-2">}</span></code></pre>
|
||||
return looks like:</li></ul><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="5690856964-1">(</span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"he"</span><span class="p">,</span><span class="w"> </span><span class="ss">number_system</span><span class="p">:</span><span class="w"> </span><span class="s">"hebr"</span><span class="p" data-group-id="5690856964-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5690856964-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5690856964-3">{</span><span class="nc">Cldr.UnknownFormatError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The locale :he with number system :hebr does not define a format :standard"</span><span class="p" data-group-id="5690856964-3">}</span><span class="p" data-group-id="5690856964-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_string!/2">
|
||||
@ -1316,17 +1316,17 @@ returned by <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.html#known_number_sy
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">validate_number_system</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="w">
|
||||
</span><span class="p" data-group-id="0236848320-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="0236848320-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5533142294-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="5533142294-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">validate_number_system</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="w">
|
||||
</span><span class="p" data-group-id="0236848320-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="0236848320-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5533142294-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="5533142294-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">validate_number_system</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:unknown</span><span class="w">
|
||||
</span><span class="p" data-group-id="0236848320-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0236848320-4">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system :unknown is unknown"</span><span class="p" data-group-id="0236848320-4">}</span><span class="p" data-group-id="0236848320-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5533142294-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5533142294-4">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system :unknown is unknown"</span><span class="p" data-group-id="5533142294-4">}</span><span class="p" data-group-id="5533142294-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">validate_number_system</span><span class="w"> </span><span class="s">"zz"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="w">
|
||||
</span><span class="p" data-group-id="0236848320-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0236848320-6">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="0236848320-6">}</span><span class="p" data-group-id="0236848320-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5533142294-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5533142294-6">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="5533142294-6">}</span><span class="p" data-group-id="5533142294-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -116,9 +116,9 @@ Plausible
|
||||
<section id="moduledoc">
|
||||
<p>Functions to implement the number system rule-based-number-format rules of CLDR.</p><p>These rules are defined only on the "und" locale and represent specialised
|
||||
number formatting.</p><p>The standard public API for RBNF is via the <a href="https://hexdocs.pm/ex_cldr_numbers/2.31.3/Cldr.Number.html#to_string/2"><code class="inline">Cldr.Number.to_string/2</code></a> function.</p><p>The functions on this module are defined at compile time based upon the RBNF rules
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.NumberSystem</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="8416658447-1">(</span><span class="ss">:und</span><span class="p" data-group-id="8416658447-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="8416658447-2">(</span><span class="p" data-group-id="8416658447-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8416658447-3">[</span><span class="w">
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.NumberSystem</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="1152612369-1">(</span><span class="ss">:und</span><span class="p" data-group-id="1152612369-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="1152612369-2">(</span><span class="p" data-group-id="1152612369-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1152612369-3">[</span><span class="w">
|
||||
</span><span class="ss">:armenian_lower</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:armenian_upper</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:cyrillic_lower</span><span class="p">,</span><span class="w">
|
||||
@ -132,9 +132,9 @@ defined in the Unicode CLDR data repository. Available rules are identified by:
|
||||
</span><span class="ss">:roman_upper</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:tamil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:zz_default</span><span class="w">
|
||||
</span><span class="p" data-group-id="8416658447-3">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.NumberSystem</span><span class="o">.</span><span class="n">roman_upper</span><span class="p" data-group-id="1828837832-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="1828837832-1">)</span><span class="w">
|
||||
</span><span class="s">"CXXIII"</span></code></pre><p>This particular call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="4439730582-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:roman</span><span class="p" data-group-id="4439730582-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4439730582-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"CXXIII"</span><span class="p" data-group-id="4439730582-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="1152612369-3">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.NumberSystem</span><span class="o">.</span><span class="n">roman_upper</span><span class="p" data-group-id="3785796462-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="3785796462-1">)</span><span class="w">
|
||||
</span><span class="s">"CXXIII"</span></code></pre><p>This particular call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="5201810856-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:roman</span><span class="p" data-group-id="5201810856-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5201810856-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"CXXIII"</span><span class="p" data-group-id="5201810856-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -116,20 +116,20 @@ Plausible
|
||||
<section id="moduledoc">
|
||||
<p>Functions to implement the ordinal rule-based-number-format rules of CLDR.</p><p>As CLDR notes, the data is incomplete or non-existent for many languages. It
|
||||
is considered complete for English however.</p><p>The standard public API for RBNF is via the <a href="https://hexdocs.pm/ex_cldr_numbers/2.31.3/Cldr.Number.html#to_string/2"><code class="inline">Cldr.Number.to_string/2</code></a> function.</p><p>The functions on this module are defined at compile time based upon the RBNF rules
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="8336343980-1">(</span><span class="ss">:en</span><span class="p" data-group-id="8336343980-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8336343980-2">[</span><span class="ss">:digits_ordinal</span><span class="p" data-group-id="8336343980-2">]</span><span class="w">
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="9753870900-1">(</span><span class="ss">:en</span><span class="p" data-group-id="9753870900-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9753870900-2">[</span><span class="ss">:digits_ordinal</span><span class="p" data-group-id="9753870900-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="8336343980-3">(</span><span class="s">"fr"</span><span class="p" data-group-id="8336343980-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="8336343980-4">(</span><span class="p" data-group-id="8336343980-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8336343980-5">[</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="9753870900-3">(</span><span class="s">"fr"</span><span class="p" data-group-id="9753870900-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="9753870900-4">(</span><span class="p" data-group-id="9753870900-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9753870900-5">[</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal_feminine</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal_feminine_plural</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal_masculine</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal_masculine_plural</span><span class="w">
|
||||
</span><span class="p" data-group-id="8336343980-5">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">digits_ordinal</span><span class="p" data-group-id="1432466265-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p" data-group-id="1432466265-1">)</span><span class="w">
|
||||
</span><span class="s">"123rd"</span></code></pre><p>This call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="2387374117-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:ordinal</span><span class="p" data-group-id="2387374117-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2387374117-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"123rd"</span><span class="p" data-group-id="2387374117-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="9753870900-5">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">digits_ordinal</span><span class="p" data-group-id="6578409370-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p" data-group-id="6578409370-1">)</span><span class="w">
|
||||
</span><span class="s">"123rd"</span></code></pre><p>This call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="9241078445-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:ordinal</span><span class="p" data-group-id="9241078445-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9241078445-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"123rd"</span><span class="p" data-group-id="9241078445-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -116,9 +116,9 @@ Plausible
|
||||
<section id="moduledoc">
|
||||
<p>Functions to implement the spellout rule-based-number-format rules of CLDR.</p><p>As CLDR notes, the data is incomplete or non-existent for many languages. It
|
||||
is considered complete for English however.</p><p>The standard public API for RBNF is via the <a href="https://hexdocs.pm/ex_cldr_numbers/2.31.3/Cldr.Number.html#to_string/2"><code class="inline">Cldr.Number.to_string/2</code></a> function.</p><p>The functions on this module are defined at compile time based upon the RBNF rules
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Spellout</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="2413601247-1">(</span><span class="s">"en"</span><span class="p" data-group-id="2413601247-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="2413601247-2">(</span><span class="p" data-group-id="2413601247-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2413601247-3">[</span><span class="w">
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Spellout</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="5290767258-1">(</span><span class="s">"en"</span><span class="p" data-group-id="5290767258-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="5290767258-2">(</span><span class="p" data-group-id="5290767258-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5290767258-3">[</span><span class="w">
|
||||
</span><span class="ss">:spellout_cardinal</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:spellout_cardinal_verbose</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:spellout_numbering</span><span class="p">,</span><span class="w">
|
||||
@ -126,9 +126,9 @@ defined in the Unicode CLDR data repository. Available rules are identified by:
|
||||
</span><span class="ss">:spellout_numbering_year</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:spellout_ordinal</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:spellout_ordinal_verbose</span><span class="w">
|
||||
</span><span class="p" data-group-id="2413601247-3">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Spellout</span><span class="o">.</span><span class="n">spellout_ordinal</span><span class="p" data-group-id="1812320386-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="1812320386-1">)</span><span class="w">
|
||||
</span><span class="s">"one hundred twenty-third"</span></code></pre><p>This call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="5498291376-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout</span><span class="p" data-group-id="5498291376-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5498291376-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one hundred twenty-three"</span><span class="p" data-group-id="5498291376-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5290767258-3">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Spellout</span><span class="o">.</span><span class="n">spellout_ordinal</span><span class="p" data-group-id="5262470599-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="5262470599-1">)</span><span class="w">
|
||||
</span><span class="s">"one hundred twenty-third"</span></code></pre><p>This call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="3654433582-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout</span><span class="p" data-group-id="3654433582-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3654433582-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one hundred twenty-three"</span><span class="p" data-group-id="3654433582-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -518,24 +518,24 @@ Functions
|
||||
Example
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_locale</span><span class="p" data-group-id="4382714513-1">(</span><span class="p" data-group-id="4382714513-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4382714513-2">%</span><span class="nc" data-group-id="4382714513-2">Cldr.LanguageTag</span><span class="p" data-group-id="4382714513-2">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_locale</span><span class="p" data-group-id="3685165222-1">(</span><span class="p" data-group-id="3685165222-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3685165222-2">%</span><span class="nc" data-group-id="3685165222-2">Cldr.LanguageTag</span><span class="p" data-group-id="3685165222-2">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4382714513-3">[</span><span class="p" data-group-id="4382714513-3">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4382714513-4">%{</span><span class="p" data-group-id="4382714513-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3685165222-3">[</span><span class="p" data-group-id="3685165222-3">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3685165222-4">%{</span><span class="p" data-group-id="3685165222-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4382714513-5">%{</span><span class="p" data-group-id="4382714513-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4382714513-6">[</span><span class="p" data-group-id="4382714513-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3685165222-5">%{</span><span class="p" data-group-id="3685165222-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3685165222-6">[</span><span class="p" data-group-id="3685165222-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:"001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4382714513-7">%{</span><span class="p" data-group-id="4382714513-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4382714513-8">[</span><span class="p" data-group-id="4382714513-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4382714513-2">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3685165222-7">%{</span><span class="p" data-group-id="3685165222-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3685165222-8">[</span><span class="p" data-group-id="3685165222-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3685165222-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_territory/0">
|
||||
@ -570,7 +570,7 @@ does not specify one and none can be inferred.</p><h2 id="default_territory/0-ex
|
||||
Example
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_territory</span><span class="p" data-group-id="8655491471-1">(</span><span class="p" data-group-id="8655491471-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_territory</span><span class="p" data-group-id="6094988801-1">(</span><span class="p" data-group-id="6094988801-1">)</span><span class="w">
|
||||
</span><span class="ss">:"001"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -633,13 +633,13 @@ is inserted between words or sentences. The valid options are
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="w"> </span><span class="s">"And furthermore"</span><span class="w">
|
||||
</span><span class="s">"And furthermore…"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="w"> </span><span class="p" data-group-id="9907039930-1">[</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="s">"there is much to be done"</span><span class="p" data-group-id="9907039930-1">]</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="w"> </span><span class="p" data-group-id="2169167196-1">[</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="s">"there is much to be done"</span><span class="p" data-group-id="2169167196-1">]</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="w">
|
||||
</span><span class="s">"And furthermore…there is much to be done"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="w"> </span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:word</span><span class="w">
|
||||
</span><span class="s">"And furthermore …"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="w"> </span><span class="p" data-group-id="9907039930-2">[</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="s">"there is much to be done"</span><span class="p" data-group-id="9907039930-2">]</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:word</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="w"> </span><span class="p" data-group-id="2169167196-2">[</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="s">"there is much to be done"</span><span class="p" data-group-id="2169167196-2">]</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:word</span><span class="w">
|
||||
</span><span class="s">"And furthermore … there is much to be done"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -675,23 +675,23 @@ take an optional locale parameter for which a locale is not supplied.</p><h2 id=
|
||||
Example
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="5109823424-1">(</span><span class="s">"pl"</span><span class="p" data-group-id="5109823424-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="5589664248-1">(</span><span class="s">"pl"</span><span class="p" data-group-id="5589664248-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">get_locale</span><span class="w">
|
||||
</span><span class="p" data-group-id="5109823424-2">%</span><span class="nc" data-group-id="5109823424-2">Cldr.LanguageTag</span><span class="p" data-group-id="5109823424-2">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5589664248-2">%</span><span class="nc" data-group-id="5589664248-2">Cldr.LanguageTag</span><span class="p" data-group-id="5589664248-2">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Elixir.Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"pl"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:pl</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5109823424-3">%{</span><span class="p" data-group-id="5109823424-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5589664248-3">%{</span><span class="p" data-group-id="5589664248-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"pl"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5109823424-4">%{</span><span class="p" data-group-id="5109823424-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5109823424-5">[</span><span class="p" data-group-id="5109823424-5">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5589664248-4">%{</span><span class="p" data-group-id="5589664248-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5589664248-5">[</span><span class="p" data-group-id="5589664248-5">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:pl</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:PL</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"pl"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5109823424-6">%{</span><span class="p" data-group-id="5109823424-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5109823424-7">[</span><span class="p" data-group-id="5109823424-7">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5109823424-2">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5589664248-6">%{</span><span class="p" data-group-id="5589664248-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5589664248-7">[</span><span class="p" data-group-id="5589664248-7">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5589664248-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_calendars/0">
|
||||
@ -824,10 +824,10 @@ name is configured and available in Gettext.</p><h2 id="known_gettext_locale_nam
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name?</span><span class="p" data-group-id="3794643476-1">(</span><span class="s">"en"</span><span class="p" data-group-id="3794643476-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name?</span><span class="p" data-group-id="4868259310-1">(</span><span class="s">"en"</span><span class="p" data-group-id="4868259310-1">)</span><span class="w">
|
||||
</span><span class="no">true</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name?</span><span class="p" data-group-id="3794643476-2">(</span><span class="s">"!!"</span><span class="p" data-group-id="3794643476-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name?</span><span class="p" data-group-id="4868259310-2">(</span><span class="s">"!!"</span><span class="p" data-group-id="4868259310-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -946,10 +946,10 @@ name is configured and available in Cldr.</p><h2 id="known_locale_name?/1-argume
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name?</span><span class="p" data-group-id="2109698499-1">(</span><span class="ss">:en</span><span class="p" data-group-id="2109698499-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name?</span><span class="p" data-group-id="1447024199-1">(</span><span class="ss">:en</span><span class="p" data-group-id="1447024199-1">)</span><span class="w">
|
||||
</span><span class="no">true</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name?</span><span class="p" data-group-id="2109698499-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="2109698499-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name?</span><span class="p" data-group-id="1447024199-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="1447024199-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1004,7 +1004,7 @@ in this module or in <a href="https://hexdocs.pm/gettext/0.22.3/Gettext.html"><c
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_number_system_types</span><span class="w">
|
||||
</span><span class="p" data-group-id="3596279127-1">[</span><span class="ss">:default</span><span class="p">,</span><span class="w"> </span><span class="ss">:finance</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="p" data-group-id="3596279127-1">]</span></code></pre>
|
||||
</span><span class="p" data-group-id="8792588529-1">[</span><span class="ss">:default</span><span class="p">,</span><span class="w"> </span><span class="ss">:finance</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="p" data-group-id="8792588529-1">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_number_systems/0">
|
||||
@ -1115,10 +1115,10 @@ rules based number formats (RBNF).</p><h2 id="known_rbnf_locale_name?/1-argument
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name?</span><span class="p" data-group-id="8646169906-1">(</span><span class="ss">:en</span><span class="p" data-group-id="8646169906-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name?</span><span class="p" data-group-id="6983476281-1">(</span><span class="ss">:en</span><span class="p" data-group-id="6983476281-1">)</span><span class="w">
|
||||
</span><span class="no">true</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name?</span><span class="p" data-group-id="8646169906-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="8646169906-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name?</span><span class="p" data-group-id="6983476281-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="6983476281-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1239,29 +1239,29 @@ of a language tag.</p><h2 id="put_locale/1-examples" class="section-heading">
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="3355884170-1">(</span><span class="s">"en"</span><span class="p" data-group-id="3355884170-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3355884170-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3355884170-3">%</span><span class="nc" data-group-id="3355884170-3">Cldr.LanguageTag</span><span class="p" data-group-id="3355884170-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="2369176184-1">(</span><span class="s">"en"</span><span class="p" data-group-id="2369176184-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2369176184-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2369176184-3">%</span><span class="nc" data-group-id="2369176184-3">Cldr.LanguageTag</span><span class="p" data-group-id="2369176184-3">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3355884170-4">[</span><span class="p" data-group-id="3355884170-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3355884170-5">%{</span><span class="p" data-group-id="3355884170-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2369176184-4">[</span><span class="p" data-group-id="2369176184-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2369176184-5">%{</span><span class="p" data-group-id="2369176184-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3355884170-6">%{</span><span class="p" data-group-id="3355884170-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3355884170-7">[</span><span class="p" data-group-id="3355884170-7">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2369176184-6">%{</span><span class="p" data-group-id="2369176184-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2369176184-7">[</span><span class="p" data-group-id="2369176184-7">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:US</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3355884170-8">%{</span><span class="p" data-group-id="3355884170-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3355884170-9">[</span><span class="p" data-group-id="3355884170-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3355884170-3">}</span><span class="p" data-group-id="3355884170-2">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2369176184-8">%{</span><span class="p" data-group-id="2369176184-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2369176184-9">[</span><span class="p" data-group-id="2369176184-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2369176184-3">}</span><span class="p" data-group-id="2369176184-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="3355884170-10">(</span><span class="s">"invalid-locale!"</span><span class="p" data-group-id="3355884170-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3355884170-11">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3355884170-12">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">!</span><span class="se">\"</span><span class="s"> starting at position 15"</span><span class="p" data-group-id="3355884170-12">}</span><span class="p" data-group-id="3355884170-11">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="2369176184-10">(</span><span class="s">"invalid-locale!"</span><span class="p" data-group-id="2369176184-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2369176184-11">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2369176184-12">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">!</span><span class="se">\"</span><span class="s"> starting at position 15"</span><span class="p" data-group-id="2369176184-12">}</span><span class="p" data-group-id="2369176184-11">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="quote/2">
|
||||
@ -1444,47 +1444,47 @@ of a language tag.</p><h2 id="validate_locale/1-examples" class="section-heading
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="3986313459-1">(</span><span class="ss">:en</span><span class="p" data-group-id="3986313459-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3986313459-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3986313459-3">%</span><span class="nc" data-group-id="3986313459-3">Cldr.LanguageTag</span><span class="p" data-group-id="3986313459-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="3267356857-1">(</span><span class="ss">:en</span><span class="p" data-group-id="3267356857-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3267356857-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3267356857-3">%</span><span class="nc" data-group-id="3267356857-3">Cldr.LanguageTag</span><span class="p" data-group-id="3267356857-3">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-4">%{</span><span class="p" data-group-id="3986313459-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-4">%{</span><span class="p" data-group-id="3267356857-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-5">%{</span><span class="p" data-group-id="3986313459-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-6">[</span><span class="p" data-group-id="3986313459-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-5">%{</span><span class="p" data-group-id="3267356857-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-6">[</span><span class="p" data-group-id="3267356857-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:US</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-7">%{</span><span class="p" data-group-id="3986313459-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-8">[</span><span class="p" data-group-id="3986313459-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3986313459-3">}</span><span class="p" data-group-id="3986313459-2">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-7">%{</span><span class="p" data-group-id="3267356857-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-8">[</span><span class="p" data-group-id="3267356857-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3267356857-3">}</span><span class="p" data-group-id="3267356857-2">}</span><span class="w">
|
||||
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_locale</span><span class="p" data-group-id="3986313459-9">(</span><span class="p" data-group-id="3986313459-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3986313459-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3986313459-11">%</span><span class="nc" data-group-id="3986313459-11">Cldr.LanguageTag</span><span class="p" data-group-id="3986313459-11">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_locale</span><span class="p" data-group-id="3267356857-9">(</span><span class="p" data-group-id="3267356857-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3267356857-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3267356857-11">%</span><span class="nc" data-group-id="3267356857-11">Cldr.LanguageTag</span><span class="p" data-group-id="3267356857-11">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-12">%{</span><span class="p" data-group-id="3986313459-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-12">%{</span><span class="p" data-group-id="3267356857-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-13">%{</span><span class="p" data-group-id="3986313459-13">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-14">[</span><span class="p" data-group-id="3986313459-14">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-13">%{</span><span class="p" data-group-id="3267356857-13">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-14">[</span><span class="p" data-group-id="3267356857-14">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:"001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-15">%{</span><span class="p" data-group-id="3986313459-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3986313459-16">[</span><span class="p" data-group-id="3986313459-16">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3986313459-11">}</span><span class="p" data-group-id="3986313459-10">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-15">%{</span><span class="p" data-group-id="3267356857-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3267356857-16">[</span><span class="p" data-group-id="3267356857-16">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3267356857-11">}</span><span class="p" data-group-id="3267356857-10">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="3986313459-17">(</span><span class="s">"zzz"</span><span class="p" data-group-id="3986313459-17">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3986313459-18">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3986313459-19">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zzz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="3986313459-19">}</span><span class="p" data-group-id="3986313459-18">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="3267356857-17">(</span><span class="s">"zzz"</span><span class="p" data-group-id="3267356857-17">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3267356857-18">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3267356857-19">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zzz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="3267356857-19">}</span><span class="p" data-group-id="3267356857-18">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="validate_number_system/1">
|
||||
@ -1555,22 +1555,22 @@ of a language tag.</p><h2 id="validate_locale/1-examples" class="section-heading
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="w"> </span><span class="ss">:default</span><span class="w">
|
||||
</span><span class="p" data-group-id="0844958071-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="0844958071-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2740375896-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="2740375896-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="w"> </span><span class="ss">:traditional</span><span class="w">
|
||||
</span><span class="p" data-group-id="0844958071-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="p" data-group-id="0844958071-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2740375896-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="p" data-group-id="2740375896-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="w"> </span><span class="ss">:latn</span><span class="w">
|
||||
</span><span class="p" data-group-id="0844958071-3">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="2740375896-3">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0844958071-4">{</span><span class="nc">Cldr.UnknownNumberSystemTypeError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system type :latn is unknown"</span><span class="p" data-group-id="0844958071-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0844958071-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2740375896-4">{</span><span class="nc">Cldr.UnknownNumberSystemTypeError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system type :latn is unknown"</span><span class="p" data-group-id="2740375896-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2740375896-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="w"> </span><span class="s">"bork"</span><span class="w">
|
||||
</span><span class="p" data-group-id="0844958071-5">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="2740375896-5">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0844958071-6">{</span><span class="nc">Cldr.UnknownNumberSystemTypeError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system type </span><span class="se">\"</span><span class="s">bork</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="0844958071-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0844958071-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="2740375896-6">{</span><span class="nc">Cldr.UnknownNumberSystemTypeError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system type </span><span class="se">\"</span><span class="s">bork</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="2740375896-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2740375896-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="validate_territory/1">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -816,23 +816,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <code class="inline">insert_all/2</code> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="1004709803-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="1004709803-1">)</span><span class="w">
|
||||
<p>Similar to <code class="inline">insert_all/2</code> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="3960321341-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="3960321341-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="1004709803-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="3960321341-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="1004709803-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="3960321341-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="1004709803-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="1004709803-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="3960321341-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="3960321341-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="1004709803-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="1004709803-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="1004709803-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="1004709803-7">(</span><span class="n">i</span><span class="p" data-group-id="1004709803-7">)</span><span class="p" data-group-id="1004709803-6">}</span><span class="w"> </span><span class="k" data-group-id="1004709803-5">end</span><span class="p" data-group-id="1004709803-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1004709803-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="1004709803-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="1004709803-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="1004709803-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="3960321341-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="3960321341-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="3960321341-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="3960321341-7">(</span><span class="n">i</span><span class="p" data-group-id="3960321341-7">)</span><span class="p" data-group-id="3960321341-6">}</span><span class="w"> </span><span class="k" data-group-id="3960321341-5">end</span><span class="p" data-group-id="3960321341-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3960321341-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="3960321341-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="3960321341-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="3960321341-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="1004709803-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="1004709803-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="1004709803-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1004709803-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="1004709803-13">(</span><span class="p" data-group-id="1004709803-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="1004709803-12">]</span><span class="p" data-group-id="1004709803-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="3960321341-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="3960321341-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="3960321341-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3960321341-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="3960321341-13">(</span><span class="p" data-group-id="3960321341-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="3960321341-12">]</span><span class="p" data-group-id="3960321341-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -1123,23 +1123,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="7428149135-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="7428149135-1">)</span><span class="w">
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="5091419166-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="5091419166-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="7428149135-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="5091419166-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="7428149135-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="5091419166-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="7428149135-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="7428149135-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5091419166-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5091419166-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="7428149135-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="7428149135-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="7428149135-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="7428149135-7">(</span><span class="n">i</span><span class="p" data-group-id="7428149135-7">)</span><span class="p" data-group-id="7428149135-6">}</span><span class="w"> </span><span class="k" data-group-id="7428149135-5">end</span><span class="p" data-group-id="7428149135-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7428149135-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="7428149135-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="7428149135-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="7428149135-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="5091419166-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="5091419166-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="5091419166-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="5091419166-7">(</span><span class="n">i</span><span class="p" data-group-id="5091419166-7">)</span><span class="p" data-group-id="5091419166-6">}</span><span class="w"> </span><span class="k" data-group-id="5091419166-5">end</span><span class="p" data-group-id="5091419166-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5091419166-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5091419166-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="5091419166-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="5091419166-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="7428149135-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="7428149135-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="7428149135-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7428149135-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="7428149135-13">(</span><span class="p" data-group-id="7428149135-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="7428149135-12">]</span><span class="p" data-group-id="7428149135-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="5091419166-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5091419166-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="5091419166-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5091419166-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="5091419166-13">(</span><span class="p" data-group-id="5091419166-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="5091419166-12">]</span><span class="p" data-group-id="5091419166-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -231,8 +231,8 @@ Functions
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<p> In the case of a DB-IP database:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">database_type</span><span class="p" data-group-id="3788357391-1">(</span><span class="p" data-group-id="3788357391-1">)</span><span class="w">
|
||||
</span><span class="s">"DBIP-City-Lite"</span></code></pre><p> In the case of a MaxMind database:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">database_type</span><span class="p" data-group-id="2646238037-1">(</span><span class="p" data-group-id="2646238037-1">)</span><span class="w">
|
||||
<p> In the case of a DB-IP database:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">database_type</span><span class="p" data-group-id="6428902965-1">(</span><span class="p" data-group-id="6428902965-1">)</span><span class="w">
|
||||
</span><span class="s">"DBIP-City-Lite"</span></code></pre><p> In the case of a MaxMind database:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">database_type</span><span class="p" data-group-id="4024095346-1">(</span><span class="p" data-group-id="4024095346-1">)</span><span class="w">
|
||||
</span><span class="s">"GeoLite2-City"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -272,8 +272,8 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<p> Loading from a local file:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">load_db</span><span class="p" data-group-id="8523798156-1">(</span><span class="ss">path</span><span class="p">:</span><span class="w"> </span><span class="s">"/etc/plausible/dbip-city.mmdb"</span><span class="p" data-group-id="8523798156-1">)</span><span class="w">
|
||||
</span><span class="ss">:ok</span></code></pre><p> Downloading a MaxMind DB (this license key is no longer active):</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">load_db</span><span class="p" data-group-id="9455307051-1">(</span><span class="ss">license_key</span><span class="p">:</span><span class="w"> </span><span class="s">"LNpsJCCKPis6XvBP"</span><span class="p">,</span><span class="w"> </span><span class="ss">edition</span><span class="p">:</span><span class="w"> </span><span class="s">"GeoLite2-City"</span><span class="p">,</span><span class="w"> </span><span class="ss">async</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p" data-group-id="9455307051-1">)</span><span class="w">
|
||||
<p> Loading from a local file:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">load_db</span><span class="p" data-group-id="4773977817-1">(</span><span class="ss">path</span><span class="p">:</span><span class="w"> </span><span class="s">"/etc/plausible/dbip-city.mmdb"</span><span class="p" data-group-id="4773977817-1">)</span><span class="w">
|
||||
</span><span class="ss">:ok</span></code></pre><p> Downloading a MaxMind DB (this license key is no longer active):</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">load_db</span><span class="p" data-group-id="8459524860-1">(</span><span class="ss">license_key</span><span class="p">:</span><span class="w"> </span><span class="s">"LNpsJCCKPis6XvBP"</span><span class="p">,</span><span class="w"> </span><span class="ss">edition</span><span class="p">:</span><span class="w"> </span><span class="s">"GeoLite2-City"</span><span class="p">,</span><span class="w"> </span><span class="ss">async</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p" data-group-id="8459524860-1">)</span><span class="w">
|
||||
</span><span class="ss">:ok</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -302,21 +302,21 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
Examples
|
||||
</a>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">lookup</span><span class="p" data-group-id="6712625641-1">(</span><span class="s">"8.7.6.5"</span><span class="p" data-group-id="6712625641-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-2">%{</span><span class="w">
|
||||
</span><span class="s">"city"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-3">%{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">lookup</span><span class="p" data-group-id="3863253407-1">(</span><span class="s">"8.7.6.5"</span><span class="p" data-group-id="3863253407-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-2">%{</span><span class="w">
|
||||
</span><span class="s">"city"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-3">%{</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">5349755</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-4">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-4">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Fontana"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Fontana"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ja"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"フォンタナ"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Фонтана"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"continent"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-5">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"continent"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-5">%{</span><span class="w">
|
||||
</span><span class="s">"code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"NA"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">6255149</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-6">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-6">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Nordamerika"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"North America"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"es"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Norteamérica"</span><span class="p">,</span><span class="w">
|
||||
@ -325,12 +325,12 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</span><span class="s">"pt-BR"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"América do Norte"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Северная Америка"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"zh-CN"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"北美洲"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"country"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-7">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"country"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-7">%{</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">6252001</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"iso_code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"US"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-8">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-8">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Vereinigte Staaten"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"United States"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"es"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Estados Unidos"</span><span class="p">,</span><span class="w">
|
||||
@ -339,20 +339,20 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</span><span class="s">"pt-BR"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"EUA"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"США"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"zh-CN"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"美国"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"location"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-9">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"location"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-9">%{</span><span class="w">
|
||||
</span><span class="s">"accuracy_radius"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">50</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"latitude"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mf">34.1211</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"longitude"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="o">-</span><span class="mf">117.4362</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"metro_code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">803</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"time_zone"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"America/Los_Angeles"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-9">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"postal"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-10">%{</span><span class="s">"code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"92336"</span><span class="p" data-group-id="6712625641-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"registered_country"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-11">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-9">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"postal"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-10">%{</span><span class="s">"code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"92336"</span><span class="p" data-group-id="3863253407-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"registered_country"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-11">%{</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">6252001</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"iso_code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"US"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-12">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-12">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Vereinigte Staaten"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"United States"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"es"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Estados Unidos"</span><span class="p">,</span><span class="w">
|
||||
@ -361,13 +361,13 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</span><span class="s">"pt-BR"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"EUA"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"США"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"zh-CN"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"美国"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-11">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"subdivisions"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-13">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-14">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-11">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"subdivisions"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-13">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-14">%{</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">5332921</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"iso_code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"CA"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6712625641-15">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3863253407-15">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Kalifornien"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"California"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"es"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"California"</span><span class="p">,</span><span class="w">
|
||||
@ -376,10 +376,10 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</span><span class="s">"pt-BR"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Califórnia"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Калифорния"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"zh-CN"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"加州"</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-13">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6712625641-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="3863253407-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-13">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863253407-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -1114,23 +1114,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="5578943493-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="5578943493-1">)</span><span class="w">
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="4263191316-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="4263191316-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="5578943493-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="4263191316-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="5578943493-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="4263191316-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="5578943493-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5578943493-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="4263191316-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="4263191316-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="5578943493-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="5578943493-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="5578943493-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="5578943493-7">(</span><span class="n">i</span><span class="p" data-group-id="5578943493-7">)</span><span class="p" data-group-id="5578943493-6">}</span><span class="w"> </span><span class="k" data-group-id="5578943493-5">end</span><span class="p" data-group-id="5578943493-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5578943493-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5578943493-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="5578943493-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="5578943493-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="4263191316-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="4263191316-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="4263191316-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="4263191316-7">(</span><span class="n">i</span><span class="p" data-group-id="4263191316-7">)</span><span class="p" data-group-id="4263191316-6">}</span><span class="w"> </span><span class="k" data-group-id="4263191316-5">end</span><span class="p" data-group-id="4263191316-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4263191316-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="4263191316-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="4263191316-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="4263191316-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="5578943493-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5578943493-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="5578943493-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5578943493-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="5578943493-13">(</span><span class="p" data-group-id="5578943493-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="5578943493-12">]</span><span class="p" data-group-id="5578943493-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="4263191316-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="4263191316-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="4263191316-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4263191316-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="4263191316-13">(</span><span class="p" data-group-id="4263191316-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="4263191316-12">]</span><span class="p" data-group-id="4263191316-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -1114,23 +1114,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="5555262965-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="5555262965-1">)</span><span class="w">
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="4205341820-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="4205341820-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="5555262965-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="4205341820-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="5555262965-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="4205341820-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="5555262965-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5555262965-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="4205341820-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="4205341820-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="5555262965-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="5555262965-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="5555262965-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="5555262965-7">(</span><span class="n">i</span><span class="p" data-group-id="5555262965-7">)</span><span class="p" data-group-id="5555262965-6">}</span><span class="w"> </span><span class="k" data-group-id="5555262965-5">end</span><span class="p" data-group-id="5555262965-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5555262965-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5555262965-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="5555262965-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="5555262965-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="4205341820-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="4205341820-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="4205341820-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="4205341820-7">(</span><span class="n">i</span><span class="p" data-group-id="4205341820-7">)</span><span class="p" data-group-id="4205341820-6">}</span><span class="w"> </span><span class="k" data-group-id="4205341820-5">end</span><span class="p" data-group-id="4205341820-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4205341820-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="4205341820-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="4205341820-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="4205341820-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="5555262965-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5555262965-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="5555262965-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5555262965-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="5555262965-13">(</span><span class="p" data-group-id="5555262965-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="5555262965-12">]</span><span class="p" data-group-id="5555262965-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="4205341820-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="4205341820-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="4205341820-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4205341820-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="4205341820-13">(</span><span class="p" data-group-id="4205341820-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="4205341820-12">]</span><span class="p" data-group-id="4205341820-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
|
||||
<script src="dist/sidebar_items-CBF5BFFF.js"></script>
|
||||
<script src="dist/sidebar_items-76FA772C.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user