feat: add Catalan (ca) language support as default locale#371
feat: add Catalan (ca) language support as default locale#371jaumemir wants to merge 1 commit intoTHU-MAIC:mainfrom
Conversation
- Add 'ca' to Locale type with VALID_LOCALES export; set defaultLocale to 'ca' - Add Catalan translations (400+ keys) to all 5 i18n modules - Update language selectors in header and home page (CN/EN/CA dropdown) - Update generation toolbar to cycle through 3 languages (中文/EN/CA) - Extend UserRequirements, SceneOutline and pblConfig language unions to include 'ca' - Update normalizeLanguage, scene-generator and scene-content route for 'ca' - Add Azure TTS Catalan voices (ca-ES-AlbaNeural, ca-ES-EnricNeural) - Update TTS preview text with Catalan fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hey, thanks for putting this together! Since this PR was opened, we've refactored the i18n system. Adding a new locale now only needs two changes:
See the Translation Guide and #365 (Japanese) for reference. Could you rebase onto current Also, please keep the default locale as |
1 similar comment
|
Hey, thanks for putting this together! Since this PR was opened, we've refactored the i18n system. Adding a new locale now only needs two changes:
See the Translation Guide and #365 (Japanese) for reference. Could you rebase onto current Also, please keep the default locale as |
Summary
Adds full Catalan (
ca) language support to OpenMAIC as the default locale, covering UI labels, course content generation, TTS audio voices, and all language selectors across the application.Related Issues
Changes
lib/i18n/types.ts— WidenedLocaletype to'zh-CN' | 'en-US' | 'ca'; setdefaultLocale = 'ca'; exportedVALID_LOCALEScentrallylib/i18n/settings.ts / chat.ts / common.ts / stage.ts / generation.ts— Added full Catalan translation objects (~600+ keys)lib/i18n/index.ts— Registered'ca'in the translation map and updatedgetClientTranslationlib/hooks/use-i18n.tsx— Auto-detects Catalan vianavigator.language.startsWith('ca'); importsVALID_LOCALESfrom central sourcecomponents/header.tsx— Added "CA" locale pill to the language switcherapp/page.tsx— ExtendedFormState.languageunion; added CA option to the generation language selector; default is'ca'components/generation/generation-toolbar.tsx— Updated 3-language cycle (zh-CN → en-US → ca → …)components/agent/agent-bar.tsx— Added Catalan TTS preview text ("Benvingut a l'aula d'IA")lib/server/classroom-generation.ts—normalizeLanguage()now handles'ca'lib/types/generation.ts— All language union types widened to include'ca'lib/audio/constants.ts— Addedca-ES-AlbaNeural(female) andca-ES-EnricNeural(male) Azure TTS voicesType of Change
Verification
Steps to reproduce / test
ca-ES-AlbaNeuralandca-ES-EnricNeuralappear in the voice listenorzhand reload — verify auto-detection switches locale correctlyWhat you personally verified
ca,en, andzh-CNnavigator languagesEvidence
pnpm check && pnpm lint && npx tsc --noEmit)Development
Development realized by Claude Code, under supervision of Author.