Conversation
Merging in changes from develop
Merging develop and main
- Add languages.ts config with 5 supported languages - Add LanguageSelector component - Add preferredLanguageCode to authStore - Add setWelcomeLanguage to chatStore with buildInitialState pattern - Add loadPromptsForLanguage to promptStore - Add preferredLanguageCode to /api/auth/me response - Add metadata.preferred_language_code to ChatPrompt type - Add welcome messages for all 5 languages - Add translated welcome-prompts JSON files
- Wrap app in NextIntlClientProvider - Load English synchronously, other locales on demand with caching - AuthBootstrapper now reads preferredLanguageCode from /api/auth/me - Browser locale detection fallback for anonymous users - Language changes propagate to chatStore welcome message and promptStore - html lang attribute kept in sync with active locale
- Replace static ChatContextOptions with useChatContextOptions() hook - Export ChatContextIcons for icon-only consumers - Update ContextTag, ContextMenu, HighlightedFeaturesLayer imports
Migrated: WelcomeModal, Reasoning, CopySelectionTooltip, ChatPanel, MessageBubble, WidgetMessage, InsightProvenanceDrawer, BasemapSelector, MapAreaControls, UploadAreaDialog, ChatDisclaimer, DatasetInfoModal, ThreadActionsMenu, ThreadDeleteDialog, ThreadRenameDialog, ThreadShareDialog, VisualizationDisclaimer
…nce, unauthorized)
…or fr/es/pt/id) These files are English placeholders. Real translations will be added incrementally without code changes.
…ages' option + toast - Add 'Display Language' label above the 5 language options - Add separator + 'Other Languages…' item with info icon at bottom - Clicking 'Other' shows informational toast explaining the assistant understands many more languages, without changing the current selection - All strings use useTranslations for i18n support
…NVIRONMENT_FALLBACK warning
Previously the header LanguageSelector only updated in-memory state, so the choice was lost on page reload. Now for authenticated users it also PATCHes /api/proxy/auth/profile (fire-and-forget) so the preference survives across sessions and stays in sync with the dashboard/onboarding profile setting.
…API" This reverts commit 34eb95d.
Use explicit gray.800 color for language names, gray.500 for codes and labels, and bump font size to sm. The semantic color tokens (fg.muted etc) were resolving to near-invisible values on the white dropdown background.
Replace English placeholder content with actual translations across 6 namespaces (common, chat, dialogs, onboarding, dashboard, errors) for all 4 non-English locales. Landing page strings left as English per request. Brand names (Global Nature Watch, Global Forest Watch, Land & Carbon Lab, PREVIEW) kept in English across all locales. All 24 JSON files validated for correct syntax and key parity with the English source files.
Comprehensive markdown document with tables for all ~200 translation keys across 6 namespaces (common, chat, dialogs, onboarding, dashboard, errors). Each row includes: key, all 5 language translations, source component file(s), and how to access that string in the running app.
… doc Migrate ChatMessages.tsx preview disclaimer from hardcoded English to next-intl translation keys (previewDisclaimer.*). Add translations for all 5 languages. Brand heading kept in English. Update verification doc with: - Preview disclaimer section (8 new keys × 5 languages) - Starter prompts section explaining the separate welcome-prompts JSON files and how they differ from the next-intl translation system
- Replace GlobeIcon with TranslateIcon (A↔文) in LanguageSelector - Add display=inline-block to LanguageSelector wrapper to prevent block-level stretching - Add px=4 py=1.5 to prompts progress bar for button-like padding - Reduce header Flex gap from 6 to 3 for tighter, visually even spacing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ents - Reject empty prompts arrays (previously passed Array.isArray check) - Filter out non-string and whitespace-only elements from prompt data - Fall back to English when all elements are invalid after filtering - Add Vitest infrastructure and 9 tests covering validation + regressions
- Add AbortController to cancel in-flight fetches when language changes - Abort happens before the English early-return path, not just before new fetches, so switching to English mid-fetch cancels correctly - Silently ignore aborted requests via signal.aborted check (robust across environments that may not throw DOMException) - Add 3 race condition tests: last-language-wins, abort-does-not- fallback, and signal-passed-to-fetch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds full UI internationalisation to the app using next-intl, supporting 5 languages: English, French, Spanish, Portuguese, and Indonesian. All ~270 fixed UI strings across ~45 components are now translatable. English is bundled statically (zero latency for most users); other locales are lazy-loaded on demand and cached in memory.
/).What changed
96 files changed · 4,028 additions · 509 deletions · 22 commits
Infrastructure
next-intlv4.8.3app/i18n/config.ts— supported locales, default locale, lazy-loading configapp/i18n/getMessages.ts— async message loader that merges all namespace files per localeapp/i18n/welcomeMessages.ts— standalone welcome messages (used by chatStore before i18n provider mounts)app/components/providers/index.tsx—I18nProviderwrappingNextIntlClientProviderwith reactive locale switching andtimeZone="UTC"app/config/languages.tsandapp/components/LanguageSelector.tsxLocale Files (35 JSON files)
public/locales/en/:common,chat,dialogs,onboarding,dashboard,landing,errorspublic/locales/{fr,es,pt,id}/— real translations for 6 namespaces (landing excluded, remains English)public/welcome-prompts-{fr,es,pt,id}.json— locale-specific starter prompt suggestionsMigrated Components (~45 files)
PageHeader,sidebar,ChatInput,ChatPanelHeader,ContextButton(+hook),ContextTag,ContextMenu,HighlightedFeaturesLayer,LanguageSelectorChatMessages,ChatPanel,MessageBubble,Reasoning,CopySelectionTooltip,WelcomeModal,WidgetMessage,ChatDisclaimer,VisualizationDisclaimer,SamplePromptsMapAreaControls,BasemapSelector,UploadAreaDialogThreadActionsMenu,ThreadDeleteDialog,ThreadRenameDialog,ThreadShareDialog,DatasetInfoModalInsightProvenanceDrawerapp/onboarding/form.tsxapp/dashboard/page.tsxnot-found.tsx,maintenance/page.tsx,unauthorized/page.tsxGlobalHeader(+NavItems component),Hero,FeaturesTabs,HowItWorks,Footer,SupportWorkTabs,TrustedPlatforms,FutureOfMonitoring,TeamSection,NewEraQuote,LatestUpdates,CTAStore Changes
authStore.ts— addedpreferredLanguageCodefield, extracted from/auth/meresponsechatStore.ts—buildInitialStaterespects language,setWelcomeLanguageaction, metadata fieldpromptStore.ts—loadPromptsForLanguage()fetches locale-specific prompt filesapp/types/chat.ts— addedmetadata?.preferred_language_codeapp/api/auth/me/route.ts— extracts and returnspreferredLanguageCodeKey Patterns
ChatContextOptions→useChatContextOptions()hook — allowst()calls for context chip labelst()callsrenderNavItems→NavItemscomponent — GlobalHeader's standalone function couldn't use hooksLanguage Selector Behavior
🌐 EN). Dropdown shows 5 supported languages + an "Other Languages…" info item/dashboardis persisted via PATCH and is the authoritative source on page reloadnavigator.languageif supported → defaults to"en"Verification
A comprehensive verification document is included at
docs/i18n-translations-verification.mdwith:Not in Scope
/)landing.jsonremains English-onlyTesting
Development
(e.g., common.json, chat.json, dialogs.json, etc.)
id/, pt/
The locale files are organized by namespace — common.json for shared UI,
chat.json for chat-specific, dialogs.json for modals, landing.json for the
landing page, etc.