Files
accounted/supabase/migrations/20260522140000_add_customer_language.sql
T
Mattsson 78c91e00e4 feat: add language preference for customers to support invoice locali… (#561)
* feat: add language preference for customers to support invoice localization

- Introduced language support for invoices, allowing customers to choose between Swedish and English.
- Updated invoice PDF generation to reflect the selected language for titles, labels, and messages.
- Enhanced email templates to generate content in the customer's preferred language.
- Added migration to include a language column in the customers table with a default value of Swedish.
- Updated tests to verify correct language usage in invoice emails and PDFs.

* fix: debounce API requests in InvoicePreviewCard and update F-skatt terminology in email templates
2026-05-22 15:21:05 +02:00

17 lines
696 B
SQL

-- Add language preference per customer.
--
-- Drives the locale of the customer-facing invoice PDF and email when this
-- customer is invoiced. Defaults to Swedish, matching the existing behavior.
-- Adding more locales is a follow-up migration so we never end up with an
-- orphan value the templates don't have translations for.
--
-- Per-customer (not per-invoice) because the user shouldn't have to pick a
-- language every time they bill the same recipient — set it once on the
-- customer record and every future invoice + email honors it.
ALTER TABLE public.customers
ADD COLUMN language TEXT NOT NULL DEFAULT 'sv'
CHECK (language IN ('sv', 'en'));
NOTIFY pgrst, 'reload schema';