Helper functions for working with Gettext in Fakererer.
Provides functions to pick random items from Gettext translations, which is the core mechanism for locale-specific fake data.
Summary
Functions
Returns all items from a Gettext translation as a list.
Picks a random item from a Gettext translation.
Picks multiple random items from a Gettext translation.
Functions
Returns all items from a Gettext translation as a list.
Picks a random item from a Gettext translation.
The translation is expected to be a newline-separated list of items. Falls back to the msgid if no translation is found.
Examples
iex> Fakererer.Gettext.Helpers.pick_random("address", "city_prefix")
"Thị trấn"
@spec pick_random_many(String.t(), String.t(), non_neg_integer()) :: [String.t()]
Picks multiple random items from a Gettext translation.