@lilydesignsystem/svelte-locale-translations
v0.7.0
Published
Lily Design System - Svelte: per-locale label packs and CLDR time zone names (64 locales) and the loader for the data grid, kanban board, calendar, Gantt chart and filter helpers
Maintainers
Readme
Lily Design System™ Svelte locale translations
@lilydesignsystem/svelte-locale-translations — the strings the Svelte grid-like helpers need, one JSON pack per locale (64), and the loader that turns a pack into a ready labels object.
Lily ships no English defaults, so every app used to write and translate about 185 strings per helper itself. A pack is that work done once.
import { labelsFor } from "@lilydesignsystem/svelte-locale-translations";
import cy from "@lilydesignsystem/svelte-locale-translations/cy-001";
<DataGrid label="…" labels={labelsFor("data-grid", cy)} … />labelsFor(helper, pack) returns a ready labels for the Svelte helpers (data-grid, kanban-board, calendar, gantt-chart, filter).
Which package
All nine catalogs have their own package so you install the one that matches your framework: @lilydesignsystem/{svelte,react,solid,vue,angular,html,web-components,nunjucks}-locale-translations (npm) and LilyDesignSystem.Blazor.LocaleTranslations (NuGet). The packs are identical in every one; the generic @lilydesignsystem/locale-translations carries the same files and both loaders for tooling that serves no one framework.
What a pack holds
The labels for each helper, plus locale, reviewed, direction, endonym and exonyms (the language's name in itself and in each other pack's language; none yet for Bhojpuri). Only English (en-001) is reviewed; the other 63 are machine drafts, so check pack.reviewed and have a native speaker read one, screen-reader wording especially, before it ships in a product. A key a pack lacks leaves that label unset, never another language. Dates stay out of packs: use Intl.
Text size names
Every pack also has a text-size section: the text-size-picker's seven names (largest, larger, large, normal,
small, smaller, smallest) in the pack's language, e.g. Spanish el más grande … el más pequeño. textSizeLabels(pack)
returns them as the picker's sizeLabels (Blazor: LocaleTranslations.TextSizeLabels(locale) for SizeLabels); a size a
pack lacks is omitted, never filled from another language. Like the rest of the pack they are unreviewed machine drafts
(English excepted), and Cornish, Scots and Bhojpuri are lowest confidence.
Date-time-now-input names
Every pack also has a date-time-now-input section: the headless date-time-now-input's three control names (date,
time, now), e.g. Spanish Fecha, Hora, Ahora. The component has no English default, so take them from here:
dateTimeNowInputLabels(pack) returns { dateLabel, timeLabel, nowLabel }, ready to spread onto the component (Blazor:
LocaleTranslations.DateTimeNowInputLabels(locale) gives Date, Time and Now for DateLabel, TimeLabel and
NowLabel). A name a pack lacks is omitted, so that control stays unnamed rather than in another language. Unreviewed
machine drafts like the rest (English excepted).
Time zone names (Unicode CLDR)
The localized display names of IANA time zones, one pack per locale (all 64), for the time zone pickers:
import { zoneNamesFrom } from "@lilydesignsystem/svelte-locale-translations";
import fr from "@lilydesignsystem/svelte-locale-translations/zone-names/fr-001";
const names = zoneNamesFrom(fr); // the time zone picker's `names` inputA pack names about 425 zones, with the daylight name where a zone has one (Europe/Paris: heure normale d’Europe centrale, heure d’été d’Europe centrale). A zone CLDR has no name for in a language is not in its pack, never filled from another language; Cornish, Scots and Wu have none at all. The packs are generated by bin/generate-zone-names from the CLDR in Node's ICU (the version is in each pack), and the CLDR licence notice ships in zone-names/UNICODE-LICENSE.txt. See spec/zone-names.
Source
Edited in the monorepo's shared/ and copied here by bin/sync-shared-modules; never edit a copy. Contract: spec/label-packs.
