diff --git a/Plausible.AsyncInsertRepo.html b/Plausible.AsyncInsertRepo.html index 88dabca839536..2249db038af85 100644 --- a/Plausible.AsyncInsertRepo.html +++ b/Plausible.AsyncInsertRepo.html @@ -1116,23 +1116,23 @@

insert_stream(source_or_schema, rows, opts
-

Similar to insert_all/2 but with the following differences:

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
 
-defmodule Demo do
+defmodule Demo do
   use Ecto.Schema
 
   @primary_key false
-  schema "ecto_ch_demo" do
+  schema "ecto_ch_demo" do
     field :a, Ch, type: "UInt64"
     field :b, :string
-  end
-end
+  end
+end
 
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
 
 # schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
+
{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
diff --git a/Plausible.Cldr.AcceptLanguage.html b/Plausible.Cldr.AcceptLanguage.html index a297ab96a0218..7b0aef8e94701 100644 --- a/Plausible.Cldr.AcceptLanguage.html +++ b/Plausible.Cldr.AcceptLanguage.html @@ -119,7 +119,7 @@

the set of natural languages that are preferred as a response to the request. Language tags function are provided in Cldr.LanguageTag.

The format of an Accept-Language header is as follows in ABNF format:

   Accept-Language = "Accept-Language" ":"
                      1#( language-range [ ";" "q" "=" qvalue ] )
-   language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )

Each language-range MAY be given an associated quality value which represents an + language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )

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,

   Accept-Language: da, en-gb;q=0.8, en;q=0.7

would mean: "I prefer Danish, but will accept British English and other types of English."

@@ -234,54 +234,54 @@

best_match(accept_language)

Examples -
iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- %Cldr.LanguageTag{
+
iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ %Cldr.LanguageTag{
    backend: TestBackend.Cldr,
    canonical_locale_name: "zh-TW",
    cldr_locale_name: :"zh-Hant",
-   language_subtags: [],
-   extensions: %{},
+   language_subtags: [],
+   extensions: %{},
    gettext_locale_name: nil,
    language: "zh",
-   locale: %{},
-   private_use: [],
+   locale: %{},
+   private_use: [],
    rbnf_locale_name: :"zh-Hant",
    requested_locale_name: "zh-TW",
    script: :Hant,
    territory: :TW,
-   transform: %{},
-   language_variants: []
- }}
+   transform: %{},
+   language_variants: []
+ }}
 
-iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- %Cldr.LanguageTag{
+iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ %Cldr.LanguageTag{
    backend: TestBackend.Cldr,
    canonical_locale_name: "zh-TW",
    cldr_locale_name: :"zh-Hant",
-   language_subtags: [],
-   extensions: %{},
+   language_subtags: [],
+   extensions: %{},
    gettext_locale_name: nil,
    language: "zh",
-   locale: %{},
-   private_use: [],
+   locale: %{},
+   private_use: [],
    rbnf_locale_name: :"zh-Hant",
    requested_locale_name: "zh-TW",
    script: :Hant,
    territory: :TW,
-   transform: %{},
-   language_variants: []
- }}
-
-iex> Plausible.Cldr.AcceptLanguage.best_match("xx,yy;q=0.3")
-{:error,
- {Cldr.NoMatchingLocale,
-  "No configured locale could be matched to \"xx,yy;q=0.3\""}}
-
-iex> Plausible.Cldr.AcceptLanguage.best_match("invalid_tag")
-{:error, {Cldr.LanguageTag.ParseError,
-  "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
+
transform: %{}, + language_variants: [] + }} + +iex> Plausible.Cldr.AcceptLanguage.best_match("xx,yy;q=0.3") +{:error, + {Cldr.NoMatchingLocale, + "No configured locale could be matched to \"xx,yy;q=0.3\""}} + +iex> Plausible.Cldr.AcceptLanguage.best_match("invalid_tag") +{:error, {Cldr.LanguageTag.ParseError, + "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
@@ -342,95 +342,95 @@

parse(tokens_or_string)

Example -
iex> Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- [
-   {1.0,
-    %Cldr.LanguageTag{
+
iex> Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ [
+   {1.0,
+    %Cldr.LanguageTag{
       backend: TestBackend.Cldr,
       canonical_locale_name: "da",
       cldr_locale_name: :da,
-      language_subtags: [],
-      extensions: %{},
+      language_subtags: [],
+      extensions: %{},
       gettext_locale_name: nil,
       language: "da",
-      locale: %{},
-      private_use: [],
+      locale: %{},
+      private_use: [],
       rbnf_locale_name: :da,
       requested_locale_name: "da",
       script: :Latn,
       territory: :DK,
-      transform: %{},
-      language_variants: []
-    }},
-   {0.3,
-    %Cldr.LanguageTag{
+      transform: %{},
+      language_variants: []
+    }},
+   {0.3,
+    %Cldr.LanguageTag{
       backend: TestBackend.Cldr,
       canonical_locale_name: "zh-TW",
       cldr_locale_name: :"zh-Hant",
-      language_subtags: [],
-      extensions: %{},
+      language_subtags: [],
+      extensions: %{},
       gettext_locale_name: nil,
       language: "zh",
-      locale: %{},
-      private_use: [],
+      locale: %{},
+      private_use: [],
       rbnf_locale_name: :"zh-Hant",
       requested_locale_name: "zh-TW",
       script: :Hant,
       territory: :TW,
-      transform: %{},
-      language_variants: []
-    }}
- ]}
-
-iex> Plausible.Cldr.AcceptLanguage.parse("invalid_tag")
-{:error,
- {Cldr.LanguageTag.ParseError,
-  "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
-
-iex> Plausible.Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3,invalid_tag")
-{:ok,
- [
-   {1.0,
-    %Cldr.LanguageTag{
+      transform: %{},
+      language_variants: []
+    }}
+ ]}
+
+iex> Plausible.Cldr.AcceptLanguage.parse("invalid_tag")
+{:error,
+ {Cldr.LanguageTag.ParseError,
+  "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
+
+iex> Plausible.Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3,invalid_tag")
+{:ok,
+ [
+   {1.0,
+    %Cldr.LanguageTag{
       backend: TestBackend.Cldr,
       canonical_locale_name: "da",
       cldr_locale_name: :da,
-      language_subtags: [],
-      extensions: %{},
+      language_subtags: [],
+      extensions: %{},
       gettext_locale_name: nil,
       language: "da",
-      locale: %{},
-      private_use: [],
+      locale: %{},
+      private_use: [],
       rbnf_locale_name: :da,
       requested_locale_name: "da",
       script: :Latn,
       territory: :DK,
-      transform: %{},
-      language_variants: []
-    }},
-   {0.3,
-    %Cldr.LanguageTag{
+      transform: %{},
+      language_variants: []
+    }},
+   {0.3,
+    %Cldr.LanguageTag{
       backend: TestBackend.Cldr,
       canonical_locale_name: "zh-TW",
       cldr_locale_name: :"zh-Hant",
-      language_subtags: [],
-      extensions: %{},
+      language_subtags: [],
+      extensions: %{},
       gettext_locale_name: nil,
       language: "zh",
-      locale: %{},
-      private_use: [],
+      locale: %{},
+      private_use: [],
       rbnf_locale_name: :"zh-Hant",
       requested_locale_name: "zh-TW",
       script: :Hant,
       territory: :TW,
-      transform: %{},
-      language_variants: []
-    }},
-   {:error,
-    {Cldr.LanguageTag.ParseError,
-     "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
- ]}
+
transform: %{}, + language_variants: [] + }}, + {:error, + {Cldr.LanguageTag.ParseError, + "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}} + ]}
@@ -475,92 +475,92 @@

parse!(accept_language)

Example -
iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3")
-[
-  {1.0,
-   %Cldr.LanguageTag{
+
iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3")
+[
+  {1.0,
+   %Cldr.LanguageTag{
      backend: TestBackend.Cldr,
      canonical_locale_name: "da",
      cldr_locale_name: :da,
-     language_subtags: [],
-     extensions: %{},
+     language_subtags: [],
+     extensions: %{},
      gettext_locale_name: nil,
      language: "da",
-     locale: %{},
-     private_use: [],
+     locale: %{},
+     private_use: [],
      rbnf_locale_name: :da,
      requested_locale_name: "da",
      script: :Latn,
      territory: :DK,
-     transform: %{},
-     language_variants: []
-   }},
-  {0.3,
-   %Cldr.LanguageTag{
+     transform: %{},
+     language_variants: []
+   }},
+  {0.3,
+   %Cldr.LanguageTag{
      backend: TestBackend.Cldr,
      canonical_locale_name: "zh-TW",
      cldr_locale_name: :"zh-Hant",
-     language_subtags: [],
-     extensions: %{},
+     language_subtags: [],
+     extensions: %{},
      gettext_locale_name: nil,
      language: "zh",
-     locale: %{},
-     private_use: [],
+     locale: %{},
+     private_use: [],
      rbnf_locale_name: :"zh-Hant",
      requested_locale_name: "zh-TW",
      script: :Hant,
      territory: :TW,
-     transform: %{},
-     language_variants: []
-   }}
-]
+     transform: %{},
+     language_variants: []
+   }}
+]
 
 Plausible.Cldr.AcceptLanguage.parse! "invalid_tag"
 ** (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
 
-iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3,invalid_tag")
-[
-  {1.0,
-   %Cldr.LanguageTag{
+iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3,invalid_tag")
+[
+  {1.0,
+   %Cldr.LanguageTag{
      backend: TestBackend.Cldr,
      canonical_locale_name: "da",
      cldr_locale_name: :da,
-     language_subtags: [],
-     extensions: %{},
+     language_subtags: [],
+     extensions: %{},
      gettext_locale_name: nil,
      language: "da",
-     locale: %{},
-     private_use: [],
+     locale: %{},
+     private_use: [],
      rbnf_locale_name: :da,
      requested_locale_name: "da",
      script: :Latn,
      territory: :DK,
-     transform: %{},
-     language_variants: []
-   }},
-  {0.3,
-   %Cldr.LanguageTag{
+     transform: %{},
+     language_variants: []
+   }},
+  {0.3,
+   %Cldr.LanguageTag{
      backend: TestBackend.Cldr,
      canonical_locale_name: "zh-TW",
      cldr_locale_name: :"zh-Hant",
-     language_subtags: [],
-     extensions: %{},
+     language_subtags: [],
+     extensions: %{},
      gettext_locale_name: nil,
      language: "zh",
-     locale: %{},
-     private_use: [],
+     locale: %{},
+     private_use: [],
      rbnf_locale_name: :"zh-Hant",
      requested_locale_name: "zh-TW",
      script: :Hant,
      territory: :TW,
-     transform: %{},
-     language_variants: []
-   }},
-  {:error,
-   {Cldr.LanguageTag.ParseError,
-    "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
-]
+
transform: %{}, + language_variants: [] + }}, + {:error, + {Cldr.LanguageTag.ParseError, + "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}} +]
diff --git a/Plausible.Cldr.Currency.html b/Plausible.Cldr.Currency.html index ef2b0c7c1b848..5d03e4a01ef87 100644 --- a/Plausible.Cldr.Currency.html +++ b/Plausible.Cldr.Currency.html @@ -392,11 +392,11 @@

currencies_for_locale(locale, only \\ :all,

MyApp.Cldr.Currency.currencies_for_locale "en" => {:ok, - %{

 FJD: %Cldr.Currency{
+   %{

 FJD: %Cldr.Currency{
    cash_digits: 2,
    cash_rounding: 0,
    code: "FJD",
-   count: %{one: "Fijian dollar", other: "Fijian dollars"},
+   count: %{one: "Fijian dollar", other: "Fijian dollars"},
    digits: 2,
    from: nil,
    iso_digits: 2,
@@ -406,12 +406,12 @@ 

currencies_for_locale(locale, only \\ :all, symbol: "FJD", tender: true, to: nil - }, - SUR: %Cldr.Currency{ + }, + SUR: %Cldr.Currency{ cash_digits: 2, cash_rounding: 0, code: "SUR", - count: %{one: "Soviet rouble", other: "Soviet roubles"}, + count: %{one: "Soviet rouble", other: "Soviet roubles"}, digits: 2, from: nil, iso_digits: nil, @@ -421,7 +421,7 @@

currencies_for_locale(locale, only \\ :all, symbol: "SUR", tender: true, to: nil - }, + }, ... }}

@@ -472,11 +472,11 @@

currencies_for_locale!(locale, only \\ :all Example

MyApp.Cldr.Currency.currencies_for_locale! "en" - => %{

FJD: %Cldr.Currency{
+  => %{

FJD: %Cldr.Currency{
   cash_digits: 2,
   cash_rounding: 0,
   code: "FJD",
-  count: %{one: "Fijian dollar", other: "Fijian dollars"},
+  count: %{one: "Fijian dollar", other: "Fijian dollars"},
   digits: 2,
   from: nil,
   iso_digits: 2,
@@ -486,12 +486,12 @@ 

currencies_for_locale!(locale, only \\ :all symbol: "FJD", tender: true, to: nil -}, -SUR: %Cldr.Currency{ +}, +SUR: %Cldr.Currency{ cash_digits: 2, cash_rounding: 0, code: "SUR", - count: %{one: "Soviet rouble", other: "Soviet roubles"}, + count: %{one: "Soviet rouble", other: "Soviet roubles"}, digits: 2, from: nil, iso_digits: nil, @@ -501,7 +501,7 @@

currencies_for_locale!(locale, only \\ :all symbol: "SUR", tender: true, to: nil -}, +}, ...

}

@@ -559,13 +559,13 @@

currency_for_code(currency_or_currency_code Examples

-
iex> Plausible.Cldr.Currency.currency_for_code("AUD")
-{:ok,
-  %Cldr.Currency{
+
iex> Plausible.Cldr.Currency.currency_for_code("AUD")
+{:ok,
+  %Cldr.Currency{
     cash_digits: 2,
     cash_rounding: 0,
     code: "AUD",
-    count: %{one: "Australian dollar", other: "Australian dollars"},
+    count: %{one: "Australian dollar", other: "Australian dollars"},
     digits: 2,
     iso_digits: 2,
     name: "Australian Dollar",
@@ -573,15 +573,15 @@ 

currency_for_code(currency_or_currency_code rounding: 0, symbol: "A$", tender: true -}} +}} -iex> Plausible.Cldr.Currency.currency_for_code("THB") -{:ok, - %Cldr.Currency{ +iex> Plausible.Cldr.Currency.currency_for_code("THB") +{:ok, + %Cldr.Currency{ cash_digits: 2, cash_rounding: 0, code: "THB", - count: %{one: "Thai baht", other: "Thai baht"}, + count: %{one: "Thai baht", other: "Thai baht"}, digits: 2, iso_digits: 2, name: "Thai Baht", @@ -589,7 +589,7 @@

currency_for_code(currency_or_currency_code rounding: 0, symbol: "THB", tender: true -}}

+
}}
@@ -648,12 +648,12 @@

currency_for_code!(currency_or_currency_cod Examples

-
iex> Plausible.Cldr.Currency.currency_for_code!("AUD")
-%Cldr.Currency{
+
iex> Plausible.Cldr.Currency.currency_for_code!("AUD")
+%Cldr.Currency{
   cash_digits: 2,
   cash_rounding: 0,
   code: "AUD",
-  count: %{one: "Australian dollar", other: "Australian dollars"},
+  count: %{one: "Australian dollar", other: "Australian dollars"},
   digits: 2,
   iso_digits: 2,
   name: "Australian Dollar",
@@ -661,14 +661,14 @@ 

currency_for_code!(currency_or_currency_cod rounding: 0, symbol: "A$", tender: true -} +} -iex> Plausible.Cldr.Currency.currency_for_code!("THB") -%Cldr.Currency{ +iex> Plausible.Cldr.Currency.currency_for_code!("THB") +%Cldr.Currency{ cash_digits: 2, cash_rounding: 0, code: "THB", - count: %{one: "Thai baht", other: "Thai baht"}, + count: %{one: "Thai baht", other: "Thai baht"}, digits: 2, iso_digits: 2, name: "Thai Baht", @@ -676,7 +676,7 @@

currency_for_code!(currency_or_currency_cod rounding: 0, symbol: "THB", tender: true -}

+
}
@@ -717,11 +717,11 @@

currency_from_locale(locale)

Examples -
iex> {:ok, locale} = Plausible.Cldr.validate_locale "en"
+
iex> {:ok, locale} = Plausible.Cldr.validate_locale "en"
 iex> Plausible.Cldr.Currency.currency_from_locale locale
 :USD
 
-iex> {:ok, locale} = Plausible.Cldr.validate_locale "en-AU"
+iex> {:ok, locale} = Plausible.Cldr.validate_locale "en-AU"
 iex> Plausible.Cldr.Currency.currency_from_locale locale
 :AUD
 
@@ -770,13 +770,13 @@ 

currency_history_for_locale(language_tag)
iex> MyApp.Cldr.Currency.currency_history_for_locale "en"
-{:ok,
-    %{
-    USD: %{from: ~D[1792-01-01], to: nil},
-    USN: %{tender: false},
-    USS: %{from: nil, tender: false, to: ~D[2014-03-01]}
-  }
-}
+{:ok, + %{ + USD: %{from: ~D[1792-01-01], to: nil}, + USN: %{tender: false}, + USS: %{from: nil, tender: false, to: ~D[2014-03-01]} + } +}

@@ -836,8 +836,8 @@

currency_strings(locale, only \\ :all, exce Example

MyApp.Cldr.Currency.currency_strings "en"
-=> {:ok,
- %{
+=> {:ok,
+ %{
    "mexican silver pesos" => :MXP,
    "sudanese dinar" => :SDD,
    "bad" => :BAD,
@@ -847,7 +847,7 @@ 

currency_strings(locale, only \\ :all, exce "guyanaese dollars" => :GYD, "equatorial guinean ekwele" => :GQE, ... - }}

+ }}
@@ -907,7 +907,7 @@

currency_strings!(locale_name, only \\ :all Example

MyApp.Cldr.Currency.currency_strings! "en"
-=> %{
+=> %{
   "mexican silver pesos" => :MXP,
   "sudanese dinar" => :SDD,
   "bad" => :BAD,
@@ -917,7 +917,7 @@ 

currency_strings!(locale_name, only \\ :all "guyanaese dollars" => :GYD, "equatorial guinean ekwele" => :GQE, ... - }

+ }
@@ -1006,7 +1006,7 @@

current_territory_currencies()

Example -
iex> Plausible.Cldr.Currency.current_territory_currencies()
+
iex> Plausible.Cldr.Currency.current_territory_currencies()
@@ -1099,10 +1099,10 @@

known_currency_code(currency_code)

Examples
iex> Plausible.Cldr.Currency.known_currency_code "AUD"
-{:ok, :AUD}
+{:ok, :AUD}
 
 iex> Plausible.Cldr.Currency.known_currency_code "GGG"
-{:error, {Cldr.UnknownCurrencyError, "The currency \"GGG\" is invalid"}}
+{:error, {Cldr.UnknownCurrencyError, "The currency \"GGG\" is invalid"}}
@@ -1249,14 +1249,14 @@

new(currency, options \\ [])

Example -
iex> Plausible.Cldr.Currency.new(:XAE, name: "Custom Name", digits: 0)
-{:ok,
- %Cldr.Currency{
+
iex> Plausible.Cldr.Currency.new(:XAE, name: "Custom Name", digits: 0)
+{:ok,
+ %Cldr.Currency{
    alt_code: :XAE,
    cash_digits: 0,
    cash_rounding: nil,
    code: :XAE,
-   count: %{other: "Custom Name"},
+   count: %{other: "Custom Name"},
    digits: 0,
    from: nil,
    iso_digits: 0,
@@ -1266,11 +1266,11 @@ 

new(currency, options \\ [])

symbol: "XAE", tender: false, to: nil - }} -iex> MyApp.Cldr.Currency.new(:XAH, name: "Custom Name") -{:error, "Required options are missing. Required options are [:name, :digits]"} -iex> Plausible.Cldr.Currency.new(:XAE, name: "XAE", digits: 0) -{:error, {Cldr.CurrencyAlreadyDefined, "Currency :XAE is already defined."}}
+
}} +iex> MyApp.Cldr.Currency.new(:XAH, name: "Custom Name") +{:error, "Required options are missing. Required options are [:name, :digits]"} +iex> Plausible.Cldr.Currency.new(:XAE, name: "XAE", digits: 0) +{:error, {Cldr.CurrencyAlreadyDefined, "Currency :XAE is already defined."}}
@@ -1329,19 +1329,19 @@

pluralize(number, currency, options \\ [])< Examples

iex> Plausible.Cldr.Currency.pluralize 1, :USD
-{:ok, "US dollar"}
+{:ok, "US dollar"}
 
 iex> Plausible.Cldr.Currency.pluralize 3, :USD
-{:ok, "US dollars"}
+{:ok, "US dollars"}
 
 iex> Plausible.Cldr.Currency.pluralize 12, :USD, locale: "zh"
-{:ok, "美元"}
+{:ok, "美元"}
 
 iex> Plausible.Cldr.Currency.pluralize 12, :USD, locale: "fr"
-{:ok, "dollars des États-Unis"}
+{:ok, "dollars des États-Unis"}
 
 iex> Plausible.Cldr.Currency.pluralize 1, :USD, locale: "fr"
-{:ok, "dollar des États-Unis"}
+{:ok, "dollar des États-Unis"}
@@ -1384,7 +1384,7 @@

strings_for_currency(currency, locale)

Example
iex> MyApp.Cldr.Currency.strings_for_currency :AUD, "en"
-["a$", "australian dollars", "aud", "australian dollar"]
+["a$", "australian dollars", "aud", "australian dollar"]
diff --git a/Plausible.Cldr.Locale.html b/Plausible.Cldr.Locale.html index 5e235e7b2f5cc..5f6d11c768d5f 100644 --- a/Plausible.Cldr.Locale.html +++ b/Plausible.Cldr.Locale.html @@ -291,16 +291,16 @@

fallback_locale_names(locale)

Examples -

In these examples the default locale is :"en-001".

iex> Plausible.Cldr.Locale.fallback_locale_names(:"fr-CA")
-{:ok, [:"fr-CA", :fr, :"en-001", :en]}
+

In these examples the default locale is :"en-001".

iex> Plausible.Cldr.Locale.fallback_locale_names(:"fr-CA")
+{:ok, [:"fr-CA", :fr, :"en-001", :en]}
 
 # Fallbacks are typically formed by progressively
 # stripping variant, territory and script from the
 # given locale name. But not always - there are
 # certain fallbacks that take a different path.
 
-iex> Plausible.Cldr.Locale.fallback_locale_names(:nb)
-{:ok, [:nb, :no, :"en-001", :en]}
+
iex> Plausible.Cldr.Locale.fallback_locale_names(:nb) +{:ok, [:nb, :no, :"en-001", :en]}
@@ -356,20 +356,20 @@

fallback_locales(locale)

Examples -

In these examples the default locale is :"en-001".

Plausible.Cldr.Locale.fallback_locales(:"fr-CA")
-=> {:ok,
-     [#Cldr.LanguageTag<fr-CA [validated]>, #Cldr.LanguageTag<fr [validated]>,
-      #Cldr.LanguageTag<en [validated]>]}
+

In these examples the default locale is :"en-001".

Plausible.Cldr.Locale.fallback_locales(:"fr-CA")
+=> {:ok,
+     [#Cldr.LanguageTag<fr-CA [validated]>, #Cldr.LanguageTag<fr [validated]>,
+      #Cldr.LanguageTag<en [validated]>]}
 
 # Fallbacks are typically formed by progressively
 # stripping variant, territory and script from the
 # given locale name. But not always - there are
 # certain fallbacks that take a different path.
 
-Plausible.Cldr.Locale.fallback_locales(:nb))
-=> {:ok,
-     [#Cldr.LanguageTag<nb [validated]>, #Cldr.LanguageTag<no [validated]>,
-      #Cldr.LanguageTag<en [validated]>]}
+
Plausible.Cldr.Locale.fallback_locales(:nb)) +=> {:ok, + [#Cldr.LanguageTag<nb [validated]>, #Cldr.LanguageTag<no [validated]>, + #Cldr.LanguageTag<en [validated]>]}
@@ -500,15 +500,15 @@

locale_from_host(host, options \\ [])

Examples
iex> Plausible.Cldr.Locale.locale_from_host "a.b.com.au"
-Elixir.Plausible.Cldr.validate_locale(:"en-AU")
+Elixir.Plausible.Cldr.validate_locale(:"en-AU")
 
-iex> Plausible.Cldr.Locale.locale_from_host("a.b.com.tv")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"tv\""}}
+iex> Plausible.Cldr.Locale.locale_from_host("a.b.com.tv")
+{:error,
+ {Cldr.UnknownLocaleError, "No locale was identified for territory \"tv\""}}
 
-iex> Plausible.Cldr.Locale.locale_from_host("a.b.com")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
+iex> Plausible.Cldr.Locale.locale_from_host("a.b.com") +{:error, + {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
@@ -602,12 +602,12 @@

territory_from_host(host)

Examples -
iex> Cldr.Locale.territory_from_host("a.b.com.au")
-{:ok, :AU}
+
iex> Cldr.Locale.territory_from_host("a.b.com.au")
+{:ok, :AU}
 
-iex> Cldr.Locale.territory_from_host("a.b.com")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
+
iex> Cldr.Locale.territory_from_host("a.b.com") +{:error, + {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
diff --git a/Plausible.Cldr.Number.Cardinal.html b/Plausible.Cldr.Number.Cardinal.html index 0d80b33db9be2..cb147a00e017e 100644 --- a/Plausible.Cldr.Number.Cardinal.html +++ b/Plausible.Cldr.Number.Cardinal.html @@ -428,31 +428,31 @@

pluralize(number, locale_name, substitution Examples

-
iex> Plausible.Cldr.Number.Cardinal.pluralize 1, "en", %{one: "one"}
+
iex> Plausible.Cldr.Number.Cardinal.pluralize 1, "en", %{one: "one"}
 "one"
 
-iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one"}
 nil
 
-iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one", two: "two", other: "other"}
 "other"
 
-iex> Plausible.Cldr.Number.Cardinal.pluralize 22, "en", %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 22, "en", %{one: "one", two: "two", other: "other"}
 "other"
 
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(1), "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(1), "en", %{one: "one"}
 "one"
 
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one"}
 nil
 
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one", two: "two"}
 nil
 
-iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
 "few"
 
-iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
 "other"
diff --git a/Plausible.Cldr.Number.Format.html b/Plausible.Cldr.Number.Format.html index 79fb41f51e4d8..f620aa5dc8fe0 100644 --- a/Plausible.Cldr.Number.Format.html +++ b/Plausible.Cldr.Number.Format.html @@ -441,7 +441,7 @@

decimal_format_list()

Example
#=> Plausible.Cldr.Number.Format.Format.decimal_format_list
-["#", "#,##,##0%",
+["#", "#,##,##0%",
 "#,##,##0.###", "#,##,##0.00¤", "#,##,##0.00¤;(#,##,##0.00¤)",
 "#,##,##0 %", "#,##0%", "#,##0.###", "#,##0.00 ¤",
 "#,##0.00 ¤;(#,##0.00 ¤)", "#,##0.00¤", "#,##0.00¤;(#,##0.00¤)",
@@ -451,7 +451,7 @@ 

decimal_format_list()

"000 B ¤", "000 E ¤", "000 K ¤", "000 MRD ¤", "000 Md ¤", "000 Mio'.' ¤", "000 Mio ¤", "000 Mld ¤", "000 Mln ¤", "000 Mn ¤", "000 Mrd'.' ¤", "000 Mrd ¤", "000 Mr ¤", "000 M ¤", "000 NT ¤", "000 N ¤", "000 Tn ¤", -"000 Tr ¤", ...]
+"000 Tr ¤", ...]
@@ -499,8 +499,8 @@

decimal_format_list_for(locale \\ Plausible Example

-
iex> Plausible.Cldr.Number.Format.decimal_format_list_for(:en)
-{:ok, ["#,##0%", "#,##0.###", "#,##0.00", "#,##0.00;(#,##0.00)","#E0",
+
iex> Plausible.Cldr.Number.Format.decimal_format_list_for(:en)
+{:ok, ["#,##0%", "#,##0.###", "#,##0.00", "#,##0.00;(#,##0.00)","#E0",
  "0 billion", "0 million", "0 thousand",
  "0 trillion", "00 billion", "00 million", "00 thousand", "00 trillion",
  "000 billion", "000 million", "000 thousand", "000 trillion", "000B", "000K",
@@ -508,7 +508,7 @@ 

decimal_format_list_for(locale \\ Plausible "¤#,##0.00", "¤#,##0.00;(¤#,##0.00)", "¤000B", "¤000K", "¤000M", "¤000T", "¤00B", "¤00K", "¤00M", "¤00T", "¤0B", "¤0K", "¤0M", "¤0T", "¤ #,##0.00", "¤ #,##0.00;(¤ #,##0.00)", "¤ 000B", "¤ 000K", "¤ 000M", - "¤ 000T", "¤ 00B", "¤ 00K", "¤ 00M", "¤ 00T", "¤ 0B", "¤ 0K", "¤ 0M", "¤ 0T"]}

+
"¤ 000T", "¤ 00B", "¤ 00K", "¤ 00M", "¤ 00T", "¤ 0B", "¤ 0K", "¤ 0M", "¤ 0T"]}
@@ -561,8 +561,8 @@

default_grouping_for(locale \\ Plausible.Cl Examples

-
iex> Plausible.Cldr.Number.Format.default_grouping_for(:en)
-{:ok, %{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}}
+
iex> Plausible.Cldr.Number.Format.default_grouping_for(:en)
+{:ok, %{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}}
@@ -614,8 +614,8 @@

default_grouping_for!(locale)

Examples -
iex> Plausible.Cldr.Number.Format.default_grouping_for!(:en)
-%{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}
+
iex> Plausible.Cldr.Number.Format.default_grouping_for!(:en)
+%{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}
@@ -672,18 +672,18 @@

formats_for(locale \\ Plausible.Cldr.defaul percent: "#,##0 %", scientific: "#E0", standard: "#,##0.###" - currency_short: [{"1000", [one: "0 k ¤", other: "0 k ¤"]}, - {"10000", [one: "00 k ¤", other: "00 k ¤"]}, - {"100000", [one: "000 k ¤", other: "000 k ¤"]}, - {"1000000", [one: "0 M ¤", other: "0 M ¤"]}, - {"10000000", [one: "00 M ¤", other: "00 M ¤"]}, - {"100000000", [one: "000 M ¤", other: "000 M ¤"]}, - {"1000000000", [one: "0 Md ¤", other: "0 Md ¤"]}, - {"10000000000", [one: "00 Md ¤", other: "00 Md ¤"]}, - {"100000000000", [one: "000 Md ¤", other: "000 Md ¤"]}, - {"1000000000000", [one: "0 Bn ¤", other: "0 Bn ¤"]}, - {"10000000000000", [one: "00 Bn ¤", other: "00 Bn ¤"]}, - {"100000000000000", [one: "000 Bn ¤", other: "000 Bn ¤"]}], + currency_short: [{"1000", [one: "0 k ¤", other: "0 k ¤"]}, + {"10000", [one: "00 k ¤", other: "00 k ¤"]}, + {"100000", [one: "000 k ¤", other: "000 k ¤"]}, + {"1000000", [one: "0 M ¤", other: "0 M ¤"]}, + {"10000000", [one: "00 M ¤", other: "00 M ¤"]}, + {"100000000", [one: "000 M ¤", other: "000 M ¤"]}, + {"1000000000", [one: "0 Md ¤", other: "0 Md ¤"]}, + {"10000000000", [one: "00 Md ¤", other: "00 Md ¤"]}, + {"100000000000", [one: "000 Md ¤", other: "000 Md ¤"]}, + {"1000000000000", [one: "0 Bn ¤", other: "0 Bn ¤"]}, + {"10000000000000", [one: "00 Bn ¤", other: "00 Bn ¤"]}, + {"100000000000000", [one: "000 Bn ¤", other: "000 Bn ¤"]}], ... }

@@ -774,8 +774,8 @@

minimum_grouping_digits_for(locale \\ Plaus Examples

-
iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for("en")
-{:ok, 1}
+
iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for("en")
+{:ok, 1}
@@ -827,7 +827,7 @@

minimum_grouping_digits_for!(locale)

Examples -
iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for!("en")
+
iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for!("en")
 1
diff --git a/Plausible.Cldr.Number.Ordinal.html b/Plausible.Cldr.Number.Ordinal.html index d65730185e296..f3908c3d2ec97 100644 --- a/Plausible.Cldr.Number.Ordinal.html +++ b/Plausible.Cldr.Number.Ordinal.html @@ -431,31 +431,31 @@

pluralize(number, locale_name, substitution Examples

-
iex> Plausible.Cldr.Number.Ordinal.pluralize 1, :en, %{one: "one"}
+
iex> Plausible.Cldr.Number.Ordinal.pluralize 1, :en, %{one: "one"}
 "one"
 
-iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one"}
 nil
 
-iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one", two: "two"}
 "two"
 
-iex> Plausible.Cldr.Number.Ordinal.pluralize 22, :en, %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 22, :en, %{one: "one", two: "two", other: "other"}
 "two"
 
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(1), :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(1), :en, %{one: "one"}
 "one"
 
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one"}
 nil
 
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one", two: "two"}
 "two"
 
-iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
 "other"
 
-iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
 "other"
diff --git a/Plausible.Cldr.Number.Symbol.html b/Plausible.Cldr.Number.Symbol.html index 32fdad0daca97..d8f525ffeb7d5 100644 --- a/Plausible.Cldr.Number.Symbol.html +++ b/Plausible.Cldr.Number.Symbol.html @@ -351,9 +351,9 @@

number_symbols_for(locale \\ Plausible.Cldr Example:

-
iex> Plausible.Cldr.Number.Symbol.number_symbols_for(:th)
-{:ok, %{
-   latn: %Cldr.Number.Symbol{
+
iex> Plausible.Cldr.Number.Symbol.number_symbols_for(:th)
+{:ok, %{
+   latn: %Cldr.Number.Symbol{
      decimal: ".",
      exponential: "E",
      group: ",",
@@ -366,8 +366,8 @@ 

number_symbols_for(locale \\ Plausible.Cldr plus_sign: "+", superscripting_exponent: "×", time_separator: ":" - }, - thai: %Cldr.Number.Symbol{ + }, + thai: %Cldr.Number.Symbol{ decimal: ".", exponential: "E", group: ",", @@ -380,8 +380,8 @@

number_symbols_for(locale \\ Plausible.Cldr plus_sign: "+", superscripting_exponent: "×", time_separator: ":" - } - }}

+
} + }}
diff --git a/Plausible.Cldr.Number.System.html b/Plausible.Cldr.Number.System.html index 6aad322b8e80a..f40544a09b400 100644 --- a/Plausible.Cldr.Number.System.html +++ b/Plausible.Cldr.Number.System.html @@ -290,23 +290,23 @@

number_system_for(locale, system_name)

Examples
iex> Plausible.Cldr.Number.System.number_system_for "th", :latn
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
 
 iex> Plausible.Cldr.Number.System.number_system_for "en", :default
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
 
 iex> Plausible.Cldr.Number.System.number_system_for "he", :traditional
-{:ok, %{rules: "hebrew", type: :algorithmic}}
+{:ok, %{rules: "hebrew", type: :algorithmic}}
 
 iex> Plausible.Cldr.Number.System.number_system_for "en", :native
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
 
 iex> Plausible.Cldr.Number.System.number_system_for "en", :finance
-{
+{
   :error,
-  {Cldr.UnknownNumberSystemError,
-    "The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"}
-}
+ {Cldr.UnknownNumberSystemError, + "The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"} +}
@@ -397,10 +397,10 @@

number_system_names_for(locale)

Examples
iex> Plausible.Cldr.Number.System.number_system_names_for "en"
-{:ok, [:latn]}
+{:ok, [:latn]}
 
 iex> Plausible.Cldr.Number.System.number_system_names_for "zz"
-{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
+{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
@@ -482,13 +482,13 @@

number_systems_for(locale)

Examples
iex> Plausible.Cldr.Number.System.number_systems_for "en"
-{:ok, %{default: :latn, native: :latn}}
+{:ok, %{default: :latn, native: :latn}}
 
 iex> Plausible.Cldr.Number.System.number_systems_for "th"
-{:ok, %{default: :latn, native: :thai}}
+{:ok, %{default: :latn, native: :thai}}
 
 iex> Plausible.Cldr.Number.System.number_systems_for "zz"
-{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
+{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
@@ -586,20 +586,20 @@

system_name_from(system_name, locale)

Examples -
ex> Plausible.Cldr.Number.System.system_name_from(:default, "en")
-{:ok, :latn}
+
ex> Plausible.Cldr.Number.System.system_name_from(:default, "en")
+{:ok, :latn}
 
-iex> Plausible.Cldr.Number.System.system_name_from("latn", "en")
-{:ok, :latn}
+iex> Plausible.Cldr.Number.System.system_name_from("latn", "en")
+{:ok, :latn}
 
-iex> Plausible.Cldr.Number.System.system_name_from(:native, "en")
-{:ok, :latn}
+iex> Plausible.Cldr.Number.System.system_name_from(:native, "en")
+{:ok, :latn}
 
-iex> Plausible.Cldr.Number.System.system_name_from(:nope, "en")
-{
+iex> Plausible.Cldr.Number.System.system_name_from(:nope, "en")
+{
   :error,
-  {Cldr.UnknownNumberSystemError, "The number system :nope is unknown"}
-}

Note that return value is not guaranteed to be a valid + {Cldr.UnknownNumberSystemError, "The number system :nope is unknown"} +}

Note that return value is not guaranteed to be a valid number system for the given locale as demonstrated in the third example.

@@ -646,16 +646,16 @@

to_system(number, system)

Examples
iex> Plausible.Cldr.Number.System.to_system 123456, :hebr
-{:ok, "קכ״ג׳תנ״ו"}
+{:ok, "קכ״ג׳תנ״ו"}
 
 iex> Plausible.Cldr.Number.System.to_system 123, :hans
-{:ok, "一百二十三"}
+{:ok, "一百二十三"}
 
 iex> Plausible.Cldr.Number.System.to_system 123, :hant
-{:ok, "一百二十三"}
+{:ok, "一百二十三"}
 
 iex> Plausible.Cldr.Number.System.to_system 123, :hansfin
-{:ok, "壹佰贰拾叁"}
+{:ok, "壹佰贰拾叁"}
diff --git a/Plausible.Cldr.Number.Transliterate.html b/Plausible.Cldr.Number.Transliterate.html index 915dede67d337..abec7977a5b22 100644 --- a/Plausible.Cldr.Number.Transliterate.html +++ b/Plausible.Cldr.Number.Transliterate.html @@ -133,12 +133,12 @@

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.

To configure these transliteration pairs, add the to the use Cldr configuration -in a backend module:

defmodule MyApp.Cldr do
+in a backend module:

defmodule MyApp.Cldr do
   use Cldr,
-  locale: ["en", "fr", "th"],
+  locale: ["en", "fr", "th"],
   default_locale: "en",
-  precompile_transliterations: [{:latn, :thai}, {:arab, :thai}]
-end

Where each tuple in the list configures one transliteration map. In this example, two maps are + precompile_transliterations: [{:latn, :thai}, {:arab, :thai}] +end

Where each tuple in the list configures one transliteration map. In this example, two maps are configured: from :latn to :thai and from :arab to :thai.

A list of configurable number systems is returned by Cldr.Number.System.systems_with_digits/0.

If a transliteration is requested between two number pairs that have not been configured for precompilation, a warning is logged.

@@ -254,22 +254,22 @@

transliterate(sequence, locale \\ Plausible Examples

-
iex> Plausible.Cldr.Number.Transliterate.transliterate("123556")
+
iex> Plausible.Cldr.Number.Transliterate.transliterate("123556")
 "123556"
 
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123,556.000", "fr", :default)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123,556.000", "fr", :default)
 "123 556,000"
 
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :default)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :default)
 "123556"
 
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", "thai")
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", "thai")
 "๑๒๓๕๕๖"
 
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :native)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :native)
 "๑๒๓๕๕๖"
 
-iex> Plausible.Cldr.Number.Transliterate.transliterate("Some number is: 123556", "th", "thai")
+iex> Plausible.Cldr.Number.Transliterate.transliterate("Some number is: 123556", "th", "thai")
 "Some number is: ๑๒๓๕๕๖"
diff --git a/Plausible.Cldr.Number.html b/Plausible.Cldr.Number.html index 6d2e6ae7000ce..5f671ce24eefa 100644 --- a/Plausible.Cldr.Number.html +++ b/Plausible.Cldr.Number.html @@ -414,19 +414,19 @@

parse(string, options \\ [])

Examples -
iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de")
-{:ok, 1000.34}
+
iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de")
+{:ok, 1000.34}
 
-iex> Plausible.Cldr.Number.parse("-1_000_000.34")
-{:ok, -1000000.34}
+iex> Plausible.Cldr.Number.parse("-1_000_000.34")
+{:ok, -1000000.34}
 
-iex> Plausible.Cldr.Number.parse("1.000", locale: "de", number: :integer)
-{:ok, 1000}
+iex> Plausible.Cldr.Number.parse("1.000", locale: "de", number: :integer)
+{:ok, 1000}
 
-iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de", number: :integer)
-{:error,
-  {Cldr.Number.ParseError,
-   "The string \"+1.000,34\" could not be parsed as a number"}}
+
iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de", number: :integer) +{:error, + {Cldr.Number.ParseError, + "The string \"+1.000,34\" could not be parsed as a number"}}
@@ -498,17 +498,17 @@

resolve_currencies(list, options \\ [])

Examples -
iex> Plausible.Cldr.Number.scan("100 US dollars")
+
iex> Plausible.Cldr.Number.scan("100 US dollars")
 ...> |> Plausible.Cldr.Number.resolve_currencies
-[100, :USD]
+[100, :USD]
 
-iex> Plausible.Cldr.Number.scan("100 eurosports")
-...> |> Plausible.Cldr.Number.resolve_currencies(fuzzy: 0.75)
-[100, :EUR]
+iex> Plausible.Cldr.Number.scan("100 eurosports")
+...> |> Plausible.Cldr.Number.resolve_currencies(fuzzy: 0.75)
+[100, :EUR]
 
-iex> Plausible.Cldr.Number.scan("100 dollars des États-Unis")
-...> |> Plausible.Cldr.Number.resolve_currencies(locale: "fr")
-[100, :USD]
+
iex> Plausible.Cldr.Number.scan("100 dollars des États-Unis") +...> |> Plausible.Cldr.Number.resolve_currencies(locale: "fr") +[100, :USD]
@@ -585,19 +585,19 @@

resolve_currency(string, options \\ [])

Examples -
iex> Plausible.Cldr.Number.resolve_currency("US dollars")
-[:USD]
+
iex> Plausible.Cldr.Number.resolve_currency("US dollars")
+[:USD]
 
-iex> Plausible.Cldr.Number.resolve_currency("100 eurosports", fuzzy: 0.75)
-[:EUR]
+iex> Plausible.Cldr.Number.resolve_currency("100 eurosports", fuzzy: 0.75)
+[:EUR]
 
-iex> Plausible.Cldr.Number.resolve_currency("dollars des États-Unis", locale: "fr")
-[:USD]
+iex> Plausible.Cldr.Number.resolve_currency("dollars des États-Unis", locale: "fr")
+[:USD]
 
-iex> Plausible.Cldr.Number.resolve_currency("not a known currency", locale: "fr")
-{:error,
- {Cldr.UnknownCurrencyError,
-  "The currency \"not a known currency\" is unknown or not supported"}}
+
iex> Plausible.Cldr.Number.resolve_currency("not a known currency", locale: "fr") +{:error, + {Cldr.UnknownCurrencyError, + "The currency \"not a known currency\" is unknown or not supported"}}
@@ -661,13 +661,13 @@

resolve_per(string, options \\ [])

Examples
iex> Plausible.Cldr.Number.resolve_per "11%"
-["11", :percent]
+["11", :percent]
 
 iex> Plausible.Cldr.Number.resolve_per "% of linguists"
-[:percent, " of linguists"]
+[:percent, " of linguists"]
 
 iex> Plausible.Cldr.Number.resolve_per "% of linguists %"
-[:percent, " of linguists ", :percent]
+[:percent, " of linguists ", :percent]
@@ -724,9 +724,9 @@

resolve_pers(list, options \\ [])

Examples -
iex> Plausible.Cldr.Number.scan("100%")
-...> |> Plausible.Cldr.Number.resolve_pers()
-[100, :percent]
+
iex> Plausible.Cldr.Number.scan("100%")
+...> |> Plausible.Cldr.Number.resolve_pers()
+[100, :percent]
@@ -786,20 +786,20 @@

scan(string, options \\ [])

Examples -
iex> Plausible.Cldr.Number.scan("£1_000_000.34")
-["£", 1000000.34]
+
iex> Plausible.Cldr.Number.scan("£1_000_000.34")
+["£", 1000000.34]
 
-iex> Plausible.Cldr.Number.scan("I want £1_000_000 dollars")
-["I want £", 1000000, " dollars"]
+iex> Plausible.Cldr.Number.scan("I want £1_000_000 dollars")
+["I want £", 1000000, " dollars"]
 
-iex> Plausible.Cldr.Number.scan("The prize is 23")
-["The prize is ", 23]
+iex> Plausible.Cldr.Number.scan("The prize is 23")
+["The prize is ", 23]
 
-iex> Plausible.Cldr.Number.scan("The lottery number is 23 for the next draw")
-["The lottery number is ", 23, " for the next draw"]
+iex> Plausible.Cldr.Number.scan("The lottery number is 23 for the next draw")
+["The lottery number is ", 23, " for the next draw"]
 
-iex> Plausible.Cldr.Number.scan("The loss is -1.000 euros", locale: "de", number: :integer)
-["The loss is ", -1000, " euros"]
+
iex> Plausible.Cldr.Number.scan("The loss is -1.000 euros", locale: "de", number: :integer) +["The loss is ", -1000, " euros"]
@@ -846,7 +846,7 @@

to_approx_string(number, options \\ [])

iex> Plausible.Cldr.Number.to_approx_string 1234
-{:ok, "~1,234"}
+{:ok, "~1,234"}
@@ -893,7 +893,7 @@

to_at_least_string(number, options \\ [])
iex> Plausible.Cldr.Number.to_at_least_string 1234
-{:ok, "1,234+"}
+{:ok, "1,234+"}

@@ -940,7 +940,7 @@

to_at_most_string(number, options \\ [])
iex> Plausible.Cldr.Number.to_at_most_string 1234
-{:ok, "≤1,234"}
+{:ok, "≤1,234"}

@@ -987,7 +987,7 @@

to_range_string(range, options \\ [])

Example
iex> Plausible.Cldr.Number.to_range_string 1234..5678
-{:ok, "1,234–5,678"}
+{:ok, "1,234–5,678"}
@@ -1106,21 +1106,21 @@

to_string(number, options \\ default_option

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:

iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
+applied to the symbol than the number.  For example:

iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
 ...>   string, :currency_symbol -> "<span class=\"symbol\">" <> string <> "</span>"
 ...>   string, :number -> "<span class=\"number\">" <> string <> "</span>"
 ...>   string, :currency_space -> "<span>" <> string <> "</span>"
 ...>   string, _other -> string
-...> end)
-{:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}

It is also possible and recommended to use the Phoenix.HTML.Tag.content_tag/3 +...> end) +{:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}

It is also possible and recommended to use the Phoenix.HTML.Tag.content_tag/3 function if wrapping HTML tags since these will ensure HTML entities are -correctly encoded. For example:

iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
-...>   string, :currency_symbol -> Phoenix.HTML.Tag.content_tag(:span, string, class: "symbol")
-...>   string, :number -> Phoenix.HTML.Tag.content_tag(:span, string, class: "number")
-...>   string, :currency_space -> Phoenix.HTML.Tag.content_tag(:span, string)
+correctly encoded.  For example:

iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
+...>   string, :currency_symbol -> Phoenix.HTML.Tag.content_tag(:span, string, class: "symbol")
+...>   string, :number -> Phoenix.HTML.Tag.content_tag(:span, string, class: "number")
+...>   string, :currency_space -> Phoenix.HTML.Tag.content_tag(:span, string)
 ...>   string, _other -> string
-...> end)
-{:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}

When formatting a number the format is parsed into format elements that might include +...> end) +{:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}

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. @@ -1141,80 +1141,80 @@

to_string(number, options \\ default_option Examples

iex> Plausible.Cldr.Number.to_string 12345
-{:ok, "12,345"}
+{:ok, "12,345"}
 
 iex> Plausible.Cldr.Number.to_string 12345, locale: "fr"
-{:ok, "12 345"}
+{:ok, "12 345"}
 
 iex> Plausible.Cldr.Number.to_string 1345.32, currency: :EUR, locale: "es", minimum_grouping_digits: 1
-{:ok, "1.345,32 €"}
+{:ok, "1.345,32 €"}
 
 iex> Plausible.Cldr.Number.to_string 1345.32, currency: :EUR, locale: "es"
-{:ok, "1345,32 €"}
+{:ok, "1345,32 €"}
 
 iex> Plausible.Cldr.Number.to_string 12345, locale: "fr", currency: "USD"
-{:ok, "12 345,00 $US"}
+{:ok, "12 345,00 $US"}
 
 iex> Plausible.Cldr.Number.to_string 12345, format: "#E0"
-{:ok, "1.2345E4"}
+{:ok, "1.2345E4"}
 
 iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB"
-{:ok, "THB 12,345.00"}
+{:ok, "THB 12,345.00"}
 
 iex> Plausible.Cldr.Number.to_string -12345, format: :accounting, currency: "THB"
-{:ok, "(THB 12,345.00)"}
+{:ok, "(THB 12,345.00)"}
 
 iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB",
 ...> locale: "th"
-{:ok, "฿12,345.00"}
+{:ok, "฿12,345.00"}
 
 iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB",
 ...> locale: "th", number_system: :native
-{:ok, "฿๑๒,๓๔๕.๐๐"}
+{:ok, "฿๑๒,๓๔๕.๐๐"}
 
 iex> Plausible.Cldr.Number.to_string 1244.30, format: :long
-{:ok, "1 thousand"}
+{:ok, "1 thousand"}
 
 iex> Plausible.Cldr.Number.to_string 1244.30, format: :long, currency: "USD"
-{:ok, "1,244 US dollars"}
+{:ok, "1,244 US dollars"}
 
 iex> Plausible.Cldr.Number.to_string 1244.30, format: :short
-{:ok, "1K"}
+{:ok, "1K"}
 
 iex> Plausible.Cldr.Number.to_string 1244.30, format: :short, currency: "EUR"
-{:ok, "€1K"}
+{:ok, "€1K"}
 
 iex> Plausible.Cldr.Number.to_string 1234, format: :spellout
-{:ok, "one thousand two hundred thirty-four"}
+{:ok, "one thousand two hundred thirty-four"}
 
 iex> Plausible.Cldr.Number.to_string 1234, format: :spellout_verbose
-{:ok, "one thousand two hundred and thirty-four"}
+{:ok, "one thousand two hundred and thirty-four"}
 
 iex> Plausible.Cldr.Number.to_string 1989, format: :spellout_year
-{:ok, "nineteen eighty-nine"}
+{:ok, "nineteen eighty-nine"}
 
 iex> Plausible.Cldr.Number.to_string 123, format: :ordinal
-{:ok, "123rd"}
+{:ok, "123rd"}
 
 iex> Plausible.Cldr.Number.to_string 123, format: :roman
-{:ok, "CXXIII"}
+{:ok, "CXXIII"}
 
 iex> Plausible.Cldr.Number.to_string 123, locale: "th-u-nu-thai"
-{:ok, "๑๒๓"}

+{:ok, "๑๒๓"}

errors

Errors

An error tuple {:error, reason} will be returned if an error is detected. -The two most likely causes of an error return are:

    iex> Plausible.Cldr.Number.to_string(12345, format: "0#")
-    {:error, {Cldr.FormatCompileError,
-      "Decimal format compiler: syntax error before: \"#\""}}
    iex> Plausible.Cldr.Number.to_string(1234, locale: "he", number_system: "hebr")
+    {:error, {Cldr.UnknownFormatError,
+      "The locale :he with number system :hebr does not define a format :standard"}}
@@ -1318,17 +1318,17 @@

validate_number_system(locale, number_syste Examples

iex> Plausible.Cldr.Number.validate_number_system "en", :latn
-{:ok, :latn}
+{:ok, :latn}
 
 iex> Plausible.Cldr.Number.validate_number_system "en", :default
-{:ok, :latn}
+{:ok, :latn}
 
 iex> Plausible.Cldr.Number.validate_number_system "en", :unknown
-{:error,
- {Cldr.UnknownNumberSystemError, "The number system :unknown is unknown"}}
+{:error,
+ {Cldr.UnknownNumberSystemError, "The number system :unknown is unknown"}}
 
 iex> Plausible.Cldr.Number.validate_number_system "zz", :default
-{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
+{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
diff --git a/Plausible.Cldr.Rbnf.NumberSystem.html b/Plausible.Cldr.Rbnf.NumberSystem.html index 589cd9971494b..751038525db01 100644 --- a/Plausible.Cldr.Rbnf.NumberSystem.html +++ b/Plausible.Cldr.Rbnf.NumberSystem.html @@ -116,12 +116,12 @@

Functions to implement the number system rule-based-number-format rules of CLDR.

These rules are defined only on the "und" locale and represent specialised number formatting.

The standard public API for RBNF is via the Cldr.Number.to_string/2 function.

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:

iex> Plausible.Cldr.Rbnf.NumberSystem.rule_sets(:und)
-[:zz_default, :tamil, :roman_upper, :roman_lower, :hebrew_item,
+defined in the Unicode CLDR data repository.  Available rules are identified by:

iex> Plausible.Cldr.Rbnf.NumberSystem.rule_sets(:und)
+[:zz_default, :tamil, :roman_upper, :roman_lower, :hebrew_item,
  :hebrew, :greek_upper, :greek_lower, :georgian,
- :ethiopic, :cyrillic_lower, :armenian_upper, :armenian_lower]

A rule can then be invoked on an available rule_set. For example

iex> Plausible.Cldr.Rbnf.NumberSystem.roman_upper(123, :und)
-"CXXIII"

This particular call is equivalent to the call through the public API of:

iex> Plausible.Cldr.Number.to_string(123, format: :roman)
-{:ok, "CXXIII"}
+
:ethiopic, :cyrillic_lower, :armenian_upper, :armenian_lower]

A rule can then be invoked on an available rule_set. For example

iex> Plausible.Cldr.Rbnf.NumberSystem.roman_upper(123, :und)
+"CXXIII"

This particular call is equivalent to the call through the public API of:

iex> Plausible.Cldr.Number.to_string(123, format: :roman)
+{:ok, "CXXIII"}
diff --git a/Plausible.Cldr.Rbnf.Ordinal.html b/Plausible.Cldr.Rbnf.Ordinal.html index eaf83b6fa22f3..0b16504359d94 100644 --- a/Plausible.Cldr.Rbnf.Ordinal.html +++ b/Plausible.Cldr.Rbnf.Ordinal.html @@ -116,19 +116,19 @@

Functions to implement the ordinal rule-based-number-format rules of CLDR.

As CLDR notes, the data is incomplete or non-existent for many languages. It is considered complete for English however.

The standard public API for RBNF is via the Cldr.Number.to_string/2 function.

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:

iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets(:en)
-[:digits_ordinal]
+defined in the Unicode CLDR data repository.  Available rules are identified by:

iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets(:en)
+[:digits_ordinal]
 
-iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets("fr")
-[
+iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets("fr")
+[
   :digits_ordinal_masculine_plural,
   :digits_ordinal_masculine,
   :digits_ordinal_feminine_plural,
   :digits_ordinal_feminine,
   :digits_ordinal
-]

A rule can then be invoked on an available rule_set. For example

iex> Plausible.Cldr.Rbnf.Ordinal.digits_ordinal(123, :en)
-"123rd"

This call is equivalent to the call through the public API of:

iex> Plausible.Cldr.Number.to_string(123, format: :ordinal)
-{:ok, "123rd"}
+
]

A rule can then be invoked on an available rule_set. For example

iex> Plausible.Cldr.Rbnf.Ordinal.digits_ordinal(123, :en)
+"123rd"

This call is equivalent to the call through the public API of:

iex> Plausible.Cldr.Number.to_string(123, format: :ordinal)
+{:ok, "123rd"}
diff --git a/Plausible.Cldr.Rbnf.Spellout.html b/Plausible.Cldr.Rbnf.Spellout.html index 573fc8ce95d39..d7fdc5fb041f0 100644 --- a/Plausible.Cldr.Rbnf.Spellout.html +++ b/Plausible.Cldr.Rbnf.Spellout.html @@ -116,12 +116,12 @@

Functions to implement the spellout rule-based-number-format rules of CLDR.

As CLDR notes, the data is incomplete or non-existent for many languages. It is considered complete for English however.

The standard public API for RBNF is via the Cldr.Number.to_string/2 function.

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:

iex> Plausible.Cldr.Rbnf.Spellout.rule_sets("en")
-[:spellout_ordinal_verbose, :spellout_ordinal, :spellout_numbering_year,
+defined in the Unicode CLDR data repository.  Available rules are identified by:

iex> Plausible.Cldr.Rbnf.Spellout.rule_sets("en")
+[:spellout_ordinal_verbose, :spellout_ordinal, :spellout_numbering_year,
   :spellout_numbering_verbose, :spellout_numbering, :spellout_cardinal_verbose,
-  :spellout_cardinal]

A rule can then be invoked on an available rule_set. For example:

iex> Plausible.Cldr.Rbnf.Spellout.spellout_ordinal(123, "en")
-"one hundred twenty-third"

This call is equivalent to the call through the public API of:

iex> Plausible.Cldr.Number.to_string(123, format: :spellout)
-{:ok, "one hundred twenty-three"}
+
:spellout_cardinal]

A rule can then be invoked on an available rule_set. For example:

iex> Plausible.Cldr.Rbnf.Spellout.spellout_ordinal(123, "en")
+"one hundred twenty-third"

This call is equivalent to the call through the public API of:

iex> Plausible.Cldr.Number.to_string(123, format: :spellout)
+{:ok, "one hundred twenty-three"}
diff --git a/Plausible.Cldr.html b/Plausible.Cldr.html index 864b0d7c06f14..cfdd50e19ac34 100644 --- a/Plausible.Cldr.html +++ b/Plausible.Cldr.html @@ -520,24 +520,24 @@

default_locale()

Example -
iex> Plausible.Cldr.default_locale()
-%Cldr.LanguageTag{
+
iex> Plausible.Cldr.default_locale()
+%Cldr.LanguageTag{
   backend: Plausible.Cldr,
   canonical_locale_name: "en-001",
   cldr_locale_name: :"en-001",
-  language_subtags: [],
-  extensions: %{},
+  language_subtags: [],
+  extensions: %{},
   gettext_locale_name: "en",
   language: "en",
-  locale: %{},
-  private_use: [],
+  locale: %{},
+  private_use: [],
   rbnf_locale_name: :en,
   requested_locale_name: "en-001",
   script: :Latn,
   territory: :"001",
-  transform: %{},
-  language_variants: []
-}
+
transform: %{}, + language_variants: [] +}
@@ -572,7 +572,7 @@

default_territory()

Example -
iex> Plausible.Cldr.default_territory()
+
iex> Plausible.Cldr.default_territory()
 :"001"
@@ -635,13 +635,13 @@

ellipsis(string, options \\ [])

iex> Plausible.Cldr.ellipsis "And furthermore"
 "And furthermore…"
 
-iex> Plausible.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: :ja
+iex> Plausible.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: :ja
 "And furthermore…there is much to be done"
 
 iex> Plausible.Cldr.ellipsis "And furthermore", format: :word
 "And furthermore …"
 
-iex> Plausible.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: :ja, format: :word
+iex> Plausible.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: :ja, format: :word
 "And furthermore … there is much to be done"
@@ -677,23 +677,23 @@

get_locale()

Example -
iex> Plausible.Cldr.put_locale("pl")
+
iex> Plausible.Cldr.put_locale("pl")
 iex> Plausible.Cldr.get_locale
-%Cldr.LanguageTag{
+%Cldr.LanguageTag{
    backend: Elixir.Plausible.Cldr,
    canonical_locale_name: "pl",
    cldr_locale_name: :pl,
-   extensions: %{},
+   extensions: %{},
    language: "pl",
-   locale: %{},
-   private_use: [],
+   locale: %{},
+   private_use: [],
    rbnf_locale_name: :pl,
    territory: :PL,
    requested_locale_name: "pl",
    script: :Latn,
-   transform: %{},
-   language_variants: []
- }
+
transform: %{}, + language_variants: [] + }
@@ -826,10 +826,10 @@

known_gettext_locale_name?(locale_name)

Examples -
iex> Plausible.Cldr.known_gettext_locale_name?("en")
+
iex> Plausible.Cldr.known_gettext_locale_name?("en")
 true
 
-iex> Plausible.Cldr.known_gettext_locale_name?("!!")
+iex> Plausible.Cldr.known_gettext_locale_name?("!!")
 false
@@ -948,10 +948,10 @@

known_locale_name?(locale_name)

Examples -
iex> Plausible.Cldr.known_locale_name?(:en)
+
iex> Plausible.Cldr.known_locale_name?(:en)
 true
 
-iex> Plausible.Cldr.known_locale_name?(:"!!")
+iex> Plausible.Cldr.known_locale_name?(:"!!")
 false
@@ -1006,7 +1006,7 @@

known_number_system_types()

Example
iex> Plausible.Cldr.known_number_system_types
-[:default, :finance, :native, :traditional]
+
[:default, :finance, :native, :traditional]
@@ -1117,10 +1117,10 @@

known_rbnf_locale_name?(locale_name)

Examples -
iex> Plausible.Cldr.known_rbnf_locale_name?(:en)
+
iex> Plausible.Cldr.known_rbnf_locale_name?(:en)
 true
 
-iex> Plausible.Cldr.known_rbnf_locale_name?(:"!!")
+iex> Plausible.Cldr.known_rbnf_locale_name?(:"!!")
 false
@@ -1241,29 +1241,29 @@

put_locale(locale_name)

Examples -
iex> Plausible.Cldr.put_locale("en")
-{:ok,
- %Cldr.LanguageTag{
+
iex> Plausible.Cldr.put_locale("en")
+{:ok,
+ %Cldr.LanguageTag{
    backend: Plausible.Cldr,
    canonical_locale_name: "en",
    cldr_locale_name: :en,
-   language_subtags: [],
-   extensions: %{},
+   language_subtags: [],
+   extensions: %{},
    gettext_locale_name: "en",
    language: "en",
-   locale: %{},
-   private_use: [],
+   locale: %{},
+   private_use: [],
    rbnf_locale_name: :en,
    requested_locale_name: "en",
    script: :Latn,
    territory: :US,
-   transform: %{},
-   language_variants: []
- }}
+   transform: %{},
+   language_variants: []
+ }}
 
-iex> Plausible.Cldr.put_locale("invalid-locale!")
-{:error, {Cldr.LanguageTag.ParseError,
-  "Expected a BCP47 language tag. Could not parse the remaining \"!\" starting at position 15"}}
+
iex> Plausible.Cldr.put_locale("invalid-locale!") +{:error, {Cldr.LanguageTag.ParseError, + "Expected a BCP47 language tag. Could not parse the remaining \"!\" starting at position 15"}}
@@ -1446,47 +1446,47 @@

validate_locale(locale)

Examples -
iex> Plausible.Cldr.validate_locale(:en)
-{:ok,
-%Cldr.LanguageTag{
+
iex> Plausible.Cldr.validate_locale(:en)
+{:ok,
+%Cldr.LanguageTag{
   backend: Plausible.Cldr,
   canonical_locale_name: "en",
   cldr_locale_name: :en,
-  extensions: %{},
+  extensions: %{},
   gettext_locale_name: "en",
   language: "en",
-  locale: %{},
-  private_use: [],
+  locale: %{},
+  private_use: [],
   rbnf_locale_name: :en,
   requested_locale_name: "en",
   script: :Latn,
   territory: :US,
-  transform: %{},
-  language_variants: []
-}}
+  transform: %{},
+  language_variants: []
+}}
 
 
-iex> Plausible.Cldr.validate_locale Plausible.Cldr.default_locale()
-{:ok,
-%Cldr.LanguageTag{
+iex> Plausible.Cldr.validate_locale Plausible.Cldr.default_locale()
+{:ok,
+%Cldr.LanguageTag{
   backend: Plausible.Cldr,
   canonical_locale_name: "en-001",
   cldr_locale_name: :"en-001",
-  extensions: %{},
+  extensions: %{},
   gettext_locale_name: "en",
   language: "en",
-  locale: %{},
-  private_use: [],
+  locale: %{},
+  private_use: [],
   rbnf_locale_name: :en,
   requested_locale_name: "en-001",
   script: :Latn,
   territory: :"001",
-  transform: %{},
-  language_variants: []
-}}
+  transform: %{},
+  language_variants: []
+}}
 
-iex> Plausible.Cldr.validate_locale("zzz")
-{:error, {Cldr.InvalidLanguageError, "The language \"zzz\" is invalid"}}
+
iex> Plausible.Cldr.validate_locale("zzz") +{:error, {Cldr.InvalidLanguageError, "The language \"zzz\" is invalid"}}
@@ -1557,22 +1557,22 @@

validate_number_system_type(number_system_t Examples

iex> Plausible.Cldr.validate_number_system_type :default
-{:ok, :default}
+{:ok, :default}
 
 iex> Plausible.Cldr.validate_number_system_type :traditional
-{:ok, :traditional}
+{:ok, :traditional}
 
 iex> Plausible.Cldr.validate_number_system_type :latn
-{
+{
   :error,
-  {Cldr.UnknownNumberSystemTypeError, "The number system type :latn is unknown"}
-}
+  {Cldr.UnknownNumberSystemTypeError, "The number system type :latn is unknown"}
+}
 
 iex> Plausible.Cldr.validate_number_system_type "bork"
-{
+{
   :error,
-  {Cldr.UnknownNumberSystemTypeError, "The number system type \"bork\" is invalid"}
-}
+ {Cldr.UnknownNumberSystemTypeError, "The number system type \"bork\" is invalid"} +}
diff --git a/Plausible.ClickhouseRepo.html b/Plausible.ClickhouseRepo.html index 89a2db029c042..b647528072bc1 100644 --- a/Plausible.ClickhouseRepo.html +++ b/Plausible.ClickhouseRepo.html @@ -818,23 +818,23 @@

insert_stream(source_or_schema, rows, opts
-

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
 
-defmodule Demo do
+defmodule Demo do
   use Ecto.Schema
 
   @primary_key false
-  schema "ecto_ch_demo" do
+  schema "ecto_ch_demo" do
     field :a, Ch, type: "UInt64"
     field :b, :string
-  end
-end
+  end
+end
 
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
 
 # schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
+
{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])

diff --git a/Plausible.DataMigration.Repo.html b/Plausible.DataMigration.Repo.html index f553ae026f806..e68d764cc4891 100644 --- a/Plausible.DataMigration.Repo.html +++ b/Plausible.DataMigration.Repo.html @@ -1125,23 +1125,23 @@

insert_stream(source_or_schema, rows, opts
-

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
 
-defmodule Demo do
+defmodule Demo do
   use Ecto.Schema
 
   @primary_key false
-  schema "ecto_ch_demo" do
+  schema "ecto_ch_demo" do
     field :a, Ch, type: "UInt64"
     field :b, :string
-  end
-end
+  end
+end
 
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
 
 # schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
+
{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])

diff --git a/Plausible.Geo.html b/Plausible.Geo.html index bf2c56c94c43e..f453b87356d6d 100644 --- a/Plausible.Geo.html +++ b/Plausible.Geo.html @@ -233,8 +233,8 @@

database_type()

Examples -

In the case of a DB-IP database:

iex> database_type()
-"DBIP-City-Lite"

In the case of a MaxMind database:

iex> database_type()
+

In the case of a DB-IP database:

iex> database_type()
+"DBIP-City-Lite"

In the case of a MaxMind database:

iex> database_type()
 "GeoLite2-City"
@@ -274,8 +274,8 @@

load_db(opts)

Examples -

Loading from a local file:

iex> load_db(path: "/etc/plausible/dbip-city.mmdb")
-:ok

Downloading a MaxMind DB (this license key is no longer active):

iex> load_db(license_key: "LNpsJCCKPis6XvBP", edition: "GeoLite2-City", async: true)
+

Loading from a local file:

iex> load_db(path: "/etc/plausible/dbip-city.mmdb")
+:ok

Downloading a MaxMind DB (this license key is no longer active):

iex> load_db(license_key: "LNpsJCCKPis6XvBP", edition: "GeoLite2-City", async: true)
 :ok
@@ -304,21 +304,21 @@

lookup(ip_address)

Examples -
iex> lookup("8.7.6.5")
-%{
-  "city" => %{
+
iex> lookup("8.7.6.5")
+%{
+  "city" => %{
     "geoname_id" => 5349755,
-    "names" => %{
+    "names" => %{
       "de" => "Fontana",
       "en" => "Fontana",
       "ja" => "フォンタナ",
       "ru" => "Фонтана"
-    }
-  },
-  "continent" => %{
+    }
+  },
+  "continent" => %{
     "code" => "NA",
     "geoname_id" => 6255149,
-    "names" => %{
+    "names" => %{
       "de" => "Nordamerika",
       "en" => "North America",
       "es" => "Norteamérica",
@@ -327,12 +327,12 @@ 

lookup(ip_address)

"pt-BR" => "América do Norte", "ru" => "Северная Америка", "zh-CN" => "北美洲" - } - }, - "country" => %{ + } + }, + "country" => %{ "geoname_id" => 6252001, "iso_code" => "US", - "names" => %{ + "names" => %{ "de" => "Vereinigte Staaten", "en" => "United States", "es" => "Estados Unidos", @@ -341,20 +341,20 @@

lookup(ip_address)

"pt-BR" => "EUA", "ru" => "США", "zh-CN" => "美国" - } - }, - "location" => %{ + } + }, + "location" => %{ "accuracy_radius" => 50, "latitude" => 34.1211, "longitude" => -117.4362, "metro_code" => 803, "time_zone" => "America/Los_Angeles" - }, - "postal" => %{"code" => "92336"}, - "registered_country" => %{ + }, + "postal" => %{"code" => "92336"}, + "registered_country" => %{ "geoname_id" => 6252001, "iso_code" => "US", - "names" => %{ + "names" => %{ "de" => "Vereinigte Staaten", "en" => "United States", "es" => "Estados Unidos", @@ -363,13 +363,13 @@

lookup(ip_address)

"pt-BR" => "EUA", "ru" => "США", "zh-CN" => "美国" - } - }, - "subdivisions" => [ - %{ + } + }, + "subdivisions" => [ + %{ "geoname_id" => 5332921, "iso_code" => "CA", - "names" => %{ + "names" => %{ "de" => "Kalifornien", "en" => "California", "es" => "California", @@ -378,10 +378,10 @@

lookup(ip_address)

"pt-BR" => "Califórnia", "ru" => "Калифорния", "zh-CN" => "加州" - } - } - ] -}
+
} + } + ] +}
diff --git a/Plausible.ImportDeletionRepo.html b/Plausible.ImportDeletionRepo.html index 1df477c715752..ffd2af4a5924b 100644 --- a/Plausible.ImportDeletionRepo.html +++ b/Plausible.ImportDeletionRepo.html @@ -1116,23 +1116,23 @@

insert_stream(source_or_schema, rows, opts
-

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
 
-defmodule Demo do
+defmodule Demo do
   use Ecto.Schema
 
   @primary_key false
-  schema "ecto_ch_demo" do
+  schema "ecto_ch_demo" do
     field :a, Ch, type: "UInt64"
     field :b, :string
-  end
-end
+  end
+end
 
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
 
 # schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
+
{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
diff --git a/Plausible.IngestRepo.html b/Plausible.IngestRepo.html index a8f1b283f2f18..9b2e3ab8a2904 100644 --- a/Plausible.IngestRepo.html +++ b/Plausible.IngestRepo.html @@ -1116,23 +1116,23 @@

insert_stream(source_or_schema, rows, opts
-

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+

Similar to insert_all/2 but with the following differences:

  • accepts rows as streams or lists
  • sends rows as a chunked request
  • doesn't autogenerate ids or does any other preprocessing

Example:

Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
 
-defmodule Demo do
+defmodule Demo do
   use Ecto.Schema
 
   @primary_key false
-  schema "ecto_ch_demo" do
+  schema "ecto_ch_demo" do
     field :a, Ch, type: "UInt64"
     field :b, :string
-  end
-end
+  end
+end
 
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
 
 # schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
+
{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])

diff --git a/Plausible.Stats.FilterParser.html b/Plausible.Stats.FilterParser.html index 8486ee7a24ea8..820dcf094a9fd 100644 --- a/Plausible.Stats.FilterParser.html +++ b/Plausible.Stats.FilterParser.html @@ -180,14 +180,14 @@

parse_filters(filters)

Examples:

-
iex> FilterParser.parse_filters("{\"page\":\"/blog/**\"}")
-%{"page" => "/blog/**"}
+
iex> FilterParser.parse_filters("{\"page\":\"/blog/**\"}")
+%{"page" => "/blog/**"}
 
-iex> FilterParser.parse_filters("visit:browser!=Chrome")
-%{"visit:browser" => {:is_not, "Chrome"}}
+iex> FilterParser.parse_filters("visit:browser!=Chrome")
+%{"visit:browser" => {:is_not, "Chrome"}}
 
-iex> FilterParser.parse_filters(nil)
-%{}
+
iex> FilterParser.parse_filters(nil) +%{}
diff --git a/Plausible.epub b/Plausible.epub index ba80be75b14f6..cc3d2fc0bcbfd 100644 Binary files a/Plausible.epub and b/Plausible.epub differ diff --git a/PlausibleWeb.Api.StatsController.html b/PlausibleWeb.Api.StatsController.html index 679df2107efac..4857ab47c856d 100644 --- a/PlausibleWeb.Api.StatsController.html +++ b/PlausibleWeb.Api.StatsController.html @@ -626,13 +626,13 @@

main_graph(conn, params)

Plausible.Query.from/2 for each default.

  • filters - optional filters to drill down data. See the Stats API "Filtering" section for more details.

  • with_imported - boolean indicating whether to include Google Analytics -imported data or not. Defaults to false.

  • Full example:

    %{
    +imported data or not. Defaults to false.

    Full example:

    %{
       "from" => "2021-09-06",
       "interval" => "month",
       "metric" => "visitors",
       "period" => "custom",
       "to" => "2021-12-13"
    -}

    +}

    response

    @@ -647,20 +647,20 @@

    main_graph(conn, params)

    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.

    Full example:

    %{
    -  "full_intervals" => %{
    +those partial periods.

    Full example:

    %{
    +  "full_intervals" => %{
         "2021-09-01" => false,
         "2021-10-01" => true,
         "2021-11-01" => true,
         "2021-12-01" => false
    -  },
    +  },
       "imported_source" => nil,
       "interval" => "month",
    -  "labels" => ["2021-09-01", "2021-10-01", "2021-11-01", "2021-12-01"],
    -  "plot" => [0, 0, 0, 0],
    +  "labels" => ["2021-09-01", "2021-10-01", "2021-11-01", "2021-12-01"],
    +  "plot" => [0, 0, 0, 0],
       "present_index" => nil,
       "with_imported" => false
    -}
    +
    }