012af11d77
## What
The marketing site now serves every language the **documentation** ships
— 14 locales (`en, fr, ar, cs, de, es, it, ja, ko, pt, ro, ru, tr, zh`),
up from 3 (`en, es, fr`).
## How
- **Single source of truth.** `WEBSITE_LOCALE_LIST` derives directly
from `DOCUMENTATION_SUPPORTED_LANGUAGES` (`twenty-shared/constants`).
Add a documentation language → it flows to the website automatically.
- **Off `APP_LOCALES` entirely.** The website locale type is now
`DocumentationSupportedLanguage` (short codes), so a locale **is** its
URL segment — no short↔full mapping, and no `pt-BR`/`zh-CN` ambiguity to
resolve.
- **Removed the indirection this exposed** (it only existed because
`AppLocale` was a superset of the deployed set):
- `locale-to-url-segment` / `locale-by-url-segment` (locale == segment)
- `get-locale-messages` pass-through → callers read `MESSAGES_BY_LOCALE`
directly
- the `messages-by-locale` runtime guard → a total
`Record<DocumentationSupportedLanguage, Messages>` (a missing catalog is
now a **compile** error, not a runtime throw)
- `isWebsiteLocale` → a `string → DocumentationSupportedLanguage` type
guard
- the vestigial language-code `split('-')` in `locale-display-name`
## Catalogs
- Renamed `es-ES → es`, `fr-FR → fr`; added 11 new locales (untranslated
for now → **English fallback**).
- `crowdin-website.yml` switched to `%two_letters_code%`.
- Regenerating catalogs also synced `en.po` with current source
(`Boolean` / `Date & Time` / removed `Fields widget` from the
already-merged #22249).
- `ci-website` is unchanged — no `lingui:compile` step added; catalogs
stay committed.
## Testing
- `typecheck` · `lint` (check-conventions + oxlint + oxfmt) · 347/347
tests — all green. PR CI runs exactly lint + typecheck + test.
## Follow-up (out of repo)
Enable the 11 languages on **Crowdin project 4** so `website-i18n-pull`
backfills real translations. Until then, the new locales render with
English fallback (correct behavior).
23 lines
696 B
TypeScript
23 lines
696 B
TypeScript
import { defineConfig } from '@lingui/conf';
|
|
import { formatter } from '@lingui/format-po';
|
|
import { DOCUMENTATION_DEFAULT_LANGUAGE } from 'twenty-shared/constants';
|
|
|
|
import { WEBSITE_LOCALE_LIST } from './src/platform/i18n/website-locale-list';
|
|
|
|
export default defineConfig({
|
|
sourceLocale: DOCUMENTATION_DEFAULT_LANGUAGE,
|
|
locales: [...WEBSITE_LOCALE_LIST],
|
|
fallbackLocales: {
|
|
default: DOCUMENTATION_DEFAULT_LANGUAGE,
|
|
},
|
|
catalogs: [
|
|
{
|
|
path: '<rootDir>/src/locales/{locale}',
|
|
include: ['src'],
|
|
},
|
|
],
|
|
catalogsMergePath: '<rootDir>/src/locales/generated/{locale}',
|
|
compileNamespace: 'ts',
|
|
format: formatter({ lineNumbers: false, printLinguiId: true }),
|
|
});
|