Set the display locale of a plot

locale_forma.RdAdd the component with p + locale_forma(...). Complete Mosaic and Pie
charts localize their own layers, original category scales and facet strips.
Radar uses the standard ggplot label registration described below. The
spoke names, raw ticks and value labels remain as supplied to the Radar plot.
Statistical calculations, data keys, coordinates and facet membership use
the original data. An author-supplied scale or facet keeps its own labels.
Additional layers and theme overrides are carried into the returned plot.
Arguments
- lang
Display language tag passed to
locale_info().- dictionary
Local dictionary accepted by
forma_translate(). Omitting this argument reuses the plot's dictionary. Explicit NULL clears it.- region
Optional region override for
locale_info().- ...
Additional settings for
locale_info(), including number, percent, date and break locales, text direction and font family.- labels
Optional named character vector of literal dictionary IDs. Names can be title, subtitle, caption, tag, x, y, colour or fill.
Details
On any standard ggplot you can register literal title or axis-label IDs
with labels. For example, labels = c(title = "visits") looks up the ID
visits in dictionary context plot.title. Later locale switches use
that ID. A subsequent labs() override takes precedence until the field
is explicitly registered again. Third-party layer text, custom label
callbacks and mathematical expressions remain under the author's control.
Examples
d <- data.frame(site = c("N", "S"), n = c(16, 24))
dict <- data.frame(variable = "site", id = c("N", "S"), lang = "en",
label = c("North", "South"))
ggpie(d, "site", "n") + locale_forma("en", dictionary = dict)