% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01_labels.R
\name{vocab_table}
\alias{vocab_table}
\title{Build a \code{vocab} function from a plain name table}
\usage{
vocab_table(..., default_locale = "en-GB")
}
\arguments{
\item{...}{Named entries, one per locale (e.g. \code{ `en-GB` = list(wide = month.name, abbreviated = month.abb)}). Locale tags follow BCP 47.}

\item{default_locale}{The locale returned when \code{locale} is unsupplied (or
explicitly \code{NULL}, meaning "caller didn't ask", since
\code{time_parse()}/\code{format()} always pass some value for \code{locale}).}
}
\value{
A function \verb{function(type = NULL, locale = NULL)}, suitable as
the \code{vocab} field of a \code{\link[=label_scheme]{label_scheme()}}.
}
\description{
The common case for a \code{\link[=label_scheme]{label_scheme()}} \code{vocab} argument: a hand-listed
table of names, one entry per locale, each a named list of renderings. By
convention these follow CLDR's wide/abbreviated/narrow, but \code{type} can be
anything. \code{vocab_table()} wraps it in the \verb{function(type = NULL, locale = NULL)} shape \code{vocab} requires.
}
\details{
For vocab backed by an external i18n source instead of a hand-listed
table, write that \verb{function(type, locale)} directly instead. Same shape,
no list needed.
}
\examples{
month_vocab <- vocab_table(`en-GB` = list(wide = month.name, abbreviated = month.abb))
month_vocab("abbreviated")
month_vocab(locale = "en-GB")

}
\seealso{
\code{\link[=label_scheme]{label_scheme()}}
}
