@sveltebuilder/local-text-schema
v0.2.1
Published
Drizzle table definitions and seed data for SvelteBuilder's core i18n tables — locale, local_text_link, local_text.
Maintainers
Readme
@sveltebuilder/local-text-schema
Drizzle table definitions and seed data for the core SvelteBuilder i18n tables — locale, local_text_link, local_text. This is the base schema that diglossia dictionary payloads are read from; every SvelteBuilder scaffold and domain module depends on it.
Install
npm install @sveltebuilder/local-text-schemaUsage
import { locale, localTextLink, localText } from '@sveltebuilder/local-text-schema/schema';
import { LOCALES, BASE_SLUGS } from '@sveltebuilder/local-text-schema/seed';@sveltebuilder/local-text-schema/schema— DrizzlepgTabledefinitions with bigint identity primary keys, matching the SQL described in the SvelteBuilder README:locale—id,code(BCP-47, unique),name,nativeName,dir('ltr' | 'rtl')localTextLink—id,slug,scope(nullable),entityId(nullable, polymorphic — no FK, points across many domain tables by convention)localText—id,link(FK),locale(FK),content, unique on(link, locale)
Each table also exports its inferred row types (
Locale/NewLocale,LocalTextLink/NewLocalTextLink,LocalText/NewLocalText).@sveltebuilder/local-text-schema/seed—LOCALES, the default set of eight supported locales (en,fr,es,de,pt-BR,ja,zh-CN,ar), andBASE_SLUGS, the baseline application UI copy (navigation, actions, form states) with English and French translations.
Part of the SvelteBuilder ecosystem
@sveltebuilder/cli's sveltebuilder sync:supabase command discovers this schema alongside domain module schemas and generates ordered Supabase migrations from them. See the SvelteBuilder README for the full architecture.
