feat(i18n): add Slovenian (sl) language support
Closes #580. Slovenian community contribution from @blazmaric (filed as an issue with attached files rather than as a PR — files inlined here unchanged except for the migration number). ## Changes - **`frontend/src/i18n/locales/sl.json`** — full Slovenian UI translations. Covers every top-level key present in `en.json` as of pre-CRM beta. The new CRM-module keys (`bills`, `businessProfile`, `calendar`, `contracts`, `crm`, `crmDev`, `crmSettings`, `dealLineage`, `eventReminderOverride`, `hoursLogging`) are not yet translated and will fall back to English — same posture as FR / NL / PT / RU / ES currently have for the CRM module (see PR #555 description). - **`frontend/src/components/common/LanguageSelector.tsx`** — adds `SLFlag` SVG component + registers `{ code: 'sl', name: 'Slovenščina', Flag: SLFlag }` in `SUPPORTED_LANGUAGES`. Frontend i18n auto-discovers locale files via `import.meta.glob` so no separate config registration is needed. - **`backend/migrations/core/108_seed_sl_email_template_translations.js`** — contribution-author's `107_*` filename renumbered to `108_` to avoid collision with `107_crm_consolidated.js` that landed on beta in the meantime. Idempotent insert via (template_id, language) uniqueness check — re-runnable, never overwrites admin edits. Covers 17 templates: admin invitation / password reset, archive complete, backup completed / failed, customer gallery assigned, customer invitation / password reset, database backup completed / failed, expiration warning, gallery created / expired, restore completed / failed, version update available / test. - **`backend/src/services/emailProcessor.js`** — adds `.si → sl` to the email-domain → language inference map, matching the pattern for every other supported locale. A customer with `@example.si` now gets Slovenian emails automatically without needing to set their preferred_language explicitly. ## Out of scope (consistent with existing locales) - CRM email templates (quote_sent, invoice_sent, contract_sent, etc., seeded at boot by `crmEmailTemplates.ensureCrmEmailTemplatesSeeded`) will fall back to English for Slovenian customers — those seeders only emit EN + DE rows today across every locale. - CRM UI strings under the missing top-level keys listed above will fall back to English. Both gaps mirror the existing FR / NL / PT / RU / ES situation.
This commit is contained in:
@@ -62,6 +62,22 @@ const ESFlag: React.FC<{ className?: string }> = ({ className = "w-5 h-5" }) =>
|
||||
</svg>
|
||||
);
|
||||
|
||||
const SLFlag: React.FC<{ className?: string }> = ({ className = "w-5 h-5" }) => (
|
||||
<svg className={className} viewBox="0 0 640 480" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="#fff" d="M0 0h640v160H0z"/>
|
||||
<path fill="#005DA4" d="M0 160h640v160H0z"/>
|
||||
<path fill="#ED1C24" d="M0 320h640v160H0z"/>
|
||||
<path fill="#005DA4" d="M160 80h120v120c0 60-60 90-60 90s-60-30-60-90V80z"/>
|
||||
<path fill="#fff" d="M172 96h96v100c0 36-28 61-48 74-20-13-48-38-48-74V96z"/>
|
||||
<path fill="#005DA4" d="M184 108h72v82c0 26-18 46-36 59-18-13-36-33-36-59v-82z"/>
|
||||
<path fill="#fff" d="m198 178 22-36 22 36h-44z"/>
|
||||
<path fill="#ED1C24" d="M184 202h72c-6 21-24 37-36 45-12-8-30-24-36-45z"/>
|
||||
<circle fill="#FFD700" cx="198" cy="122" r="5"/>
|
||||
<circle fill="#FFD700" cx="220" cy="116" r="5"/>
|
||||
<circle fill="#FFD700" cx="242" cy="122" r="5"/>
|
||||
</svg>
|
||||
);
|
||||
|
||||
export const SUPPORTED_LANGUAGES = [
|
||||
{ code: 'en', name: 'English', Flag: GBFlag },
|
||||
{ code: 'de', name: 'Deutsch', Flag: DEFlag },
|
||||
@@ -70,6 +86,7 @@ export const SUPPORTED_LANGUAGES = [
|
||||
{ code: 'nl', name: 'Nederlands', Flag: NLFlag },
|
||||
{ code: 'fr', name: 'Français', Flag: FRFlag },
|
||||
{ code: 'es', name: 'Español', Flag: ESFlag },
|
||||
{ code: 'sl', name: 'Slovenščina', Flag: SLFlag },
|
||||
];
|
||||
|
||||
export const LanguageSelector: React.FC = () => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user