Utilities

The following utility functions are available:

Impostor.coerse_string_typeFunction
coerse_string_type(v::Vector{<:AbstractString}) :: Union{String, Vector{String}}

Automatically unpack the return value of a generator function into a single string, when appropriate.

Parameters

  • v::Vector{<:AbstractString}: value(s) returned by some generator function.

Example

julia> Impostor.coerse_string_type(["Mark"])
"Mark"

julia> Impostor.coerse_string_type(["Mark", "Jane"])
2-element Vector{String}:
 "Mark"
 "Jane"
source
Impostor.setlocale!Function
setlocale!(loc::String)
setlocale!(loc::Vector{<:AbstractString})

Set loc as the default locale for the current session.

source
Impostor.is_provider_availableFunction
is_provider_available(p::AbstractString) :: Bool

Return whether the provided p is available.

Parameters

  • p::AbstractString: provider name
source
Impostor.is_content_availableFunction
is_content_available(p::T, c::T) :: Bool where {T <: AbstractString}

Return whether the content c is available for provider p.

Parameters

  • p::AbstractString: provider name
  • c::AbstractString: content name
source
Impostor.is_locale_availableFunction
is_locale_available(p::T, c::T, l::T) :: Bool where {T <: AbstractString}

Return whether the provided locale l is available for content c from provider p.

Parameters

  • p::AbstractString: provider name
  • c::AbstractString: content name
  • l::AbstractString: locale name
source