feat(examples): add Remix + Vite example#973
Open
thefernbot wants to merge 1 commit intogeneraltranslation:mainfrom
Open
feat(examples): add Remix + Vite example#973thefernbot wants to merge 1 commit intogeneraltranslation:mainfrom
thefernbot wants to merge 1 commit intogeneraltranslation:mainfrom
Conversation
Add a new example demonstrating gt-react integration with Remix v2 (using Vite). - Shows GTProvider setup in root.tsx - Demonstrates <T>, <Num>, and <LocaleSelector> components - Follows the existing example structure and conventions - Uses React 18 (required by Remix) - Includes Vercel deploy button
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.
Summary
Add a new example demonstrating
gt-reactintegration with Remix v2 (using Vite).What's included
<T>,<Num>, and<LocaleSelector>componentsWhy
Remix is a popular React framework and was notably missing from the examples. This helps users who want to add internationalization to their Remix apps.
Notes
This PR was created by fern 🌿
Greptile Overview
Greptile Summary
Added a new Remix + Vite example demonstrating
gt-reactintegration for internationalization, following existing example patterns.Key additions:
GTProvidersetup inapp/root.tsxwrapping the entire app with configuration fromgt.config.jsonand environment variables<T>,<Num>, and<LocaleSelector>components in the index routegtx-cli translatecommand before bundlingThe implementation follows the established conventions from other examples (like
vite-create-appandnext-create-app), uses appropriate versions (Remix 2.16, React 18), and correctly demonstrates the core gt-react functionality. No console.log statements or server-side code present.Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Browser participant RemixApp participant GTProvider participant GTReactComponents participant GTConfig User->>Browser: Access Remix app Browser->>RemixApp: Load root.tsx RemixApp->>GTConfig: Load gt.config.json RemixApp->>GTProvider: Initialize with config + env vars Note over GTProvider: projectId, devApiKey, locales GTProvider->>RemixApp: Wrap Layout with context Browser->>RemixApp: Navigate to route RemixApp->>GTReactComponents: Render _index.tsx User->>GTReactComponents: Interact with LocaleSelector GTReactComponents->>GTProvider: Update locale context GTProvider->>GTReactComponents: Re-render with new locale User->>GTReactComponents: Click counter button GTReactComponents->>GTReactComponents: Update count state GTReactComponents->>GTProvider: Translate <T> content Note over GTProvider: Translates button text with <Num> GTProvider->>Browser: Display translated content(2/5) Greptile learns from your feedback when you react with thumbs up/down!