mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 20:13:31 +03:00
deploy: 4ec86abeac
This commit is contained in:
parent
cf7ab57020
commit
4d89ed8992
@ -1143,23 +1143,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="2358736556-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="2358736556-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="5000042299-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="5000042299-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="2358736556-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="5000042299-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="2358736556-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="5000042299-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="2358736556-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="2358736556-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5000042299-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5000042299-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="2358736556-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="2358736556-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="2358736556-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="2358736556-7">(</span><span class="n">i</span><span class="p" data-group-id="2358736556-7">)</span><span class="p" data-group-id="2358736556-6">}</span><span class="w"> </span><span class="k" data-group-id="2358736556-5">end</span><span class="p" data-group-id="2358736556-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2358736556-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="2358736556-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="2358736556-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="2358736556-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="5000042299-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="5000042299-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="5000042299-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="5000042299-7">(</span><span class="n">i</span><span class="p" data-group-id="5000042299-7">)</span><span class="p" data-group-id="5000042299-6">}</span><span class="w"> </span><span class="k" data-group-id="5000042299-5">end</span><span class="p" data-group-id="5000042299-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5000042299-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="5000042299-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="5000042299-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="5000042299-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="2358736556-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="2358736556-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="2358736556-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="2358736556-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="2358736556-13">(</span><span class="p" data-group-id="2358736556-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="2358736556-12">]</span><span class="p" data-group-id="2358736556-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="5000042299-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="5000042299-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="5000042299-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="5000042299-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="5000042299-13">(</span><span class="p" data-group-id="5000042299-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="5000042299-12">]</span><span class="p" data-group-id="5000042299-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -727,12 +727,12 @@ this user owns + StatsAPI if the user has a configured Stats API key.</p><p>Give
|
||||
|
||||
<p>Queries the ClickHouse database for the monthly pageview usage. If the given user's
|
||||
subscription is <code class="inline">active</code>, <code class="inline">past_due</code>, or a <code class="inline">deleted</code> (but not yet expired), a map
|
||||
with the following structure is returned:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="9849483120-1">%{</span><span class="w">
|
||||
</span><span class="ss">current_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="9849483120-2">(</span><span class="p" data-group-id="9849483120-2">)</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">last_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="9849483120-3">(</span><span class="p" data-group-id="9849483120-3">)</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">penultimate_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="9849483120-4">(</span><span class="p" data-group-id="9849483120-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9849483120-1">}</span></code></pre><p>In all other cases of the subscription status (or a <code class="inline">free_10k</code> subscription which
|
||||
does not have a <code class="inline">last_bill_date</code> defined) - the following structure is returned:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="9546775781-1">%{</span><span class="ss">last_30_days</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="9546775781-2">(</span><span class="p" data-group-id="9546775781-2">)</span><span class="p" data-group-id="9546775781-1">}</span></code></pre><p>Given only a user as input, the usage is queried from across all the sites that the
|
||||
with the following structure is returned:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="9351672537-1">%{</span><span class="w">
|
||||
</span><span class="ss">current_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="9351672537-2">(</span><span class="p" data-group-id="9351672537-2">)</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">last_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="9351672537-3">(</span><span class="p" data-group-id="9351672537-3">)</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">penultimate_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="9351672537-4">(</span><span class="p" data-group-id="9351672537-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9351672537-1">}</span></code></pre><p>In all other cases of the subscription status (or a <code class="inline">free_10k</code> subscription which
|
||||
does not have a <code class="inline">last_bill_date</code> defined) - the following structure is returned:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="7822750525-1">%{</span><span class="ss">last_30_days</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="7822750525-2">(</span><span class="p" data-group-id="7822750525-2">)</span><span class="p" data-group-id="7822750525-1">}</span></code></pre><p>Given only a user as input, the usage is queried from across all the sites that the
|
||||
user owns. Alternatively, given an optional argument of <code class="inline">site_ids</code>, the usage from
|
||||
across all those sites is queried instead.</p>
|
||||
</section>
|
||||
|
@ -148,7 +148,7 @@ Pages
|
||||
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.5/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="3635229650-1">(</span><span class="w"> </span><span class="p" data-group-id="3635229650-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="3635229650-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="3635229650-3">)</span><span class="w"> </span><span class="p" data-group-id="3635229650-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="3635229650-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="2101023463-1">(</span><span class="w"> </span><span class="p" data-group-id="2101023463-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="2101023463-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="2101023463-3">)</span><span class="w"> </span><span class="p" data-group-id="2101023463-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="2101023463-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>
|
||||
@ -261,54 +261,54 @@ a configured <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.html"><code class="
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="2563317891-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="2563317891-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-3">%</span><span class="nc" data-group-id="2563317891-3">Cldr.LanguageTag</span><span class="p" data-group-id="2563317891-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="4101500306-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="4101500306-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-3">%</span><span class="nc" data-group-id="4101500306-3">Cldr.LanguageTag</span><span class="p" data-group-id="4101500306-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="2563317891-4">[</span><span class="p" data-group-id="2563317891-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="2563317891-5">%{</span><span class="p" data-group-id="2563317891-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="4101500306-4">[</span><span class="p" data-group-id="4101500306-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="4101500306-5">%{</span><span class="p" data-group-id="4101500306-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="2563317891-6">%{</span><span class="p" data-group-id="2563317891-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="2563317891-7">[</span><span class="p" data-group-id="2563317891-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="4101500306-6">%{</span><span class="p" data-group-id="4101500306-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="4101500306-7">[</span><span class="p" data-group-id="4101500306-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="2563317891-8">%{</span><span class="p" data-group-id="2563317891-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="2563317891-9">[</span><span class="p" data-group-id="2563317891-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-3">}</span><span class="p" data-group-id="2563317891-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="4101500306-8">%{</span><span class="p" data-group-id="4101500306-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="4101500306-9">[</span><span class="p" data-group-id="4101500306-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-3">}</span><span class="p" data-group-id="4101500306-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="2563317891-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="2563317891-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-12">%</span><span class="nc" data-group-id="2563317891-12">Cldr.LanguageTag</span><span class="p" data-group-id="2563317891-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="4101500306-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="4101500306-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-12">%</span><span class="nc" data-group-id="4101500306-12">Cldr.LanguageTag</span><span class="p" data-group-id="4101500306-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="2563317891-13">[</span><span class="p" data-group-id="2563317891-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="2563317891-14">%{</span><span class="p" data-group-id="2563317891-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="4101500306-13">[</span><span class="p" data-group-id="4101500306-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="4101500306-14">%{</span><span class="p" data-group-id="4101500306-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="2563317891-15">%{</span><span class="p" data-group-id="2563317891-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="2563317891-16">[</span><span class="p" data-group-id="2563317891-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="4101500306-15">%{</span><span class="p" data-group-id="4101500306-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="4101500306-16">[</span><span class="p" data-group-id="4101500306-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="2563317891-17">%{</span><span class="p" data-group-id="2563317891-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="2563317891-18">[</span><span class="p" data-group-id="2563317891-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-12">}</span><span class="p" data-group-id="2563317891-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="4101500306-17">%{</span><span class="p" data-group-id="4101500306-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="4101500306-18">[</span><span class="p" data-group-id="4101500306-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-12">}</span><span class="p" data-group-id="4101500306-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="2563317891-19">(</span><span class="s">"xx,yy;q=0.3"</span><span class="p" data-group-id="2563317891-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-20">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-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="2563317891-21">}</span><span class="p" data-group-id="2563317891-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="4101500306-19">(</span><span class="s">"xx,yy;q=0.3"</span><span class="p" data-group-id="4101500306-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-20">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-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="4101500306-21">}</span><span class="p" data-group-id="4101500306-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="2563317891-22">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="2563317891-22">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2563317891-23">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2563317891-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="2563317891-24">}</span><span class="p" data-group-id="2563317891-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="4101500306-22">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="4101500306-22">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4101500306-23">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101500306-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="4101500306-24">}</span><span class="p" data-group-id="4101500306-23">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="parse/1">
|
||||
@ -369,95 +369,95 @@ wuth an error tuple for each invalid tag added at the end of the list.</p><h2 id
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="0923542995-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="0923542995-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-3">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-4">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-5">%</span><span class="nc" data-group-id="0923542995-5">Cldr.LanguageTag</span><span class="p" data-group-id="0923542995-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="9645544871-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="9645544871-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-3">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-4">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-5">%</span><span class="nc" data-group-id="9645544871-5">Cldr.LanguageTag</span><span class="p" data-group-id="9645544871-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="0923542995-6">[</span><span class="p" data-group-id="0923542995-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="0923542995-7">%{</span><span class="p" data-group-id="0923542995-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="9645544871-6">[</span><span class="p" data-group-id="9645544871-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="9645544871-7">%{</span><span class="p" data-group-id="9645544871-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="0923542995-8">%{</span><span class="p" data-group-id="0923542995-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="0923542995-9">[</span><span class="p" data-group-id="0923542995-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="9645544871-8">%{</span><span class="p" data-group-id="9645544871-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="9645544871-9">[</span><span class="p" data-group-id="9645544871-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="0923542995-10">%{</span><span class="p" data-group-id="0923542995-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="0923542995-11">[</span><span class="p" data-group-id="0923542995-11">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-5">}</span><span class="p" data-group-id="0923542995-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-12">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-13">%</span><span class="nc" data-group-id="0923542995-13">Cldr.LanguageTag</span><span class="p" data-group-id="0923542995-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="9645544871-10">%{</span><span class="p" data-group-id="9645544871-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="9645544871-11">[</span><span class="p" data-group-id="9645544871-11">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-5">}</span><span class="p" data-group-id="9645544871-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-12">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-13">%</span><span class="nc" data-group-id="9645544871-13">Cldr.LanguageTag</span><span class="p" data-group-id="9645544871-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="0923542995-14">[</span><span class="p" data-group-id="0923542995-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="0923542995-15">%{</span><span class="p" data-group-id="0923542995-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="9645544871-14">[</span><span class="p" data-group-id="9645544871-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="9645544871-15">%{</span><span class="p" data-group-id="9645544871-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="0923542995-16">%{</span><span class="p" data-group-id="0923542995-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="0923542995-17">[</span><span class="p" data-group-id="0923542995-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="9645544871-16">%{</span><span class="p" data-group-id="9645544871-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="9645544871-17">[</span><span class="p" data-group-id="9645544871-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="0923542995-18">%{</span><span class="p" data-group-id="0923542995-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="0923542995-19">[</span><span class="p" data-group-id="0923542995-19">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-13">}</span><span class="p" data-group-id="0923542995-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-3">]</span><span class="p" data-group-id="0923542995-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="9645544871-18">%{</span><span class="p" data-group-id="9645544871-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="9645544871-19">[</span><span class="p" data-group-id="9645544871-19">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-13">}</span><span class="p" data-group-id="9645544871-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-3">]</span><span class="p" data-group-id="9645544871-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="0923542995-20">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="0923542995-20">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-21">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-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="0923542995-22">}</span><span class="p" data-group-id="0923542995-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="9645544871-20">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="9645544871-20">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-21">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-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="9645544871-22">}</span><span class="p" data-group-id="9645544871-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="0923542995-23">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="0923542995-23">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-24">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-25">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-26">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-27">%</span><span class="nc" data-group-id="0923542995-27">Cldr.LanguageTag</span><span class="p" data-group-id="0923542995-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="9645544871-23">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="9645544871-23">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-24">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-25">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-26">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-27">%</span><span class="nc" data-group-id="9645544871-27">Cldr.LanguageTag</span><span class="p" data-group-id="9645544871-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="0923542995-28">[</span><span class="p" data-group-id="0923542995-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="0923542995-29">%{</span><span class="p" data-group-id="0923542995-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="9645544871-28">[</span><span class="p" data-group-id="9645544871-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="9645544871-29">%{</span><span class="p" data-group-id="9645544871-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="0923542995-30">%{</span><span class="p" data-group-id="0923542995-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="0923542995-31">[</span><span class="p" data-group-id="0923542995-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="9645544871-30">%{</span><span class="p" data-group-id="9645544871-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="9645544871-31">[</span><span class="p" data-group-id="9645544871-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="0923542995-32">%{</span><span class="p" data-group-id="0923542995-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="0923542995-33">[</span><span class="p" data-group-id="0923542995-33">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-27">}</span><span class="p" data-group-id="0923542995-26">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-34">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-35">%</span><span class="nc" data-group-id="0923542995-35">Cldr.LanguageTag</span><span class="p" data-group-id="0923542995-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="9645544871-32">%{</span><span class="p" data-group-id="9645544871-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="9645544871-33">[</span><span class="p" data-group-id="9645544871-33">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-27">}</span><span class="p" data-group-id="9645544871-26">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-34">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-35">%</span><span class="nc" data-group-id="9645544871-35">Cldr.LanguageTag</span><span class="p" data-group-id="9645544871-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="0923542995-36">[</span><span class="p" data-group-id="0923542995-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="0923542995-37">%{</span><span class="p" data-group-id="0923542995-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="9645544871-36">[</span><span class="p" data-group-id="9645544871-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="9645544871-37">%{</span><span class="p" data-group-id="9645544871-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="0923542995-38">%{</span><span class="p" data-group-id="0923542995-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="0923542995-39">[</span><span class="p" data-group-id="0923542995-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="9645544871-38">%{</span><span class="p" data-group-id="9645544871-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="9645544871-39">[</span><span class="p" data-group-id="9645544871-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="0923542995-40">%{</span><span class="p" data-group-id="0923542995-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="0923542995-41">[</span><span class="p" data-group-id="0923542995-41">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-35">}</span><span class="p" data-group-id="0923542995-34">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-42">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-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="0923542995-43">}</span><span class="p" data-group-id="0923542995-42">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0923542995-25">]</span><span class="p" data-group-id="0923542995-24">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9645544871-40">%{</span><span class="p" data-group-id="9645544871-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="9645544871-41">[</span><span class="p" data-group-id="9645544871-41">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-35">}</span><span class="p" data-group-id="9645544871-34">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-42">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-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="9645544871-43">}</span><span class="p" data-group-id="9645544871-42">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9645544871-25">]</span><span class="p" data-group-id="9645544871-24">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="parse!/1">
|
||||
@ -502,92 +502,92 @@ wuth an error tuple for each invalid tag added at the end of the list.</p><h2 id
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="7301763262-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p" data-group-id="7301763262-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-2">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-3">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-4">%</span><span class="nc" data-group-id="7301763262-4">Cldr.LanguageTag</span><span class="p" data-group-id="7301763262-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="5100188588-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p" data-group-id="5100188588-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-2">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-3">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-4">%</span><span class="nc" data-group-id="5100188588-4">Cldr.LanguageTag</span><span class="p" data-group-id="5100188588-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="7301763262-5">[</span><span class="p" data-group-id="7301763262-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="7301763262-6">%{</span><span class="p" data-group-id="7301763262-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="5100188588-5">[</span><span class="p" data-group-id="5100188588-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="5100188588-6">%{</span><span class="p" data-group-id="5100188588-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="7301763262-7">%{</span><span class="p" data-group-id="7301763262-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="7301763262-8">[</span><span class="p" data-group-id="7301763262-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="5100188588-7">%{</span><span class="p" data-group-id="5100188588-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="5100188588-8">[</span><span class="p" data-group-id="5100188588-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="7301763262-9">%{</span><span class="p" data-group-id="7301763262-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="7301763262-10">[</span><span class="p" data-group-id="7301763262-10">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-4">}</span><span class="p" data-group-id="7301763262-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-11">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-12">%</span><span class="nc" data-group-id="7301763262-12">Cldr.LanguageTag</span><span class="p" data-group-id="7301763262-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="5100188588-9">%{</span><span class="p" data-group-id="5100188588-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="5100188588-10">[</span><span class="p" data-group-id="5100188588-10">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-4">}</span><span class="p" data-group-id="5100188588-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-11">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-12">%</span><span class="nc" data-group-id="5100188588-12">Cldr.LanguageTag</span><span class="p" data-group-id="5100188588-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="7301763262-13">[</span><span class="p" data-group-id="7301763262-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="7301763262-14">%{</span><span class="p" data-group-id="7301763262-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="5100188588-13">[</span><span class="p" data-group-id="5100188588-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="5100188588-14">%{</span><span class="p" data-group-id="5100188588-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="7301763262-15">%{</span><span class="p" data-group-id="7301763262-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="7301763262-16">[</span><span class="p" data-group-id="7301763262-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="5100188588-15">%{</span><span class="p" data-group-id="5100188588-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="5100188588-16">[</span><span class="p" data-group-id="5100188588-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="7301763262-17">%{</span><span class="p" data-group-id="7301763262-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="7301763262-18">[</span><span class="p" data-group-id="7301763262-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-12">}</span><span class="p" data-group-id="7301763262-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-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="5100188588-17">%{</span><span class="p" data-group-id="5100188588-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="5100188588-18">[</span><span class="p" data-group-id="5100188588-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-12">}</span><span class="p" data-group-id="5100188588-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-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="7301763262-19">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="7301763262-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-20">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-21">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-22">%</span><span class="nc" data-group-id="7301763262-22">Cldr.LanguageTag</span><span class="p" data-group-id="7301763262-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="5100188588-19">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="5100188588-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-20">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-21">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-22">%</span><span class="nc" data-group-id="5100188588-22">Cldr.LanguageTag</span><span class="p" data-group-id="5100188588-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="7301763262-23">[</span><span class="p" data-group-id="7301763262-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="7301763262-24">%{</span><span class="p" data-group-id="7301763262-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="5100188588-23">[</span><span class="p" data-group-id="5100188588-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="5100188588-24">%{</span><span class="p" data-group-id="5100188588-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="7301763262-25">%{</span><span class="p" data-group-id="7301763262-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="7301763262-26">[</span><span class="p" data-group-id="7301763262-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="5100188588-25">%{</span><span class="p" data-group-id="5100188588-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="5100188588-26">[</span><span class="p" data-group-id="5100188588-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="7301763262-27">%{</span><span class="p" data-group-id="7301763262-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="7301763262-28">[</span><span class="p" data-group-id="7301763262-28">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-22">}</span><span class="p" data-group-id="7301763262-21">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-29">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-30">%</span><span class="nc" data-group-id="7301763262-30">Cldr.LanguageTag</span><span class="p" data-group-id="7301763262-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="5100188588-27">%{</span><span class="p" data-group-id="5100188588-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="5100188588-28">[</span><span class="p" data-group-id="5100188588-28">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-22">}</span><span class="p" data-group-id="5100188588-21">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-29">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-30">%</span><span class="nc" data-group-id="5100188588-30">Cldr.LanguageTag</span><span class="p" data-group-id="5100188588-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="7301763262-31">[</span><span class="p" data-group-id="7301763262-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="7301763262-32">%{</span><span class="p" data-group-id="7301763262-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="5100188588-31">[</span><span class="p" data-group-id="5100188588-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="5100188588-32">%{</span><span class="p" data-group-id="5100188588-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="7301763262-33">%{</span><span class="p" data-group-id="7301763262-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="7301763262-34">[</span><span class="p" data-group-id="7301763262-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="5100188588-33">%{</span><span class="p" data-group-id="5100188588-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="5100188588-34">[</span><span class="p" data-group-id="5100188588-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="7301763262-35">%{</span><span class="p" data-group-id="7301763262-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="7301763262-36">[</span><span class="p" data-group-id="7301763262-36">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-30">}</span><span class="p" data-group-id="7301763262-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-37">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-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="7301763262-38">}</span><span class="p" data-group-id="7301763262-37">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7301763262-20">]</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5100188588-35">%{</span><span class="p" data-group-id="5100188588-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="5100188588-36">[</span><span class="p" data-group-id="5100188588-36">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-30">}</span><span class="p" data-group-id="5100188588-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-37">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-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="5100188588-38">}</span><span class="p" data-group-id="5100188588-37">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5100188588-20">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -419,11 +419,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="3183579383-1">%</span><span class="nc" data-group-id="3183579383-1">Cldr.Currency</span><span class="p" data-group-id="3183579383-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="2923104744-1">%</span><span class="nc" data-group-id="2923104744-1">Cldr.Currency</span><span class="p" data-group-id="2923104744-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="3183579383-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="3183579383-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="2923104744-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="2923104744-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">
|
||||
@ -433,12 +433,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="3183579383-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="3183579383-3">%</span><span class="nc" data-group-id="3183579383-3">Cldr.Currency</span><span class="p" data-group-id="3183579383-3">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="2923104744-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="2923104744-3">%</span><span class="nc" data-group-id="2923104744-3">Cldr.Currency</span><span class="p" data-group-id="2923104744-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="3183579383-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="3183579383-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="2923104744-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="2923104744-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">
|
||||
@ -448,7 +448,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="3183579383-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2923104744-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>
|
||||
@ -499,11 +499,11 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
<span class="text">Example</span>
|
||||
</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="2369286752-1">%</span><span class="nc" data-group-id="2369286752-1">Cldr.Currency</span><span class="p" data-group-id="2369286752-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="5605979776-1">%</span><span class="nc" data-group-id="5605979776-1">Cldr.Currency</span><span class="p" data-group-id="5605979776-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="2369286752-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="2369286752-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="5605979776-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="5605979776-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">
|
||||
@ -513,12 +513,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="2369286752-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="2369286752-3">%</span><span class="nc" data-group-id="2369286752-3">Cldr.Currency</span><span class="p" data-group-id="2369286752-3">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5605979776-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="5605979776-3">%</span><span class="nc" data-group-id="5605979776-3">Cldr.Currency</span><span class="p" data-group-id="5605979776-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="2369286752-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="2369286752-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="5605979776-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="5605979776-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">
|
||||
@ -528,7 +528,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="2369286752-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5605979776-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span></code></pre><p> }</p>
|
||||
</section>
|
||||
</section>
|
||||
@ -586,13 +586,13 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="7940490946-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="7940490946-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7940490946-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7940490946-3">%</span><span class="nc" data-group-id="7940490946-3">Cldr.Currency</span><span class="p" data-group-id="7940490946-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="7316635687-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="7316635687-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7316635687-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7316635687-3">%</span><span class="nc" data-group-id="7316635687-3">Cldr.Currency</span><span class="p" data-group-id="7316635687-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="7940490946-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="7940490946-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="7316635687-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="7316635687-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">
|
||||
@ -600,15 +600,15 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/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="7940490946-3">}</span><span class="p" data-group-id="7940490946-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7316635687-3">}</span><span class="p" data-group-id="7316635687-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="7940490946-5">(</span><span class="s">"THB"</span><span class="p" data-group-id="7940490946-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7940490946-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7940490946-7">%</span><span class="nc" data-group-id="7940490946-7">Cldr.Currency</span><span class="p" data-group-id="7940490946-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="7316635687-5">(</span><span class="s">"THB"</span><span class="p" data-group-id="7316635687-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7316635687-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7316635687-7">%</span><span class="nc" data-group-id="7316635687-7">Cldr.Currency</span><span class="p" data-group-id="7316635687-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="7940490946-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="7940490946-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="7316635687-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="7316635687-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">
|
||||
@ -616,7 +616,7 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/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="7940490946-7">}</span><span class="p" data-group-id="7940490946-6">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="7316635687-7">}</span><span class="p" data-group-id="7316635687-6">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_for_code!/2">
|
||||
@ -675,12 +675,12 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="8550407154-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="8550407154-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8550407154-2">%</span><span class="nc" data-group-id="8550407154-2">Cldr.Currency</span><span class="p" data-group-id="8550407154-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="5034422596-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="5034422596-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5034422596-2">%</span><span class="nc" data-group-id="5034422596-2">Cldr.Currency</span><span class="p" data-group-id="5034422596-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="8550407154-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="8550407154-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="5034422596-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="5034422596-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">
|
||||
@ -688,14 +688,14 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/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="8550407154-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5034422596-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="8550407154-4">(</span><span class="s">"THB"</span><span class="p" data-group-id="8550407154-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8550407154-5">%</span><span class="nc" data-group-id="8550407154-5">Cldr.Currency</span><span class="p" data-group-id="8550407154-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="5034422596-4">(</span><span class="s">"THB"</span><span class="p" data-group-id="5034422596-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5034422596-5">%</span><span class="nc" data-group-id="5034422596-5">Cldr.Currency</span><span class="p" data-group-id="5034422596-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="8550407154-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="8550407154-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="5034422596-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="5034422596-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">
|
||||
@ -703,7 +703,7 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/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="8550407154-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5034422596-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_from_locale/1">
|
||||
@ -744,15 +744,15 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="p" data-group-id="7113515597-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="7113515597-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="p" data-group-id="7113515597-2">(</span><span class="s">"en"</span><span class="p" data-group-id="7113515597-2">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="p" data-group-id="0573682699-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="0573682699-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="p" data-group-id="0573682699-2">(</span><span class="s">"en"</span><span class="p" data-group-id="0573682699-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_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="7113515597-3">{</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="7113515597-3">}</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="p" data-group-id="7113515597-4">(</span><span class="s">"en-AU"</span><span class="p" data-group-id="7113515597-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="p" data-group-id="0573682699-3">{</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="0573682699-3">}</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="p" data-group-id="0573682699-4">(</span><span class="s">"en-AU"</span><span class="p" data-group-id="0573682699-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">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">
|
||||
|
||||
</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="p" data-group-id="7113515597-5">(</span><span class="s">"en-GB"</span><span class="p" data-group-id="7113515597-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_from_locale</span><span class="p" data-group-id="0573682699-5">(</span><span class="s">"en-GB"</span><span class="p" data-group-id="0573682699-5">)</span><span class="w">
|
||||
</span><span class="ss">:GBP</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -796,14 +796,14 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="p" data-group-id="5929366342-1">(</span><span class="s">"en"</span><span class="p" data-group-id="5929366342-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5929366342-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5929366342-3">%{</span><span class="w">
|
||||
</span><span class="ss">USD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5929366342-4">%{</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="5929366342-4">}</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="5929366342-5">%{</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="5929366342-5">}</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="5929366342-6">%{</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="5929366342-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5929366342-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5929366342-2">}</span></code></pre>
|
||||
<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="p" data-group-id="8145479877-1">(</span><span class="s">"en"</span><span class="p" data-group-id="8145479877-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8145479877-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8145479877-3">%{</span><span class="w">
|
||||
</span><span class="ss">USD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8145479877-4">%{</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="8145479877-4">}</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="8145479877-5">%{</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="8145479877-5">}</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="8145479877-6">%{</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="8145479877-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8145479877-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8145479877-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_strings/3">
|
||||
@ -862,9 +862,9 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="p" data-group-id="9447991838-1">(</span><span class="s">"en"</span><span class="p" data-group-id="9447991838-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9447991838-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9447991838-3">%{</span><span class="w">
|
||||
<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="p" data-group-id="1878011017-1">(</span><span class="s">"en"</span><span class="p" data-group-id="1878011017-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="1878011017-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1878011017-3">%{</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">
|
||||
@ -874,7 +874,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="9447991838-3">}</span><span class="p" data-group-id="9447991838-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="1878011017-3">}</span><span class="p" data-group-id="1878011017-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_strings!/3">
|
||||
@ -933,8 +933,8 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="p" data-group-id="9486538408-1">(</span><span class="s">"en"</span><span class="p" data-group-id="9486538408-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9486538408-2">%{</span><span class="w">
|
||||
<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="p" data-group-id="5032816066-1">(</span><span class="s">"en"</span><span class="p" data-group-id="5032816066-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="5032816066-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">
|
||||
@ -944,7 +944,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="9486538408-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5032816066-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="current_currency_from_locale/1">
|
||||
@ -982,10 +982,10 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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">current_currency_from_locale</span><span class="p" data-group-id="1298761014-1">(</span><span class="s">"en"</span><span class="p" data-group-id="1298761014-1">)</span><span class="w">
|
||||
<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">current_currency_from_locale</span><span class="p" data-group-id="4762255439-1">(</span><span class="s">"en"</span><span class="p" data-group-id="4762255439-1">)</span><span class="w">
|
||||
</span><span class="ss">:USD</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">current_currency_from_locale</span><span class="p" data-group-id="1298761014-2">(</span><span class="s">"en-AU"</span><span class="p" data-group-id="1298761014-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">current_currency_from_locale</span><span class="p" data-group-id="4762255439-2">(</span><span class="s">"en-AU"</span><span class="p" data-group-id="4762255439-2">)</span><span class="w">
|
||||
</span><span class="ss">:AUD</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1033,7 +1033,7 @@ mapping is returned for that territory.</p><h2 id="current_territory_currencies/
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="5303697035-1">(</span><span class="p" data-group-id="5303697035-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="6594400821-1">(</span><span class="p" data-group-id="6594400821-1">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_currencies/0">
|
||||
@ -1125,11 +1125,11 @@ currency code</li></ul><h2 id="known_currency_code/1-returns" class="section-hea
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="p" data-group-id="1273642065-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="1273642065-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1273642065-2">{</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="1273642065-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">known_currency_code</span><span class="p" data-group-id="5610588173-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="5610588173-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5610588173-2">{</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="5610588173-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">known_currency_code</span><span class="p" data-group-id="1273642065-3">(</span><span class="s">"GGG"</span><span class="p" data-group-id="1273642065-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1273642065-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1273642065-5">{</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="1273642065-5">}</span><span class="p" data-group-id="1273642065-4">}</span></code></pre>
|
||||
</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="p" data-group-id="5610588173-3">(</span><span class="s">"GGG"</span><span class="p" data-group-id="5610588173-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5610588173-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5610588173-5">{</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="5610588173-5">}</span><span class="p" data-group-id="5610588173-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_currency_code?/1">
|
||||
@ -1176,13 +1176,13 @@ currency code</li></ul><h2 id="known_currency_code?/1-returns" class="section-he
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="p" data-group-id="6016657911-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="6016657911-1">)</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">known_currency_code?</span><span class="p" data-group-id="4662597460-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="4662597460-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.Currency</span><span class="o">.</span><span class="n">known_currency_code?</span><span class="p" data-group-id="6016657911-2">(</span><span class="s">"GGG"</span><span class="p" data-group-id="6016657911-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">known_currency_code?</span><span class="p" data-group-id="4662597460-2">(</span><span class="s">"GGG"</span><span class="p" data-group-id="4662597460-2">)</span><span class="w">
|
||||
</span><span class="no">false</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="p" data-group-id="6016657911-3">(</span><span class="ss">:XCV</span><span class="p" data-group-id="6016657911-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">known_currency_code?</span><span class="p" data-group-id="4662597460-3">(</span><span class="ss">:XCV</span><span class="p" data-group-id="4662597460-3">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1217,7 +1217,7 @@ currency code</li></ul><h2 id="known_currency_code?/1-returns" class="section-he
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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_codes</span><span class="p" data-group-id="4221282529-1">(</span><span class="p" data-group-id="4221282529-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">known_currency_codes</span><span class="p" data-group-id="5362690905-1">(</span><span class="p" data-group-id="5362690905-1">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="new/2">
|
||||
@ -1276,14 +1276,14 @@ such as <code class="inline">0.05</code>. Optional.</li></ul><h2 id="new/2-retur
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="9751437838-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="9751437838-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9751437838-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9751437838-3">%</span><span class="nc" data-group-id="9751437838-3">Cldr.Currency</span><span class="p" data-group-id="9751437838-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="2699616321-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="2699616321-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2699616321-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2699616321-3">%</span><span class="nc" data-group-id="2699616321-3">Cldr.Currency</span><span class="p" data-group-id="2699616321-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="9751437838-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="9751437838-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="2699616321-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="2699616321-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">
|
||||
@ -1293,11 +1293,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="9751437838-3">}</span><span class="p" data-group-id="9751437838-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="9751437838-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="9751437838-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9751437838-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="9751437838-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="9751437838-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="9751437838-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9751437838-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9751437838-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="9751437838-9">}</span><span class="p" data-group-id="9751437838-8">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="2699616321-3">}</span><span class="p" data-group-id="2699616321-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="2699616321-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="2699616321-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2699616321-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="2699616321-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="2699616321-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="2699616321-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2699616321-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2699616321-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="2699616321-9">}</span><span class="p" data-group-id="2699616321-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="pluralize/3">
|
||||
@ -1355,20 +1355,20 @@ default is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plaus
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="p" data-group-id="0220439571-1">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="0220439571-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0220439571-2">{</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="0220439571-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">pluralize</span><span class="p" data-group-id="9474864839-1">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="9474864839-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9474864839-2">{</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="9474864839-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="p" data-group-id="0220439571-3">(</span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="0220439571-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0220439571-4">{</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="0220439571-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="p" data-group-id="9474864839-3">(</span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="9474864839-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9474864839-4">{</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="9474864839-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="p" data-group-id="0220439571-5">(</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="p" data-group-id="0220439571-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0220439571-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"美元"</span><span class="p" data-group-id="0220439571-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">pluralize</span><span class="p" data-group-id="9474864839-5">(</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="p" data-group-id="9474864839-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9474864839-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"美元"</span><span class="p" data-group-id="9474864839-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">pluralize</span><span class="p" data-group-id="0220439571-7">(</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="p" data-group-id="0220439571-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0220439571-8">{</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="0220439571-8">}</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="p" data-group-id="9474864839-7">(</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="p" data-group-id="9474864839-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9474864839-8">{</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="9474864839-8">}</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="p" data-group-id="0220439571-9">(</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="p" data-group-id="0220439571-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0220439571-10">{</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="0220439571-10">}</span></code></pre>
|
||||
</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="p" data-group-id="9474864839-9">(</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="p" data-group-id="9474864839-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9474864839-10">{</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="9474864839-10">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="strings_for_currency/2">
|
||||
@ -1410,8 +1410,8 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="p" data-group-id="8138188828-1">(</span><span class="ss">:AUD</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="8138188828-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8138188828-2">[</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="8138188828-2">]</span></code></pre>
|
||||
<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="p" data-group-id="8016362405-1">(</span><span class="ss">:AUD</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="8016362405-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8016362405-2">[</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="8016362405-2">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -326,16 +326,16 @@ this specific locale..</p><h2 id="fallback_locale_names/1-arguments" class="sect
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="1319356197-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="1319356197-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1319356197-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1319356197-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="1319356197-3">]</span><span class="p" data-group-id="1319356197-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="0408544845-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="0408544845-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0408544845-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0408544845-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="0408544845-3">]</span><span class="p" data-group-id="0408544845-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="1319356197-4">(</span><span class="ss">:nb</span><span class="p" data-group-id="1319356197-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1319356197-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1319356197-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="1319356197-6">]</span><span class="p" data-group-id="1319356197-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="0408544845-4">(</span><span class="ss">:nb</span><span class="p" data-group-id="0408544845-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0408544845-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0408544845-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="0408544845-6">]</span><span class="p" data-group-id="0408544845-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="fallback_locales/1">
|
||||
@ -389,20 +389,20 @@ this specific locale.</p><h2 id="fallback_locales/1-arguments" class="section-he
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="1457171697-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="1457171697-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="1457171697-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1457171697-3">[</span><span class="p" data-group-id="1457171697-4">#</span><span class="nc" data-group-id="1457171697-4">Cldr.LanguageTag</span><span class="p" data-group-id="1457171697-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="1457171697-5">[</span><span class="n">validated</span><span class="p" data-group-id="1457171697-5">]</span><span class="p" data-group-id="1457171697-4">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1457171697-6">#</span><span class="nc" data-group-id="1457171697-6">Cldr.LanguageTag</span><span class="p" data-group-id="1457171697-6"><</span><span class="n">fr</span><span class="w"> </span><span class="p" data-group-id="1457171697-7">[</span><span class="n">validated</span><span class="p" data-group-id="1457171697-7">]</span><span class="p" data-group-id="1457171697-6">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1457171697-8">#</span><span class="nc" data-group-id="1457171697-8">Cldr.LanguageTag</span><span class="p" data-group-id="1457171697-8"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="1457171697-9">[</span><span class="n">validated</span><span class="p" data-group-id="1457171697-9">]</span><span class="p" data-group-id="1457171697-8">></span><span class="p" data-group-id="1457171697-3">]</span><span class="p" data-group-id="1457171697-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="7299683507-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="7299683507-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="7299683507-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7299683507-3">[</span><span class="p" data-group-id="7299683507-4">#</span><span class="nc" data-group-id="7299683507-4">Cldr.LanguageTag</span><span class="p" data-group-id="7299683507-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="7299683507-5">[</span><span class="n">validated</span><span class="p" data-group-id="7299683507-5">]</span><span class="p" data-group-id="7299683507-4">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7299683507-6">#</span><span class="nc" data-group-id="7299683507-6">Cldr.LanguageTag</span><span class="p" data-group-id="7299683507-6"><</span><span class="n">fr</span><span class="w"> </span><span class="p" data-group-id="7299683507-7">[</span><span class="n">validated</span><span class="p" data-group-id="7299683507-7">]</span><span class="p" data-group-id="7299683507-6">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7299683507-8">#</span><span class="nc" data-group-id="7299683507-8">Cldr.LanguageTag</span><span class="p" data-group-id="7299683507-8"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="7299683507-9">[</span><span class="n">validated</span><span class="p" data-group-id="7299683507-9">]</span><span class="p" data-group-id="7299683507-8">></span><span class="p" data-group-id="7299683507-3">]</span><span class="p" data-group-id="7299683507-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="1457171697-10">(</span><span class="ss">:nb</span><span class="p" data-group-id="1457171697-10">)</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="1457171697-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1457171697-12">[</span><span class="p" data-group-id="1457171697-13">#</span><span class="nc" data-group-id="1457171697-13">Cldr.LanguageTag</span><span class="p" data-group-id="1457171697-13"><</span><span class="n">nb</span><span class="w"> </span><span class="p" data-group-id="1457171697-14">[</span><span class="n">validated</span><span class="p" data-group-id="1457171697-14">]</span><span class="p" data-group-id="1457171697-13">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1457171697-15">#</span><span class="nc" data-group-id="1457171697-15">Cldr.LanguageTag</span><span class="p" data-group-id="1457171697-15"><</span><span class="n">no</span><span class="w"> </span><span class="p" data-group-id="1457171697-16">[</span><span class="n">validated</span><span class="p" data-group-id="1457171697-16">]</span><span class="p" data-group-id="1457171697-15">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1457171697-17">#</span><span class="nc" data-group-id="1457171697-17">Cldr.LanguageTag</span><span class="p" data-group-id="1457171697-17"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="1457171697-18">[</span><span class="n">validated</span><span class="p" data-group-id="1457171697-18">]</span><span class="p" data-group-id="1457171697-17">></span><span class="p" data-group-id="1457171697-12">]</span><span class="p" data-group-id="1457171697-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="7299683507-10">(</span><span class="ss">:nb</span><span class="p" data-group-id="7299683507-10">)</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="7299683507-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7299683507-12">[</span><span class="p" data-group-id="7299683507-13">#</span><span class="nc" data-group-id="7299683507-13">Cldr.LanguageTag</span><span class="p" data-group-id="7299683507-13"><</span><span class="n">nb</span><span class="w"> </span><span class="p" data-group-id="7299683507-14">[</span><span class="n">validated</span><span class="p" data-group-id="7299683507-14">]</span><span class="p" data-group-id="7299683507-13">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7299683507-15">#</span><span class="nc" data-group-id="7299683507-15">Cldr.LanguageTag</span><span class="p" data-group-id="7299683507-15"><</span><span class="n">no</span><span class="w"> </span><span class="p" data-group-id="7299683507-16">[</span><span class="n">validated</span><span class="p" data-group-id="7299683507-16">]</span><span class="p" data-group-id="7299683507-15">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7299683507-17">#</span><span class="nc" data-group-id="7299683507-17">Cldr.LanguageTag</span><span class="p" data-group-id="7299683507-17"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="7299683507-18">[</span><span class="n">validated</span><span class="p" data-group-id="7299683507-18">]</span><span class="p" data-group-id="7299683507-17">></span><span class="p" data-group-id="7299683507-12">]</span><span class="p" data-group-id="7299683507-11">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="locale_for_territory/1">
|
||||
@ -533,15 +533,15 @@ generic top-level domain names.</p><h2 id="locale_from_host/2-examples" class="s
|
||||
<span class="text">Examples</span>
|
||||
</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="0554089926-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="0554089926-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="8831858781-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="8831858781-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="0554089926-2">(</span><span class="s">"a.b.com.tv"</span><span class="p" data-group-id="0554089926-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0554089926-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0554089926-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="0554089926-4">}</span><span class="p" data-group-id="0554089926-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="8831858781-2">(</span><span class="s">"a.b.com.tv"</span><span class="p" data-group-id="8831858781-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8831858781-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8831858781-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="8831858781-4">}</span><span class="p" data-group-id="8831858781-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="0554089926-5">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="0554089926-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0554089926-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0554089926-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="0554089926-7">}</span><span class="p" data-group-id="0554089926-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="8831858781-5">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="8831858781-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8831858781-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8831858781-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="8831858781-7">}</span><span class="p" data-group-id="8831858781-6">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="new/1">
|
||||
@ -683,12 +683,12 @@ be a territory.</p><h2 id="territory_from_host/1-arguments" class="section-headi
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="8445427053-1">(</span><span class="s">"a.b.com.au"</span><span class="p" data-group-id="8445427053-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8445427053-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="8445427053-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="0306425700-1">(</span><span class="s">"a.b.com.au"</span><span class="p" data-group-id="0306425700-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0306425700-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="0306425700-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="8445427053-3">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="8445427053-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8445427053-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8445427053-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="8445427053-5">}</span><span class="p" data-group-id="8445427053-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="0306425700-3">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="0306425700-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0306425700-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0306425700-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="0306425700-5">}</span><span class="p" data-group-id="0306425700-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="territory_from_locale/1">
|
||||
|
@ -455,31 +455,31 @@ The valid substitution keys are <code class="inline">:zero</code>, <code class="
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="6081721457-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="6081721457-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="0647769421-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="0647769421-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="6081721457-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="6081721457-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="0647769421-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="0647769421-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="6081721457-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="6081721457-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="0647769421-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="0647769421-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="6081721457-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="6081721457-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="0647769421-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="0647769421-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="6081721457-5">(</span><span class="mi">1</span><span class="p" data-group-id="6081721457-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="6081721457-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="6081721457-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="0647769421-5">(</span><span class="mi">1</span><span class="p" data-group-id="0647769421-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="0647769421-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="0647769421-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="6081721457-7">(</span><span class="mi">2</span><span class="p" data-group-id="6081721457-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="6081721457-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="6081721457-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="0647769421-7">(</span><span class="mi">2</span><span class="p" data-group-id="0647769421-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="0647769421-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="0647769421-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="6081721457-9">(</span><span class="mi">2</span><span class="p" data-group-id="6081721457-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="6081721457-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="6081721457-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="0647769421-9">(</span><span class="mi">2</span><span class="p" data-group-id="0647769421-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="0647769421-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="0647769421-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="6081721457-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="6081721457-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="0647769421-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="0647769421-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="6081721457-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="6081721457-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="0647769421-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="0647769421-12">}</span><span class="w">
|
||||
</span><span class="s">"other"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -468,7 +468,7 @@ to precompile all the known formats at compile time.</p><h2 id="decimal_format_l
|
||||
<span class="text">Example</span>
|
||||
</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="0420056371-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="6978142117-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">
|
||||
@ -478,7 +478,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="0420056371-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="6978142117-1">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="decimal_format_list_for/1">
|
||||
@ -526,8 +526,8 @@ the known formats at compile time. Its use is not otherwise recommended.</p><h2
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="6621986647-1">(</span><span class="ss">:en</span><span class="p" data-group-id="6621986647-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6621986647-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6621986647-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="4468226527-1">(</span><span class="ss">:en</span><span class="p" data-group-id="4468226527-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4468226527-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4468226527-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">
|
||||
@ -535,7 +535,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="6621986647-3">]</span><span class="p" data-group-id="6621986647-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="4468226527-3">]</span><span class="p" data-group-id="4468226527-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_grouping_for/1">
|
||||
@ -588,8 +588,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="0160350708-1">(</span><span class="ss">:en</span><span class="p" data-group-id="0160350708-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0160350708-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0160350708-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0160350708-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="0160350708-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="0160350708-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="0160350708-5">}</span><span class="p" data-group-id="0160350708-3">}</span><span class="p" data-group-id="0160350708-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="5651092632-1">(</span><span class="ss">:en</span><span class="p" data-group-id="5651092632-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5651092632-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5651092632-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5651092632-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="5651092632-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="5651092632-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="5651092632-5">}</span><span class="p" data-group-id="5651092632-3">}</span><span class="p" data-group-id="5651092632-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_grouping_for!/1">
|
||||
@ -641,8 +641,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="0859427231-1">(</span><span class="ss">:en</span><span class="p" data-group-id="0859427231-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0859427231-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0859427231-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="0859427231-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="0859427231-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="0859427231-4">}</span><span class="p" data-group-id="0859427231-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="0467859592-1">(</span><span class="ss">:en</span><span class="p" data-group-id="0467859592-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0467859592-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0467859592-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="0467859592-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="0467859592-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="0467859592-4">}</span><span class="p" data-group-id="0467859592-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="formats_for/2">
|
||||
@ -699,18 +699,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="2188795268-1">[</span><span class="p" data-group-id="2188795268-2">{</span><span class="s">"1000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-3">]</span><span class="p" data-group-id="2188795268-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-4">{</span><span class="s">"10000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-5">]</span><span class="p" data-group-id="2188795268-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-6">{</span><span class="s">"100000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-7">]</span><span class="p" data-group-id="2188795268-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-8">{</span><span class="s">"1000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-9">]</span><span class="p" data-group-id="2188795268-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-10">{</span><span class="s">"10000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-11">]</span><span class="p" data-group-id="2188795268-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-12">{</span><span class="s">"100000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-13">]</span><span class="p" data-group-id="2188795268-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-14">{</span><span class="s">"1000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-15">]</span><span class="p" data-group-id="2188795268-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-16">{</span><span class="s">"10000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-17">]</span><span class="p" data-group-id="2188795268-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-18">{</span><span class="s">"100000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-19">]</span><span class="p" data-group-id="2188795268-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-20">{</span><span class="s">"1000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-21">]</span><span class="p" data-group-id="2188795268-20">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-22">{</span><span class="s">"10000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-23">]</span><span class="p" data-group-id="2188795268-22">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2188795268-24">{</span><span class="s">"100000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2188795268-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="2188795268-25">]</span><span class="p" data-group-id="2188795268-24">}</span><span class="p" data-group-id="2188795268-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="2178576163-1">[</span><span class="p" data-group-id="2178576163-2">{</span><span class="s">"1000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-3">]</span><span class="p" data-group-id="2178576163-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-4">{</span><span class="s">"10000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-5">]</span><span class="p" data-group-id="2178576163-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-6">{</span><span class="s">"100000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-7">]</span><span class="p" data-group-id="2178576163-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-8">{</span><span class="s">"1000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-9">]</span><span class="p" data-group-id="2178576163-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-10">{</span><span class="s">"10000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-11">]</span><span class="p" data-group-id="2178576163-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-12">{</span><span class="s">"100000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-13">]</span><span class="p" data-group-id="2178576163-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-14">{</span><span class="s">"1000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-15">]</span><span class="p" data-group-id="2178576163-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-16">{</span><span class="s">"10000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-17">]</span><span class="p" data-group-id="2178576163-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-18">{</span><span class="s">"100000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-19">]</span><span class="p" data-group-id="2178576163-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-20">{</span><span class="s">"1000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-21">]</span><span class="p" data-group-id="2178576163-20">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-22">{</span><span class="s">"10000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-23">]</span><span class="p" data-group-id="2178576163-22">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2178576163-24">{</span><span class="s">"100000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2178576163-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="2178576163-25">]</span><span class="p" data-group-id="2178576163-24">}</span><span class="p" data-group-id="2178576163-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>
|
||||
@ -801,8 +801,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="5448123088-1">(</span><span class="s">"en"</span><span class="p" data-group-id="5448123088-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5448123088-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="5448123088-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="3659267551-1">(</span><span class="s">"en"</span><span class="p" data-group-id="3659267551-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3659267551-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="3659267551-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="minimum_grouping_digits_for!/1">
|
||||
@ -854,7 +854,7 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="7047260582-1">(</span><span class="s">"en"</span><span class="p" data-group-id="7047260582-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="1578969829-1">(</span><span class="s">"en"</span><span class="p" data-group-id="1578969829-1">)</span><span class="w">
|
||||
</span><span class="mi">1</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -458,31 +458,31 @@ The valid substitution keys are <code class="inline">:zero</code>, <code class="
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="9384789461-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="9384789461-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="4469634781-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="4469634781-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="9384789461-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="9384789461-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="4469634781-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="4469634781-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="9384789461-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="9384789461-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="4469634781-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="4469634781-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="9384789461-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="9384789461-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="4469634781-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="4469634781-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="9384789461-5">(</span><span class="mi">1</span><span class="p" data-group-id="9384789461-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="9384789461-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="9384789461-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="4469634781-5">(</span><span class="mi">1</span><span class="p" data-group-id="4469634781-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="4469634781-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="4469634781-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="9384789461-7">(</span><span class="mi">2</span><span class="p" data-group-id="9384789461-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="9384789461-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="9384789461-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="4469634781-7">(</span><span class="mi">2</span><span class="p" data-group-id="4469634781-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="4469634781-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="4469634781-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="9384789461-9">(</span><span class="mi">2</span><span class="p" data-group-id="9384789461-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="9384789461-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="9384789461-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="4469634781-9">(</span><span class="mi">2</span><span class="p" data-group-id="4469634781-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="4469634781-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="4469634781-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="9384789461-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="9384789461-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="4469634781-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="4469634781-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="9384789461-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="9384789461-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="4469634781-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="4469634781-12">}</span><span class="w">
|
||||
</span><span class="s">"other"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -378,9 +378,9 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Example:</span>
|
||||
</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="1843914623-1">(</span><span class="ss">:th</span><span class="p" data-group-id="1843914623-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1843914623-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1843914623-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="1843914623-4">%</span><span class="nc" data-group-id="1843914623-4">Cldr.Number.Symbol</span><span class="p" data-group-id="1843914623-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="4017377116-1">(</span><span class="ss">:th</span><span class="p" data-group-id="4017377116-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4017377116-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4017377116-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="4017377116-4">%</span><span class="nc" data-group-id="4017377116-4">Cldr.Number.Symbol</span><span class="p" data-group-id="4017377116-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">
|
||||
@ -393,8 +393,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="1843914623-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="1843914623-5">%</span><span class="nc" data-group-id="1843914623-5">Cldr.Number.Symbol</span><span class="p" data-group-id="1843914623-5">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="4017377116-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="4017377116-5">%</span><span class="nc" data-group-id="4017377116-5">Cldr.Number.Symbol</span><span class="p" data-group-id="4017377116-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">
|
||||
@ -407,8 +407,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="1843914623-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1843914623-3">}</span><span class="p" data-group-id="1843914623-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="4017377116-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4017377116-3">}</span><span class="p" data-group-id="4017377116-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_symbols_for/2">
|
||||
|
@ -317,23 +317,23 @@ it is returned as is.</p><h2 id="number_system_for/2-examples" class="section-he
|
||||
<span class="text">Examples</span>
|
||||
</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="7200923039-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7200923039-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="7200923039-2">}</span><span class="p" data-group-id="7200923039-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1086989371-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1086989371-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="1086989371-2">}</span><span class="p" data-group-id="1086989371-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="7200923039-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7200923039-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="7200923039-4">}</span><span class="p" data-group-id="7200923039-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1086989371-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1086989371-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="1086989371-4">}</span><span class="p" data-group-id="1086989371-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="7200923039-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7200923039-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="7200923039-6">}</span><span class="p" data-group-id="7200923039-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1086989371-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1086989371-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="1086989371-6">}</span><span class="p" data-group-id="1086989371-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="7200923039-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7200923039-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="7200923039-8">}</span><span class="p" data-group-id="7200923039-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1086989371-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1086989371-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="1086989371-8">}</span><span class="p" data-group-id="1086989371-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="7200923039-9">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="1086989371-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="7200923039-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="7200923039-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7200923039-9">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="1086989371-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="1086989371-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1086989371-9">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_system_from_locale/1">
|
||||
@ -424,10 +424,10 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
<span class="text">Examples</span>
|
||||
</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="1257724534-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1257724534-2">[</span><span class="ss">:latn</span><span class="p" data-group-id="1257724534-2">]</span><span class="p" data-group-id="1257724534-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5315648041-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5315648041-2">[</span><span class="ss">:latn</span><span class="p" data-group-id="5315648041-2">]</span><span class="p" data-group-id="5315648041-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="1257724534-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1257724534-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="1257724534-4">}</span><span class="p" data-group-id="1257724534-3">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5315648041-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5315648041-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="5315648041-4">}</span><span class="p" data-group-id="5315648041-3">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_system_names_for!/1">
|
||||
@ -509,13 +509,13 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
<span class="text">Examples</span>
|
||||
</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="1213092247-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1213092247-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="1213092247-2">}</span><span class="p" data-group-id="1213092247-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6393971704-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6393971704-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="6393971704-2">}</span><span class="p" data-group-id="6393971704-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="1213092247-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1213092247-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="1213092247-4">}</span><span class="p" data-group-id="1213092247-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="6393971704-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6393971704-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="6393971704-4">}</span><span class="p" data-group-id="6393971704-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="1213092247-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1213092247-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="1213092247-6">}</span><span class="p" data-group-id="1213092247-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="6393971704-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6393971704-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="6393971704-6">}</span><span class="p" data-group-id="6393971704-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_systems_for!/1">
|
||||
@ -613,20 +613,20 @@ actual system name.</p><h2 id="system_name_from/2-examples" class="section-headi
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="3103606505-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="3103606505-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3103606505-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="3103606505-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="7554385475-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="7554385475-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7554385475-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="7554385475-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="3103606505-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="3103606505-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3103606505-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="3103606505-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="7554385475-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="7554385475-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7554385475-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="7554385475-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="3103606505-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="3103606505-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3103606505-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="3103606505-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="7554385475-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="7554385475-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7554385475-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="7554385475-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="3103606505-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="3103606505-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3103606505-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="7554385475-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="7554385475-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7554385475-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="3103606505-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="3103606505-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3103606505-8">}</span></code></pre><p>Note that return value is not guaranteed to be a valid
|
||||
</span><span class="p" data-group-id="7554385475-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="7554385475-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7554385475-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>
|
||||
@ -673,16 +673,16 @@ is recommended.</p></li></ul><h2 id="to_system/2-examples" class="section-headin
|
||||
<span class="text">Examples</span>
|
||||
</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="8286684291-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="8286684291-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4574496556-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="4574496556-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="8286684291-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="8286684291-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4574496556-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="4574496556-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="8286684291-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="8286684291-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4574496556-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="4574496556-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="8286684291-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="8286684291-4">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="4574496556-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="4574496556-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_system!/2">
|
||||
|
@ -162,12 +162,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="1089743605-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="7240247062-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="1089743605-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="1089743605-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="7240247062-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="7240247062-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="1089743605-3">[</span><span class="p" data-group-id="1089743605-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="1089743605-4">}</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1089743605-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="1089743605-5">}</span><span class="p" data-group-id="1089743605-3">]</span><span class="w">
|
||||
</span><span class="k" data-group-id="1089743605-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="7240247062-3">[</span><span class="p" data-group-id="7240247062-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="7240247062-4">}</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7240247062-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="7240247062-5">}</span><span class="p" data-group-id="7240247062-3">]</span><span class="w">
|
||||
</span><span class="k" data-group-id="7240247062-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.32.3/Cldr.Number.System.html#numeric_systems/0"><code class="inline">Cldr.Number.System.numeric_systems/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>
|
||||
@ -281,22 +281,22 @@ and <a href="Plausible.Cldr.Number.System.html#number_systems_for/1"><code class
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="9686024738-1">(</span><span class="s">"123556"</span><span class="p" data-group-id="9686024738-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="0888443340-1">(</span><span class="s">"123556"</span><span class="p" data-group-id="0888443340-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="9686024738-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="9686024738-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="0888443340-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="0888443340-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="9686024738-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="9686024738-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="0888443340-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="0888443340-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="9686024738-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="9686024738-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="0888443340-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="0888443340-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="9686024738-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="9686024738-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="0888443340-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="0888443340-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="9686024738-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="9686024738-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="0888443340-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="0888443340-6">)</span><span class="w">
|
||||
</span><span class="s">"Some number is: ๑๒๓๕๕๖"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -441,19 +441,19 @@ using the Elixir standard library functions.</p><h2 id="parse/2-examples" class=
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="5009964808-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="5009964808-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5009964808-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="5009964808-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="1953481850-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="1953481850-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1953481850-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="1953481850-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="5009964808-3">(</span><span class="s">"-1_000_000.34"</span><span class="p" data-group-id="5009964808-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5009964808-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="5009964808-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="1953481850-3">(</span><span class="s">"-1_000_000.34"</span><span class="p" data-group-id="1953481850-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1953481850-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="1953481850-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="5009964808-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="5009964808-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5009964808-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="5009964808-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="1953481850-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="1953481850-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1953481850-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="1953481850-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="5009964808-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="5009964808-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5009964808-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5009964808-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="5009964808-9">}</span><span class="p" data-group-id="5009964808-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="1953481850-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="1953481850-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1953481850-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1953481850-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="1953481850-9">}</span><span class="p" data-group-id="1953481850-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_currencies/2">
|
||||
@ -525,17 +525,17 @@ financial instruments.</p></li></ul><h2 id="resolve_currencies/2-examples" class
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="3863334199-1">(</span><span class="s">"100 US dollars"</span><span class="p" data-group-id="3863334199-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="6423527781-1">(</span><span class="s">"100 US dollars"</span><span class="p" data-group-id="6423527781-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="3863334199-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="3863334199-2">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6423527781-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="6423527781-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="3863334199-3">(</span><span class="s">"100 eurosports"</span><span class="p" data-group-id="3863334199-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="3863334199-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="3863334199-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863334199-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="3863334199-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="6423527781-3">(</span><span class="s">"100 eurosports"</span><span class="p" data-group-id="6423527781-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="6423527781-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="6423527781-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6423527781-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="6423527781-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="3863334199-6">(</span><span class="s">"100 dollars des États-Unis"</span><span class="p" data-group-id="3863334199-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="3863334199-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="3863334199-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3863334199-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="3863334199-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="6423527781-6">(</span><span class="s">"100 dollars des États-Unis"</span><span class="p" data-group-id="6423527781-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="6423527781-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="6423527781-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6423527781-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="6423527781-8">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_currency/2">
|
||||
@ -612,19 +612,19 @@ financial instruments.</p></li></ul><h2 id="resolve_currency/2-examples" class="
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="3737640685-1">(</span><span class="s">"US dollars"</span><span class="p" data-group-id="3737640685-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3737640685-2">[</span><span class="ss">:USD</span><span class="p" data-group-id="3737640685-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="3114546227-1">(</span><span class="s">"US dollars"</span><span class="p" data-group-id="3114546227-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3114546227-2">[</span><span class="ss">:USD</span><span class="p" data-group-id="3114546227-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="3737640685-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="3737640685-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3737640685-4">[</span><span class="ss">:EUR</span><span class="p" data-group-id="3737640685-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="3114546227-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="3114546227-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3114546227-4">[</span><span class="ss">:EUR</span><span class="p" data-group-id="3114546227-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="3737640685-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="3737640685-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3737640685-6">[</span><span class="ss">:USD</span><span class="p" data-group-id="3737640685-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="3114546227-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="3114546227-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3114546227-6">[</span><span class="ss">:USD</span><span class="p" data-group-id="3114546227-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="3737640685-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="3737640685-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3737640685-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3737640685-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="3737640685-9">}</span><span class="p" data-group-id="3737640685-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="3114546227-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="3114546227-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3114546227-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3114546227-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="3114546227-9">}</span><span class="p" data-group-id="3114546227-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_per/2">
|
||||
@ -688,13 +688,13 @@ The default is <code class="inline">options[:backend].get_locale()</code></li></
|
||||
<span class="text">Examples</span>
|
||||
</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="9250037636-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="9250037636-1">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5021178964-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="5021178964-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="9250037636-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="9250037636-2">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5021178964-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="5021178964-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="9250037636-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="9250037636-3">]</span></code></pre>
|
||||
</span><span class="p" data-group-id="5021178964-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="5021178964-3">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_pers/2">
|
||||
@ -751,9 +751,9 @@ The default is <code class="inline">options[:backend].get_locale()</code></li></
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="8225587369-1">(</span><span class="s">"100%"</span><span class="p" data-group-id="8225587369-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="8225587369-2">(</span><span class="p" data-group-id="8225587369-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8225587369-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="8225587369-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="8506398877-1">(</span><span class="s">"100%"</span><span class="p" data-group-id="8506398877-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="8506398877-2">(</span><span class="p" data-group-id="8506398877-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8506398877-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="8506398877-3">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="scan/2">
|
||||
@ -813,20 +813,20 @@ and any options provided are passed to that function.</p><h2 id="scan/2-examples
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="8343180824-1">(</span><span class="s">"£1_000_000.34"</span><span class="p" data-group-id="8343180824-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8343180824-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="8343180824-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="8026312688-1">(</span><span class="s">"£1_000_000.34"</span><span class="p" data-group-id="8026312688-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8026312688-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="8026312688-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="8343180824-3">(</span><span class="s">"I want £1_000_000 dollars"</span><span class="p" data-group-id="8343180824-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8343180824-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="8343180824-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="8026312688-3">(</span><span class="s">"I want £1_000_000 dollars"</span><span class="p" data-group-id="8026312688-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8026312688-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="8026312688-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="8343180824-5">(</span><span class="s">"The prize is 23"</span><span class="p" data-group-id="8343180824-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8343180824-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="8343180824-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="8026312688-5">(</span><span class="s">"The prize is 23"</span><span class="p" data-group-id="8026312688-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8026312688-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="8026312688-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="8343180824-7">(</span><span class="s">"The lottery number is 23 for the next draw"</span><span class="p" data-group-id="8343180824-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8343180824-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="8343180824-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="8026312688-7">(</span><span class="s">"The lottery number is 23 for the next draw"</span><span class="p" data-group-id="8026312688-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8026312688-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="8026312688-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="8343180824-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="8343180824-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8343180824-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="8343180824-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="8026312688-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="8026312688-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8026312688-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="8026312688-10">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_approx_string/2">
|
||||
@ -873,7 +873,7 @@ options.</p></li></ul><h2 id="to_approx_string/2-example" class="section-heading
|
||||
<span class="text">Example</span>
|
||||
</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="1157550925-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="1157550925-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="2759802649-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="2759802649-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_at_least_string/2">
|
||||
@ -920,7 +920,7 @@ options.</p></li></ul><h2 id="to_at_least_string/2-example" class="section-headi
|
||||
<span class="text">Example</span>
|
||||
</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="0734280011-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="0734280011-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="8680696160-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="8680696160-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_at_most_string/2">
|
||||
@ -967,7 +967,7 @@ options.</p></li></ul><h2 id="to_at_most_string/2-example" class="section-headin
|
||||
<span class="text">Example</span>
|
||||
</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="8032981365-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="8032981365-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="1088414852-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="1088414852-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_range_string/2">
|
||||
@ -1014,7 +1014,7 @@ options.</p></li></ul><h2 id="to_range_string/2-example" class="section-heading"
|
||||
<span class="text">Example</span>
|
||||
</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="2817589042-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="2817589042-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="7129259474-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="7129259474-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_string/2">
|
||||
@ -1133,21 +1133,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="7925937595-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="7925937595-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="6435625679-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="6435625679-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="7925937595-2">end</span><span class="p" data-group-id="7925937595-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7925937595-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="7925937595-3">}</span></code></pre><p>It is also possible and recommended to use the <a href="https://hexdocs.pm/phoenix_html/3.3.3/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="6435625679-2">end</span><span class="p" data-group-id="6435625679-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6435625679-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="6435625679-3">}</span></code></pre><p>It is also possible and recommended to use the <a href="https://hexdocs.pm/phoenix_html/3.3.3/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="0056009613-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="0056009613-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="0056009613-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="0056009613-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="0056009613-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="0056009613-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="0056009613-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="0056009613-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="2994398351-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="2994398351-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="2994398351-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="2994398351-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="2994398351-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="2994398351-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="2994398351-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="2994398351-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="0056009613-2">end</span><span class="p" data-group-id="0056009613-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0056009613-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="0056009613-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="2994398351-2">end</span><span class="p" data-group-id="2994398351-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2994398351-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="2994398351-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.
|
||||
@ -1168,80 +1168,80 @@ inserted in the final formatted number.</p><h2 id="to_string/2-returns" class="s
|
||||
<span class="text">Examples</span>
|
||||
</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="0799601442-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="0799601442-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-13">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-16">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-17">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-18">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-19">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-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="0799601442-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="0799601442-20">}</span></code></pre><h2 id="to_string/2-errors" class="section-heading">
|
||||
</span><span class="p" data-group-id="9018084500-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="9018084500-20">}</span></code></pre><h2 id="to_string/2-errors" class="section-heading">
|
||||
<a href="#to_string/2-errors" class="hover-link">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
</a>
|
||||
<span class="text">Errors</span>
|
||||
</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="7529353886-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="7529353886-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7529353886-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7529353886-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="7529353886-3">}</span><span class="p" data-group-id="7529353886-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="7661198205-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="7661198205-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7661198205-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7661198205-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="7661198205-3">}</span><span class="p" data-group-id="7661198205-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="1666587137-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">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="1666587137-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1666587137-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1666587137-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 :percent"</span><span class="p" data-group-id="1666587137-3">}</span><span class="p" data-group-id="1666587137-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="0667707906-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">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="0667707906-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0667707906-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0667707906-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 :percent"</span><span class="p" data-group-id="0667707906-3">}</span><span class="p" data-group-id="0667707906-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_string!/2">
|
||||
@ -1346,17 +1346,17 @@ returned by <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.html#known_number_sy
|
||||
<span class="text">Examples</span>
|
||||
</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="7559610367-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="7559610367-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3263557793-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="3263557793-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="7559610367-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="7559610367-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3263557793-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="3263557793-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="7559610367-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7559610367-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="7559610367-4">}</span><span class="p" data-group-id="7559610367-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="3263557793-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3263557793-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="3263557793-4">}</span><span class="p" data-group-id="3263557793-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="7559610367-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7559610367-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="7559610367-6">}</span><span class="p" data-group-id="7559610367-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="3263557793-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3263557793-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="3263557793-6">}</span><span class="p" data-group-id="3263557793-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -145,9 +145,9 @@ Pages
|
||||
<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.32.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="4717233842-1">(</span><span class="ss">:und</span><span class="p" data-group-id="4717233842-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="4717233842-2">(</span><span class="p" data-group-id="4717233842-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4717233842-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="6085221079-1">(</span><span class="ss">:und</span><span class="p" data-group-id="6085221079-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="6085221079-2">(</span><span class="p" data-group-id="6085221079-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6085221079-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">
|
||||
@ -161,9 +161,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="4717233842-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="2782590368-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="2782590368-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="7724974090-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="7724974090-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7724974090-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="7724974090-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="6085221079-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="0956652798-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="0956652798-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="8343110004-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="8343110004-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8343110004-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="8343110004-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -145,20 +145,20 @@ Pages
|
||||
<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.32.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="7602146968-1">(</span><span class="ss">:en</span><span class="p" data-group-id="7602146968-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7602146968-2">[</span><span class="ss">:digits_ordinal</span><span class="p" data-group-id="7602146968-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="7815452797-1">(</span><span class="ss">:en</span><span class="p" data-group-id="7815452797-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7815452797-2">[</span><span class="ss">:digits_ordinal</span><span class="p" data-group-id="7815452797-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="7602146968-3">(</span><span class="s">"fr"</span><span class="p" data-group-id="7602146968-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="7602146968-4">(</span><span class="p" data-group-id="7602146968-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7602146968-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="7815452797-3">(</span><span class="s">"fr"</span><span class="p" data-group-id="7815452797-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="7815452797-4">(</span><span class="p" data-group-id="7815452797-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7815452797-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="7602146968-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="4746285429-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="4746285429-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="1913526046-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="1913526046-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1913526046-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="1913526046-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="7815452797-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="0133101927-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="0133101927-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="7654219050-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="7654219050-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7654219050-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="7654219050-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -145,9 +145,9 @@ Pages
|
||||
<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.32.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="0723818050-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0723818050-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="0723818050-2">(</span><span class="p" data-group-id="0723818050-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0723818050-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="0576759402-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0576759402-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="0576759402-2">(</span><span class="p" data-group-id="0576759402-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0576759402-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">
|
||||
@ -155,9 +155,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="0723818050-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="6674553296-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="6674553296-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="8876639881-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="8876639881-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8876639881-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="8876639881-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="0576759402-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="3849224976-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="3849224976-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="6161540986-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="6161540986-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6161540986-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="6161540986-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -558,24 +558,24 @@ current locale is restored after the function.</p></div>
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="5556637236-1">(</span><span class="p" data-group-id="5556637236-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5556637236-2">%</span><span class="nc" data-group-id="5556637236-2">Cldr.LanguageTag</span><span class="p" data-group-id="5556637236-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="5614522596-1">(</span><span class="p" data-group-id="5614522596-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5614522596-2">%</span><span class="nc" data-group-id="5614522596-2">Cldr.LanguageTag</span><span class="p" data-group-id="5614522596-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="5556637236-3">[</span><span class="p" data-group-id="5556637236-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="5556637236-4">%{</span><span class="p" data-group-id="5556637236-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="5614522596-3">[</span><span class="p" data-group-id="5614522596-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="5614522596-4">%{</span><span class="p" data-group-id="5614522596-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="5556637236-5">%{</span><span class="p" data-group-id="5556637236-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="5556637236-6">[</span><span class="p" data-group-id="5556637236-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="5614522596-5">%{</span><span class="p" data-group-id="5614522596-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="5614522596-6">[</span><span class="p" data-group-id="5614522596-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="5556637236-7">%{</span><span class="p" data-group-id="5556637236-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="5556637236-8">[</span><span class="p" data-group-id="5556637236-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5556637236-2">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5614522596-7">%{</span><span class="p" data-group-id="5614522596-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="5614522596-8">[</span><span class="p" data-group-id="5614522596-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5614522596-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_territory/0">
|
||||
@ -610,7 +610,7 @@ does not specify one and none can be inferred.</p><h2 id="default_territory/0-ex
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="9407999275-1">(</span><span class="p" data-group-id="9407999275-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="9060647410-1">(</span><span class="p" data-group-id="9060647410-1">)</span><span class="w">
|
||||
</span><span class="ss">:"001"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -670,16 +670,16 @@ is inserted between words or sentences. The valid options are
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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">ellipsis</span><span class="p" data-group-id="5473754039-1">(</span><span class="s">"And furthermore"</span><span class="p" data-group-id="5473754039-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">ellipsis</span><span class="p" data-group-id="3197624080-1">(</span><span class="s">"And furthermore"</span><span class="p" data-group-id="3197624080-1">)</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="p" data-group-id="5473754039-2">(</span><span class="p" data-group-id="5473754039-3">[</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="5473754039-3">]</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" data-group-id="5473754039-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">ellipsis</span><span class="p" data-group-id="3197624080-2">(</span><span class="p" data-group-id="3197624080-3">[</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="3197624080-3">]</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" data-group-id="3197624080-2">)</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="p" data-group-id="5473754039-4">(</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="p" data-group-id="5473754039-4">)</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="p" data-group-id="3197624080-4">(</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="p" data-group-id="3197624080-4">)</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="p" data-group-id="5473754039-5">(</span><span class="p" data-group-id="5473754039-6">[</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="5473754039-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="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="p" data-group-id="5473754039-5">)</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="p" data-group-id="3197624080-5">(</span><span class="p" data-group-id="3197624080-6">[</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="3197624080-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="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="p" data-group-id="3197624080-5">)</span><span class="w">
|
||||
</span><span class="s">"And furthermore … there is much to be done"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -715,23 +715,23 @@ take an optional locale parameter for which a locale is not supplied.</p><h2 id=
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="4817852660-1">(</span><span class="s">"pl"</span><span class="p" data-group-id="4817852660-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="p" data-group-id="4817852660-2">(</span><span class="p" data-group-id="4817852660-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4817852660-3">%</span><span class="nc" data-group-id="4817852660-3">Cldr.LanguageTag</span><span class="p" data-group-id="4817852660-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="1609494233-1">(</span><span class="s">"pl"</span><span class="p" data-group-id="1609494233-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="p" data-group-id="1609494233-2">(</span><span class="p" data-group-id="1609494233-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1609494233-3">%</span><span class="nc" data-group-id="1609494233-3">Cldr.LanguageTag</span><span class="p" data-group-id="1609494233-3">{</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="4817852660-4">%{</span><span class="p" data-group-id="4817852660-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="1609494233-4">%{</span><span class="p" data-group-id="1609494233-4">}</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="4817852660-5">%{</span><span class="p" data-group-id="4817852660-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="4817852660-6">[</span><span class="p" data-group-id="4817852660-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="1609494233-5">%{</span><span class="p" data-group-id="1609494233-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="1609494233-6">[</span><span class="p" data-group-id="1609494233-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">: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="4817852660-7">%{</span><span class="p" data-group-id="4817852660-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="4817852660-8">[</span><span class="p" data-group-id="4817852660-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4817852660-3">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1609494233-7">%{</span><span class="p" data-group-id="1609494233-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="1609494233-8">[</span><span class="p" data-group-id="1609494233-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="1609494233-3">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_calendars/0">
|
||||
@ -818,10 +818,10 @@ take an optional locale parameter for which a locale is not supplied.</p><h2 id=
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="1573200975-1">(</span><span class="s">"en"</span><span class="p" data-group-id="1573200975-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="3437814455-1">(</span><span class="s">"en"</span><span class="p" data-group-id="3437814455-1">)</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</span><span class="o">.</span><span class="n">known_gettext_locale_name</span><span class="p" data-group-id="1573200975-2">(</span><span class="s">"en-SA"</span><span class="p" data-group-id="1573200975-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="3437814455-2">(</span><span class="s">"en-SA"</span><span class="p" data-group-id="3437814455-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -864,10 +864,10 @@ name is configured and available in Gettext.</p><h2 id="known_gettext_locale_nam
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="1316697952-1">(</span><span class="s">"en"</span><span class="p" data-group-id="1316697952-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="5589379399-1">(</span><span class="s">"en"</span><span class="p" data-group-id="5589379399-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="1316697952-2">(</span><span class="s">"!!"</span><span class="p" data-group-id="1316697952-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="5589379399-2">(</span><span class="s">"!!"</span><span class="p" data-group-id="5589379399-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -941,10 +941,10 @@ to return the first known locale name from a list.</p><h2 id="known_locale_name/
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="9166643877-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="9166643877-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="7743580270-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="7743580270-1">)</span><span class="w">
|
||||
</span><span class="ss">:"en-AU"</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="9166643877-2">(</span><span class="ss">:"en-SA"</span><span class="p" data-group-id="9166643877-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="7743580270-2">(</span><span class="ss">:"en-SA"</span><span class="p" data-group-id="7743580270-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -986,10 +986,10 @@ name is configured and available in Cldr.</p><h2 id="known_locale_name?/1-argume
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="7314281266-1">(</span><span class="ss">:en</span><span class="p" data-group-id="7314281266-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="2964968057-1">(</span><span class="ss">:en</span><span class="p" data-group-id="2964968057-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="7314281266-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="7314281266-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="2964968057-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="2964968057-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1043,8 +1043,8 @@ in this module or in <a href="https://hexdocs.pm/gettext/0.24.0/Gettext.html"><c
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="p" data-group-id="0065619062-1">(</span><span class="p" data-group-id="0065619062-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0065619062-2">[</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="0065619062-2">]</span></code></pre>
|
||||
<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="p" data-group-id="3817190234-1">(</span><span class="p" data-group-id="3817190234-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3817190234-2">[</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="3817190234-2">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_number_systems/0">
|
||||
@ -1109,10 +1109,10 @@ and has RBNF rules defined.</p><h2 id="known_rbnf_locale_name/1-arguments" class
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="7287749336-1">(</span><span class="ss">:en</span><span class="p" data-group-id="7287749336-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="9664249540-1">(</span><span class="ss">:en</span><span class="p" data-group-id="9664249540-1">)</span><span class="w">
|
||||
</span><span class="ss">:en</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="7287749336-2">(</span><span class="ss">:"en-SA"</span><span class="p" data-group-id="7287749336-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="9664249540-2">(</span><span class="ss">:"en-SA"</span><span class="p" data-group-id="9664249540-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1155,10 +1155,10 @@ rules based number formats (RBNF).</p><h2 id="known_rbnf_locale_name?/1-argument
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="8041118251-1">(</span><span class="ss">:en</span><span class="p" data-group-id="8041118251-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="1211627606-1">(</span><span class="ss">:en</span><span class="p" data-group-id="1211627606-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="8041118251-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="8041118251-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="1211627606-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="1211627606-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1294,14 +1294,14 @@ CLDR backend defined by the <code class="inline">t:Cldr.LanguageTag</code> is se
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="kn">import</span><span class="w"> </span><span class="nc">Cldr.LanguageTag.Sigil</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_gettext_locale</span><span class="p" data-group-id="2744797251-1">(</span><span class="sx">~l"en"</span><span class="p" data-group-id="2744797251-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2744797251-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="2744797251-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_gettext_locale</span><span class="p" data-group-id="1884343873-1">(</span><span class="sx">~l"en"</span><span class="p" data-group-id="1884343873-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1884343873-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="1884343873-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="kn">import</span><span class="w"> </span><span class="nc">Cldr.LanguageTag.Sigil</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_gettext_locale</span><span class="p" data-group-id="2744797251-3">(</span><span class="sx">~l"de"</span><span class="p" data-group-id="2744797251-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2744797251-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2744797251-5">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Locale #Cldr.LanguageTag<de [validated]> does not map to a known gettext locale name"</span><span class="p" data-group-id="2744797251-5">}</span><span class="p" data-group-id="2744797251-4">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_gettext_locale</span><span class="p" data-group-id="1884343873-3">(</span><span class="sx">~l"de"</span><span class="p" data-group-id="1884343873-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1884343873-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1884343873-5">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Locale #Cldr.LanguageTag<de [validated]> does not map to a known gettext locale name"</span><span class="p" data-group-id="1884343873-5">}</span><span class="p" data-group-id="1884343873-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="put_locale/1">
|
||||
@ -1345,29 +1345,29 @@ of a language tag.</p><h2 id="put_locale/1-examples" class="section-heading">
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="0360384924-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0360384924-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0360384924-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0360384924-3">%</span><span class="nc" data-group-id="0360384924-3">Cldr.LanguageTag</span><span class="p" data-group-id="0360384924-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="5342309921-1">(</span><span class="s">"en"</span><span class="p" data-group-id="5342309921-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5342309921-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5342309921-3">%</span><span class="nc" data-group-id="5342309921-3">Cldr.LanguageTag</span><span class="p" data-group-id="5342309921-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="0360384924-4">[</span><span class="p" data-group-id="0360384924-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="0360384924-5">%{</span><span class="p" data-group-id="0360384924-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="5342309921-4">[</span><span class="p" data-group-id="5342309921-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="5342309921-5">%{</span><span class="p" data-group-id="5342309921-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="0360384924-6">%{</span><span class="p" data-group-id="0360384924-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="0360384924-7">[</span><span class="p" data-group-id="0360384924-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="5342309921-6">%{</span><span class="p" data-group-id="5342309921-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="5342309921-7">[</span><span class="p" data-group-id="5342309921-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="0360384924-8">%{</span><span class="p" data-group-id="0360384924-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="0360384924-9">[</span><span class="p" data-group-id="0360384924-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0360384924-3">}</span><span class="p" data-group-id="0360384924-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="5342309921-8">%{</span><span class="p" data-group-id="5342309921-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="5342309921-9">[</span><span class="p" data-group-id="5342309921-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5342309921-3">}</span><span class="p" data-group-id="5342309921-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="0360384924-10">(</span><span class="s">"invalid-locale!"</span><span class="p" data-group-id="0360384924-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0360384924-11">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0360384924-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="0360384924-12">}</span><span class="p" data-group-id="0360384924-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="5342309921-10">(</span><span class="s">"invalid-locale!"</span><span class="p" data-group-id="5342309921-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5342309921-11">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5342309921-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="5342309921-12">}</span><span class="p" data-group-id="5342309921-11">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="quote/2">
|
||||
@ -1416,10 +1416,10 @@ The default is <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.html#get_locale/0
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="k">quote</span><span class="p" data-group-id="4018636147-1">(</span><span class="s">"Quoted String"</span><span class="p" data-group-id="4018636147-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="k">quote</span><span class="p" data-group-id="2452182459-1">(</span><span class="s">"Quoted String"</span><span class="p" data-group-id="2452182459-1">)</span><span class="w">
|
||||
</span><span class="s">"“Quoted String”"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="k">quote</span><span class="p" data-group-id="4018636147-2">(</span><span class="s">"Quoted String"</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" data-group-id="4018636147-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="k">quote</span><span class="p" data-group-id="2452182459-2">(</span><span class="s">"Quoted String"</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" data-group-id="2452182459-2">)</span><span class="w">
|
||||
</span><span class="s">"「Quoted String」"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1550,47 +1550,47 @@ of a language tag.</p><h2 id="validate_locale/1-examples" class="section-heading
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="7845096967-1">(</span><span class="ss">:en</span><span class="p" data-group-id="7845096967-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7845096967-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7845096967-3">%</span><span class="nc" data-group-id="7845096967-3">Cldr.LanguageTag</span><span class="p" data-group-id="7845096967-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="2681376039-1">(</span><span class="ss">:en</span><span class="p" data-group-id="2681376039-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2681376039-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2681376039-3">%</span><span class="nc" data-group-id="2681376039-3">Cldr.LanguageTag</span><span class="p" data-group-id="2681376039-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="7845096967-4">%{</span><span class="p" data-group-id="7845096967-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="2681376039-4">%{</span><span class="p" data-group-id="2681376039-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="7845096967-5">%{</span><span class="p" data-group-id="7845096967-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="7845096967-6">[</span><span class="p" data-group-id="7845096967-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="2681376039-5">%{</span><span class="p" data-group-id="2681376039-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="2681376039-6">[</span><span class="p" data-group-id="2681376039-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="7845096967-7">%{</span><span class="p" data-group-id="7845096967-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="7845096967-8">[</span><span class="p" data-group-id="7845096967-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7845096967-3">}</span><span class="p" data-group-id="7845096967-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="2681376039-7">%{</span><span class="p" data-group-id="2681376039-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="2681376039-8">[</span><span class="p" data-group-id="2681376039-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2681376039-3">}</span><span class="p" data-group-id="2681376039-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="7845096967-9">(</span><span class="p" data-group-id="7845096967-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7845096967-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7845096967-11">%</span><span class="nc" data-group-id="7845096967-11">Cldr.LanguageTag</span><span class="p" data-group-id="7845096967-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="2681376039-9">(</span><span class="p" data-group-id="2681376039-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2681376039-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2681376039-11">%</span><span class="nc" data-group-id="2681376039-11">Cldr.LanguageTag</span><span class="p" data-group-id="2681376039-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="7845096967-12">%{</span><span class="p" data-group-id="7845096967-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="2681376039-12">%{</span><span class="p" data-group-id="2681376039-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="7845096967-13">%{</span><span class="p" data-group-id="7845096967-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="7845096967-14">[</span><span class="p" data-group-id="7845096967-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="2681376039-13">%{</span><span class="p" data-group-id="2681376039-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="2681376039-14">[</span><span class="p" data-group-id="2681376039-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="7845096967-15">%{</span><span class="p" data-group-id="7845096967-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="7845096967-16">[</span><span class="p" data-group-id="7845096967-16">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7845096967-11">}</span><span class="p" data-group-id="7845096967-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="2681376039-15">%{</span><span class="p" data-group-id="2681376039-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="2681376039-16">[</span><span class="p" data-group-id="2681376039-16">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2681376039-11">}</span><span class="p" data-group-id="2681376039-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="7845096967-17">(</span><span class="s">"zzz"</span><span class="p" data-group-id="7845096967-17">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7845096967-18">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7845096967-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="7845096967-19">}</span><span class="p" data-group-id="7845096967-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="2681376039-17">(</span><span class="s">"zzz"</span><span class="p" data-group-id="2681376039-17">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2681376039-18">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2681376039-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="2681376039-19">}</span><span class="p" data-group-id="2681376039-18">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="validate_number_system/1">
|
||||
@ -1660,23 +1660,23 @@ of a language tag.</p><h2 id="validate_locale/1-examples" class="section-heading
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="p" data-group-id="0307061346-1">(</span><span class="ss">:default</span><span class="p" data-group-id="0307061346-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0307061346-2">{</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="0307061346-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">validate_number_system_type</span><span class="p" data-group-id="7643467729-1">(</span><span class="ss">:default</span><span class="p" data-group-id="7643467729-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7643467729-2">{</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="7643467729-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="p" data-group-id="0307061346-3">(</span><span class="ss">:traditional</span><span class="p" data-group-id="0307061346-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0307061346-4">{</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="0307061346-4">}</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="p" data-group-id="7643467729-3">(</span><span class="ss">:traditional</span><span class="p" data-group-id="7643467729-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7643467729-4">{</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="7643467729-4">}</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="p" data-group-id="0307061346-5">(</span><span class="ss">:latn</span><span class="p" data-group-id="0307061346-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0307061346-6">{</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="p" data-group-id="7643467729-5">(</span><span class="ss">:latn</span><span class="p" data-group-id="7643467729-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7643467729-6">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0307061346-7">{</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="0307061346-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0307061346-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7643467729-7">{</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="7643467729-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7643467729-6">}</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="p" data-group-id="0307061346-8">(</span><span class="s">"bork"</span><span class="p" data-group-id="0307061346-8">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0307061346-9">{</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="p" data-group-id="7643467729-8">(</span><span class="s">"bork"</span><span class="p" data-group-id="7643467729-8">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7643467729-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="0307061346-10">{</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="0307061346-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0307061346-9">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="7643467729-10">{</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="7643467729-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7643467729-9">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="validate_territory/1">
|
||||
|
@ -845,23 +845,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="7822529406-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="7822529406-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="9975409618-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="9975409618-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="7822529406-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="9975409618-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="7822529406-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="9975409618-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="7822529406-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="7822529406-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="9975409618-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="9975409618-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="7822529406-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="7822529406-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="7822529406-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="7822529406-7">(</span><span class="n">i</span><span class="p" data-group-id="7822529406-7">)</span><span class="p" data-group-id="7822529406-6">}</span><span class="w"> </span><span class="k" data-group-id="7822529406-5">end</span><span class="p" data-group-id="7822529406-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7822529406-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="7822529406-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="7822529406-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="7822529406-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="9975409618-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="9975409618-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="9975409618-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="9975409618-7">(</span><span class="n">i</span><span class="p" data-group-id="9975409618-7">)</span><span class="p" data-group-id="9975409618-6">}</span><span class="w"> </span><span class="k" data-group-id="9975409618-5">end</span><span class="p" data-group-id="9975409618-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9975409618-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="9975409618-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="9975409618-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="9975409618-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="7822529406-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="7822529406-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="7822529406-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="7822529406-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="7822529406-13">(</span><span class="p" data-group-id="7822529406-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="7822529406-12">]</span><span class="p" data-group-id="7822529406-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="9975409618-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="9975409618-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="9975409618-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="9975409618-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="9975409618-13">(</span><span class="p" data-group-id="9975409618-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="9975409618-12">]</span><span class="p" data-group-id="9975409618-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -1152,23 +1152,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="5501667703-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="5501667703-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="2141757248-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="2141757248-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="5501667703-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="2141757248-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="5501667703-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="2141757248-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="5501667703-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5501667703-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="2141757248-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="2141757248-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="5501667703-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="5501667703-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="5501667703-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="5501667703-7">(</span><span class="n">i</span><span class="p" data-group-id="5501667703-7">)</span><span class="p" data-group-id="5501667703-6">}</span><span class="w"> </span><span class="k" data-group-id="5501667703-5">end</span><span class="p" data-group-id="5501667703-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5501667703-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="5501667703-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="5501667703-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="5501667703-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="2141757248-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="2141757248-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="2141757248-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="2141757248-7">(</span><span class="n">i</span><span class="p" data-group-id="2141757248-7">)</span><span class="p" data-group-id="2141757248-6">}</span><span class="w"> </span><span class="k" data-group-id="2141757248-5">end</span><span class="p" data-group-id="2141757248-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2141757248-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="2141757248-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="2141757248-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="2141757248-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="5501667703-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="5501667703-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="5501667703-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="5501667703-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="5501667703-13">(</span><span class="p" data-group-id="5501667703-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="5501667703-12">]</span><span class="p" data-group-id="5501667703-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="2141757248-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="2141757248-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="2141757248-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="2141757248-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="2141757248-13">(</span><span class="p" data-group-id="2141757248-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="2141757248-12">]</span><span class="p" data-group-id="2141757248-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -260,8 +260,8 @@ and MaxMind license key.</p></div>
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="9633608495-1">(</span><span class="p" data-group-id="9633608495-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="2648508594-1">(</span><span class="p" data-group-id="2648508594-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="4821107407-1">(</span><span class="p" data-group-id="4821107407-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="5173337896-1">(</span><span class="p" data-group-id="5173337896-1">)</span><span class="w">
|
||||
</span><span class="s">"GeoLite2-City"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -301,8 +301,8 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="6301946376-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="6301946376-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="9457600900-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="9457600900-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="7131648173-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="7131648173-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="0314401142-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="0314401142-1">)</span><span class="w">
|
||||
</span><span class="ss">:ok</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -331,21 +331,21 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="9944300349-1">(</span><span class="s">"8.7.6.5"</span><span class="p" data-group-id="9944300349-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-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="9944300349-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="5513649956-1">(</span><span class="s">"8.7.6.5"</span><span class="p" data-group-id="5513649956-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-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="5513649956-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="9944300349-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="5513649956-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="9944300349-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-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="9944300349-5">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-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="5513649956-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="9944300349-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="5513649956-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">
|
||||
@ -354,12 +354,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="9944300349-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-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="9944300349-7">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-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="5513649956-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="9944300349-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="5513649956-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">
|
||||
@ -368,20 +368,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="9944300349-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-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="9944300349-9">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-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="5513649956-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="9944300349-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="9944300349-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="9944300349-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="9944300349-11">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-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="5513649956-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="5513649956-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="5513649956-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="9944300349-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="5513649956-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">
|
||||
@ -390,13 +390,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="9944300349-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-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="9944300349-13">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-14">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-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="5513649956-13">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-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="9944300349-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="5513649956-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">
|
||||
@ -405,10 +405,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="9944300349-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-13">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9944300349-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5513649956-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-13">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="5513649956-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -1143,23 +1143,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="9903665214-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="9903665214-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="0149280843-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="0149280843-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="9903665214-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="0149280843-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="9903665214-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="0149280843-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="9903665214-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="9903665214-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="0149280843-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="0149280843-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="9903665214-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="9903665214-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="9903665214-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="9903665214-7">(</span><span class="n">i</span><span class="p" data-group-id="9903665214-7">)</span><span class="p" data-group-id="9903665214-6">}</span><span class="w"> </span><span class="k" data-group-id="9903665214-5">end</span><span class="p" data-group-id="9903665214-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9903665214-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="9903665214-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="9903665214-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="9903665214-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="0149280843-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="0149280843-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="0149280843-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="0149280843-7">(</span><span class="n">i</span><span class="p" data-group-id="0149280843-7">)</span><span class="p" data-group-id="0149280843-6">}</span><span class="w"> </span><span class="k" data-group-id="0149280843-5">end</span><span class="p" data-group-id="0149280843-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0149280843-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="0149280843-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="0149280843-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="0149280843-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="9903665214-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="9903665214-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="9903665214-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="9903665214-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="9903665214-13">(</span><span class="p" data-group-id="9903665214-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="9903665214-12">]</span><span class="p" data-group-id="9903665214-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="0149280843-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="0149280843-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="0149280843-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="0149280843-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="0149280843-13">(</span><span class="p" data-group-id="0149280843-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="0149280843-12">]</span><span class="p" data-group-id="0149280843-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -1143,23 +1143,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="3001931742-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="3001931742-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="2520909446-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="2520909446-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="3001931742-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="2520909446-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="3001931742-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="2520909446-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="3001931742-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="3001931742-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="2520909446-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="2520909446-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="3001931742-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="3001931742-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="3001931742-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="3001931742-7">(</span><span class="n">i</span><span class="p" data-group-id="3001931742-7">)</span><span class="p" data-group-id="3001931742-6">}</span><span class="w"> </span><span class="k" data-group-id="3001931742-5">end</span><span class="p" data-group-id="3001931742-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3001931742-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="3001931742-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="3001931742-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="3001931742-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="2520909446-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="2520909446-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="2520909446-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="2520909446-7">(</span><span class="n">i</span><span class="p" data-group-id="2520909446-7">)</span><span class="p" data-group-id="2520909446-6">}</span><span class="w"> </span><span class="k" data-group-id="2520909446-5">end</span><span class="p" data-group-id="2520909446-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2520909446-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="2520909446-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="2520909446-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="2520909446-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="3001931742-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="3001931742-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="3001931742-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="3001931742-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="3001931742-13">(</span><span class="p" data-group-id="3001931742-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="3001931742-12">]</span><span class="p" data-group-id="3001931742-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="2520909446-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="2520909446-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="2520909446-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="2520909446-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="2520909446-13">(</span><span class="p" data-group-id="2520909446-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="2520909446-12">]</span><span class="p" data-group-id="2520909446-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -207,14 +207,14 @@ Pages
|
||||
</a>
|
||||
<span class="text">Examples:</span>
|
||||
</h3>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">FilterParser</span><span class="o">.</span><span class="n">parse_filters</span><span class="p" data-group-id="3165689153-1">(</span><span class="s">"{</span><span class="se">\"</span><span class="s">page</span><span class="se">\"</span><span class="s">:</span><span class="se">\"</span><span class="s">/blog/**</span><span class="se">\"</span><span class="s">}"</span><span class="p" data-group-id="3165689153-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3165689153-2">%{</span><span class="s">"page"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"/blog/**"</span><span class="p" data-group-id="3165689153-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">FilterParser</span><span class="o">.</span><span class="n">parse_filters</span><span class="p" data-group-id="9064003069-1">(</span><span class="s">"{</span><span class="se">\"</span><span class="s">page</span><span class="se">\"</span><span class="s">:</span><span class="se">\"</span><span class="s">/blog/**</span><span class="se">\"</span><span class="s">}"</span><span class="p" data-group-id="9064003069-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9064003069-2">%{</span><span class="s">"page"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"/blog/**"</span><span class="p" data-group-id="9064003069-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">FilterParser</span><span class="o">.</span><span class="n">parse_filters</span><span class="p" data-group-id="3165689153-3">(</span><span class="s">"visit:browser!=Chrome"</span><span class="p" data-group-id="3165689153-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3165689153-4">%{</span><span class="s">"visit:browser"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="3165689153-5">{</span><span class="ss">:is_not</span><span class="p">,</span><span class="w"> </span><span class="s">"Chrome"</span><span class="p" data-group-id="3165689153-5">}</span><span class="p" data-group-id="3165689153-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">FilterParser</span><span class="o">.</span><span class="n">parse_filters</span><span class="p" data-group-id="9064003069-3">(</span><span class="s">"visit:browser!=Chrome"</span><span class="p" data-group-id="9064003069-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9064003069-4">%{</span><span class="s">"visit:browser"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9064003069-5">{</span><span class="ss">:is_not</span><span class="p">,</span><span class="w"> </span><span class="s">"Chrome"</span><span class="p" data-group-id="9064003069-5">}</span><span class="p" data-group-id="9064003069-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">FilterParser</span><span class="o">.</span><span class="n">parse_filters</span><span class="p" data-group-id="3165689153-6">(</span><span class="no">nil</span><span class="p" data-group-id="3165689153-6">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3165689153-7">%{</span><span class="p" data-group-id="3165689153-7">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">FilterParser</span><span class="o">.</span><span class="n">parse_filters</span><span class="p" data-group-id="9064003069-6">(</span><span class="no">nil</span><span class="p" data-group-id="9064003069-6">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9064003069-7">%{</span><span class="p" data-group-id="9064003069-7">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
BIN
Plausible.epub
BIN
Plausible.epub
Binary file not shown.
@ -747,13 +747,13 @@ and <code class="inline">month</code>. The default depends on the <code class="i
|
||||
<code class="inline">Plausible.Query.from/2</code> for each default.</p></li><li><p><code class="inline">filters</code> - optional filters to drill down data. See the Stats API
|
||||
<a href="https://plausible.io/docs/stats-api#filtering">"Filtering"</a> section for
|
||||
more details.</p></li><li><p><code class="inline">with_imported</code> - boolean indicating whether to include Google Analytics
|
||||
imported data or not. Defaults to <code class="inline">false</code>.</p></li></ul><p>Full example:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="2320348930-1">%{</span><span class="w">
|
||||
imported data or not. Defaults to <code class="inline">false</code>.</p></li></ul><p>Full example:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="2468551857-1">%{</span><span class="w">
|
||||
</span><span class="s">"from"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"2021-09-06"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"interval"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"month"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"metric"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"visitors"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"period"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"custom"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"to"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"2021-12-13"</span><span class="w">
|
||||
</span><span class="p" data-group-id="2320348930-1">}</span></code></pre><h2 id="main_graph/2-response" class="section-heading">
|
||||
</span><span class="p" data-group-id="2468551857-1">}</span></code></pre><h2 id="main_graph/2-response" class="section-heading">
|
||||
<a href="#main_graph/2-response" class="hover-link">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
</a>
|
||||
@ -768,20 +768,20 @@ cut off by the requested date range or not. For example, if looking at a
|
||||
month week-by-week, some weeks may be cut off by the month boundaries.
|
||||
It's useful to adjust the graph display slightly in case the interval is
|
||||
not 'full' so that the user understands why the numbers might be lower for
|
||||
those partial periods.</p></li></ul><p>Full example:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="9166793746-1">%{</span><span class="w">
|
||||
</span><span class="s">"full_intervals"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9166793746-2">%{</span><span class="w">
|
||||
those partial periods.</p></li></ul><p>Full example:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="7548547238-1">%{</span><span class="w">
|
||||
</span><span class="s">"full_intervals"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="7548547238-2">%{</span><span class="w">
|
||||
</span><span class="s">"2021-09-01"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"2021-10-01"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"2021-11-01"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"2021-12-01"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="p" data-group-id="9166793746-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7548547238-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"imported_source"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"interval"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"month"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"labels"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9166793746-3">[</span><span class="s">"2021-09-01"</span><span class="p">,</span><span class="w"> </span><span class="s">"2021-10-01"</span><span class="p">,</span><span class="w"> </span><span class="s">"2021-11-01"</span><span class="p">,</span><span class="w"> </span><span class="s">"2021-12-01"</span><span class="p" data-group-id="9166793746-3">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"plot"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9166793746-4">[</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="9166793746-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"labels"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="7548547238-3">[</span><span class="s">"2021-09-01"</span><span class="p">,</span><span class="w"> </span><span class="s">"2021-10-01"</span><span class="p">,</span><span class="w"> </span><span class="s">"2021-11-01"</span><span class="p">,</span><span class="w"> </span><span class="s">"2021-12-01"</span><span class="p" data-group-id="7548547238-3">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"plot"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="7548547238-4">[</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="7548547238-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"present_index"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"with_imported"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="p" data-group-id="9166793746-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="7548547238-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="operating_system_versions/2">
|
||||
|
@ -153,18 +153,18 @@ on connections with high latency.</p><h2 id="module-usage" class="section-headin
|
||||
<span class="text">Usage</span>
|
||||
</h2>
|
||||
<p>An example use case for a modal is embedding a form inside
|
||||
existing live view which allows adding new entries of some kind:</p><pre><code class="makeup elixir" translate="no"><span class="o"><</span><span class="o">.</span><span class="n">live_component</span><span class="w"> </span><span class="n">module</span><span class="o">=</span><span class="p" data-group-id="5293178136-1">{</span><span class="nc">Modal</span><span class="p" data-group-id="5293178136-1">}</span><span class="w"> </span><span class="n">id</span><span class="o">=</span><span class="s">"some-form-modal"</span><span class="o">></span><span class="w">
|
||||
existing live view which allows adding new entries of some kind:</p><pre><code class="makeup elixir" translate="no"><span class="o"><</span><span class="o">.</span><span class="n">live_component</span><span class="w"> </span><span class="n">module</span><span class="o">=</span><span class="p" data-group-id="6338513357-1">{</span><span class="nc">Modal</span><span class="p" data-group-id="6338513357-1">}</span><span class="w"> </span><span class="n">id</span><span class="o">=</span><span class="s">"some-form-modal"</span><span class="o">></span><span class="w">
|
||||
</span><span class="o"><</span><span class="o">.</span><span class="n">live_component</span><span class="w">
|
||||
</span><span class="n">module</span><span class="o">=</span><span class="p" data-group-id="5293178136-2">{</span><span class="nc">SomeForm</span><span class="p" data-group-id="5293178136-2">}</span><span class="w">
|
||||
</span><span class="n">module</span><span class="o">=</span><span class="p" data-group-id="6338513357-2">{</span><span class="nc">SomeForm</span><span class="p" data-group-id="6338513357-2">}</span><span class="w">
|
||||
</span><span class="n">id</span><span class="o">=</span><span class="s">"some-form"</span><span class="w">
|
||||
</span><span class="n">on_save_form</span><span class="o">=</span><span class="p" data-group-id="5293178136-3">{</span><span class="w">
|
||||
</span><span class="k" data-group-id="5293178136-4">fn</span><span class="w"> </span><span class="n">entry</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="w"> </span><span class="o">-></span><span class="w">
|
||||
</span><span class="n">send</span><span class="p" data-group-id="5293178136-5">(</span><span class="n">self</span><span class="p" data-group-id="5293178136-6">(</span><span class="p" data-group-id="5293178136-6">)</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5293178136-7">{</span><span class="ss">:entry_added</span><span class="p">,</span><span class="w"> </span><span class="n">entry</span><span class="p" data-group-id="5293178136-7">}</span><span class="p" data-group-id="5293178136-5">)</span><span class="w">
|
||||
</span><span class="nc">Modal</span><span class="o">.</span><span class="n">close</span><span class="p" data-group-id="5293178136-8">(</span><span class="n">socket</span><span class="p">,</span><span class="w"> </span><span class="s">"some-form-modal"</span><span class="p" data-group-id="5293178136-8">)</span><span class="w">
|
||||
</span><span class="k" data-group-id="5293178136-4">end</span><span class="w">
|
||||
</span><span class="p" data-group-id="5293178136-3">}</span><span class="w">
|
||||
</span><span class="n">on_save_form</span><span class="o">=</span><span class="p" data-group-id="6338513357-3">{</span><span class="w">
|
||||
</span><span class="k" data-group-id="6338513357-4">fn</span><span class="w"> </span><span class="n">entry</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="w"> </span><span class="o">-></span><span class="w">
|
||||
</span><span class="n">send</span><span class="p" data-group-id="6338513357-5">(</span><span class="n">self</span><span class="p" data-group-id="6338513357-6">(</span><span class="p" data-group-id="6338513357-6">)</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6338513357-7">{</span><span class="ss">:entry_added</span><span class="p">,</span><span class="w"> </span><span class="n">entry</span><span class="p" data-group-id="6338513357-7">}</span><span class="p" data-group-id="6338513357-5">)</span><span class="w">
|
||||
</span><span class="nc">Modal</span><span class="o">.</span><span class="n">close</span><span class="p" data-group-id="6338513357-8">(</span><span class="n">socket</span><span class="p">,</span><span class="w"> </span><span class="s">"some-form-modal"</span><span class="p" data-group-id="6338513357-8">)</span><span class="w">
|
||||
</span><span class="k" data-group-id="6338513357-4">end</span><span class="w">
|
||||
</span><span class="p" data-group-id="6338513357-3">}</span><span class="w">
|
||||
</span><span class="o">/</span><span class="o">></span><span class="w">
|
||||
</span><span class="o"><</span><span class="o">/</span><span class="o">.</span><span class="n">live_component</span><span class="o">></span></code></pre><p>Then somewhere in the same live view the modal is rendered in:</p><pre><code class="makeup elixir" translate="no"><span class="o"><</span><span class="o">.</span><span class="n">button</span><span class="w"> </span><span class="n">x</span><span class="o">-</span><span class="n">data</span><span class="w"> </span><span class="n">x</span><span class="o">-</span><span class="n">on</span><span class="ss">:click</span><span class="o">=</span><span class="p" data-group-id="9385855329-1">{</span><span class="nc">Modal.JS</span><span class="o">.</span><span class="n">open</span><span class="p" data-group-id="9385855329-2">(</span><span class="s">"goals-form-modal"</span><span class="p" data-group-id="9385855329-2">)</span><span class="p" data-group-id="9385855329-1">}</span><span class="o">></span><span class="w">
|
||||
</span><span class="o"><</span><span class="o">/</span><span class="o">.</span><span class="n">live_component</span><span class="o">></span></code></pre><p>Then somewhere in the same live view the modal is rendered in:</p><pre><code class="makeup elixir" translate="no"><span class="o"><</span><span class="o">.</span><span class="n">button</span><span class="w"> </span><span class="n">x</span><span class="o">-</span><span class="n">data</span><span class="w"> </span><span class="n">x</span><span class="o">-</span><span class="n">on</span><span class="ss">:click</span><span class="o">=</span><span class="p" data-group-id="9024851706-1">{</span><span class="nc">Modal.JS</span><span class="o">.</span><span class="n">open</span><span class="p" data-group-id="9024851706-2">(</span><span class="s">"goals-form-modal"</span><span class="p" data-group-id="9024851706-2">)</span><span class="p" data-group-id="9024851706-1">}</span><span class="o">></span><span class="w">
|
||||
</span><span class="o">+</span><span class="w"> </span><span class="nc">Add</span><span class="w"> </span><span class="nc">Entry</span><span class="w">
|
||||
</span><span class="o"><</span><span class="o">/</span><span class="o">.</span><span class="n">button</span><span class="o">></span></code></pre><h2 id="module-explanation" class="section-heading">
|
||||
<a href="#module-explanation" class="hover-link">
|
||||
@ -184,26 +184,26 @@ itself - adding <code class="inline">x-data</code> attribute without any value i
|
||||
to ensure that.</p></li><li><p><code class="inline">Modal.close/2</code> - to close the modal from the backend; usually
|
||||
done inside wrapped component's <code class="inline">handle_event/2</code>. The example
|
||||
qouted above shows one way to implement this, under that assumption
|
||||
that the component exposes a callback, like this:</p><pre><code class="makeup elixir" translate="no"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">SomeForm</span><span class="w"> </span><span class="k" data-group-id="5561858292-1">do</span><span class="w">
|
||||
that the component exposes a callback, like this:</p><pre><code class="makeup elixir" translate="no"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">SomeForm</span><span class="w"> </span><span class="k" data-group-id="7433488647-1">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Phoenix.LiveComponent</span><span class="w">
|
||||
|
||||
</span><span class="kd">def</span><span class="w"> </span><span class="nf">update</span><span class="p" data-group-id="5561858292-2">(</span><span class="n">assigns</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="p" data-group-id="5561858292-2">)</span><span class="w"> </span><span class="k" data-group-id="5561858292-3">do</span><span class="w">
|
||||
</span><span class="kd">def</span><span class="w"> </span><span class="nf">update</span><span class="p" data-group-id="7433488647-2">(</span><span class="n">assigns</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="p" data-group-id="7433488647-2">)</span><span class="w"> </span><span class="k" data-group-id="7433488647-3">do</span><span class="w">
|
||||
</span><span class="c1"># ...</span><span class="w">
|
||||
|
||||
</span><span class="p" data-group-id="5561858292-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">assign</span><span class="p" data-group-id="5561858292-5">(</span><span class="n">socket</span><span class="p">,</span><span class="w"> </span><span class="ss">:on_save_form</span><span class="p">,</span><span class="w"> </span><span class="n">assigns</span><span class="o">.</span><span class="n">on_save_form</span><span class="p" data-group-id="5561858292-5">)</span><span class="p" data-group-id="5561858292-4">}</span><span class="w">
|
||||
</span><span class="k" data-group-id="5561858292-3">end</span><span class="w">
|
||||
</span><span class="p" data-group-id="7433488647-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">assign</span><span class="p" data-group-id="7433488647-5">(</span><span class="n">socket</span><span class="p">,</span><span class="w"> </span><span class="ss">:on_save_form</span><span class="p">,</span><span class="w"> </span><span class="n">assigns</span><span class="o">.</span><span class="n">on_save_form</span><span class="p" data-group-id="7433488647-5">)</span><span class="p" data-group-id="7433488647-4">}</span><span class="w">
|
||||
</span><span class="k" data-group-id="7433488647-3">end</span><span class="w">
|
||||
|
||||
</span><span class="c1">#...</span><span class="w">
|
||||
|
||||
</span><span class="kd">def</span><span class="w"> </span><span class="nf">handle_event</span><span class="p" data-group-id="5561858292-6">(</span><span class="s">"save-form"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5561858292-7">%{</span><span class="s">"form"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="n">form</span><span class="p" data-group-id="5561858292-7">}</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="p" data-group-id="5561858292-6">)</span><span class="w"> </span><span class="k" data-group-id="5561858292-8">do</span><span class="w">
|
||||
</span><span class="k">case</span><span class="w"> </span><span class="n">save_entry</span><span class="p" data-group-id="5561858292-9">(</span><span class="n">form</span><span class="p" data-group-id="5561858292-9">)</span><span class="w"> </span><span class="k" data-group-id="5561858292-10">do</span><span class="w">
|
||||
</span><span class="p" data-group-id="5561858292-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">entry</span><span class="p" data-group-id="5561858292-11">}</span><span class="w"> </span><span class="o">-></span><span class="w">
|
||||
</span><span class="p" data-group-id="5561858292-12">{</span><span class="ss">:noreply</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="o">.</span><span class="n">assigns</span><span class="o">.</span><span class="n">on_save_form</span><span class="p" data-group-id="5561858292-13">(</span><span class="n">entry</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="p" data-group-id="5561858292-13">)</span><span class="p" data-group-id="5561858292-12">}</span><span class="w">
|
||||
</span><span class="kd">def</span><span class="w"> </span><span class="nf">handle_event</span><span class="p" data-group-id="7433488647-6">(</span><span class="s">"save-form"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7433488647-7">%{</span><span class="s">"form"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="n">form</span><span class="p" data-group-id="7433488647-7">}</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="p" data-group-id="7433488647-6">)</span><span class="w"> </span><span class="k" data-group-id="7433488647-8">do</span><span class="w">
|
||||
</span><span class="k">case</span><span class="w"> </span><span class="n">save_entry</span><span class="p" data-group-id="7433488647-9">(</span><span class="n">form</span><span class="p" data-group-id="7433488647-9">)</span><span class="w"> </span><span class="k" data-group-id="7433488647-10">do</span><span class="w">
|
||||
</span><span class="p" data-group-id="7433488647-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">entry</span><span class="p" data-group-id="7433488647-11">}</span><span class="w"> </span><span class="o">-></span><span class="w">
|
||||
</span><span class="p" data-group-id="7433488647-12">{</span><span class="ss">:noreply</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="o">.</span><span class="n">assigns</span><span class="o">.</span><span class="n">on_save_form</span><span class="p" data-group-id="7433488647-13">(</span><span class="n">entry</span><span class="p">,</span><span class="w"> </span><span class="n">socket</span><span class="p" data-group-id="7433488647-13">)</span><span class="p" data-group-id="7433488647-12">}</span><span class="w">
|
||||
|
||||
</span><span class="c1"># error case handling ...</span><span class="w">
|
||||
</span><span class="k" data-group-id="5561858292-10">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5561858292-8">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5561858292-1">end</span></code></pre><p>Using callback approach has an added benefit of making the
|
||||
</span><span class="k" data-group-id="7433488647-10">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="7433488647-8">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="7433488647-1">end</span></code></pre><p>Using callback approach has an added benefit of making the
|
||||
component more flexible.</p></li></ul>
|
||||
</section>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user