Skip to content

feat(core): add i18n localization system, Italian translation, and LanguageSelector component - #3327

Open
FrancescoCastaldi wants to merge 1 commit into
evidence-dev:nextfrom
FrancescoCastaldi:feat/i18n-locale-support-and-selector
Open

feat(core): add i18n localization system, Italian translation, and LanguageSelector component#3327
FrancescoCastaldi wants to merge 1 commit into
evidence-dev:nextfrom
FrancescoCastaldi:feat/i18n-locale-support-and-selector

Conversation

@FrancescoCastaldi

Copy link
Copy Markdown

Description

This PR introduces native Internationalization (i18n), Italian Translation (it-IT), and the <LanguageSelector> component to Evidence.

Features

  1. i18n Architecture & Locale Context (core/src/i18n):
    • Reactive LocaleState context with $state for dynamic language switching.
    • Translation helper t(key, params) and localized date/number formatting using Intl.DateTimeFormat and Intl.NumberFormat.
  2. Italian Localization (it-IT):
    • Complete translations for date range presets (e.g. "Oggi", "Ieri", "Ultimi 7 giorni", "Questo mese", "Tutto il periodo", etc.).
    • UI controls translation (search placeholders, "Totale", "Subtotale", pagination "Pagina X di Y", "Scarica CSV", etc.).
  3. <LanguageSelector> (language_selector) Component:
    • Interactive language picker supporting pills and buttons style (variant="pills|buttons").
    • Allows users/viewers to switch language on the fly (e.g., 🇬🇧 English, 🇮🇹 Italiano).
    • Localized calendar and date pickers instantly re-render in the selected locale.
  4. Project Settings:
    • Added locale field to projectSettingsSchema (defaulting to en-US).
  5. Unit Tests:
    • Added test suite for locale-context and LanguageSelector with 100% pass.

…nguageSelector component

- add i18n locale context with reactive LocaleState and translation dictionary
- add full Italian (it-IT) translation for UI controls, calendar presets, and date ranges
- add <LanguageSelector> / language_selector tag supporting pills, buttons, and dropdown styles
- add locale configuration in project settings schema
- support dynamic locale prop in RangeCalendar and date pickers
- add unit test suites for i18n and LanguageSelector
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Evidence Team on Vercel.

A member of the Team first needs to authorize it.

@FrancescoCastaldi

Copy link
Copy Markdown
Author

Hi @archiewood @hughess! 👋 This PR adds a complete i18n localization system, full Italian translation (it-IT), and the component. Whenever you have time, we'd appreciate your review!

@hughess

hughess commented Aug 27, 2026

Copy link
Copy Markdown
Member

Hi @FrancescoCastaldi, thanks for this PR. We have a translations system in the product - is there a reason that doesn't work for you?
https://docs.evidence.dev/features/translations

@FrancescoCastaldi

Copy link
Copy Markdown
Author

@hughess The existing translation system is great for translating markdown pages and routing, but this PR focuses on the built-in component UI strings (like table pagination 'Page X of Y', search placeholders, CSV download labels, date picker preset names like 'Last 7 days') and adds the <LanguageSelector> component for switching the UI locale dynamically on the fly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants