chore(skunk): DNM WIP very basic attempt at translating Compass SKUNK-500#8076
Draft
nbbeeken wants to merge 4 commits into
Draft
chore(skunk): DNM WIP very basic attempt at translating Compass SKUNK-500#8076nbbeeken wants to merge 4 commits into
nbbeeken wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces an initial localization (i18n) pipeline for the Compass welcome surfaces and exposes a new language preference through the preferences model and Settings UI.
Changes:
- Adds an i18next/react-i18next setup for the Compass Welcome workspace tab + welcome modal and wires it to the new
languagepreference. - Introduces a
languageuser preference (schema + provider exports) and surfaces it in Settings as an enum. - Updates Compass Welcome UI strings to use translation keys (with
Transfor embedded links) and adds required runtime dependencies.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-welcome/src/index.ts | Wraps welcome surfaces with an i18n provider and syncs language from preferences. |
| packages/compass-welcome/src/i18n.ts | Adds the i18next instance and inlined en/ja resources for the welcome namespace. |
| packages/compass-welcome/src/components/modal.tsx | Switches modal copy to translated strings and uses Trans for the settings link. |
| packages/compass-welcome/src/components/desktop-welcome-tab.tsx | Switches welcome tab copy to translated strings and uses Trans for the Atlas link. |
| packages/compass-welcome/package.json | Adds i18n runtime dependencies needed by the new implementation. |
| packages/compass-settings/src/components/settings/settings-list.tsx | Registers the new language preference as a supported enum setting. |
| packages/compass-settings/src/components/settings/general.tsx | Adds language to the General settings fields list. |
| packages/compass-preferences-model/src/provider.ts | Re-exports LANGUAGE_VALUES for UI consumption. |
| packages/compass-preferences-model/src/preferences-schema.tsx | Defines LANGUAGE_VALUES + language preference schema and UI metadata. |
| package-lock.json | Locks new i18n dependencies and their transitive deps. |
| const language = usePreference('language'); | ||
| React.useEffect(() => { | ||
| void i18n.changeLanguage(language); | ||
| }, [language]); |
Comment on lines
19
to
22
| import { useConnectionActions } from '@mongodb-js/compass-connections/provider'; | ||
| import { usePreference } from 'compass-preferences-model/provider'; | ||
| import { Trans, useTranslation } from 'react-i18next'; | ||
| import { WelcomeTabImage } from './welcome-image'; |
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.
Description
SKUNK-500
NOTE: This is not production code. Do not review.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes