-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/translation #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
micksabox
wants to merge
28
commits into
main
Choose a base branch
from
feat/translation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
04e5d23
feat: internationalization fullstack setup
micksabox 2a673b3
chore: internationalization configuration
micksabox 2786767
chore: configure settings
micksabox 5f328ed
Merge branch 'feat/translation' into dev
micksabox f1c85cf
fix: server start and stream
micksabox 4187312
feat: forward client env to browser context
micksabox bbc3ec2
fix: vite dev server issues by moving /src into /app and setup tsconf…
micksabox ad319a0
feat: language switcher in footer
micksabox 1473f35
fix: type resolution and parse error for resource.locales
micksabox ebab202
feat: configure languine.ai
micksabox c95d07f
feat: footer, header and french language localization
micksabox e1262f8
fix: tailwind and try transmart
micksabox be393c6
feat: language select persistence & detection via cookie
micksabox 40d1d26
fix: default locale detection
micksabox fa4e331
chore: remove unused individual empiricism post
micksabox 670d442
chore: more localization config w/ languine.ai
micksabox 42f63a3
fix: metagame post
micksabox 3455b3a
fix: order of locale detection
micksabox 3f1de81
chore: remove transmart
micksabox 7ced2ca
docs: localization readme
micksabox 5377a75
refactor: translation keys and homepage translated
micksabox 49904ac
feat: more homepage translations keyed
micksabox 82e7850
chore: more translations throughout app
micksabox b2a8522
chore: localize date picker
micksabox 1ccee57
feat: memery translation
micksabox 42ff3a8
feat: update privacy translations
micksabox 9b8faf6
chore: privacy localized
micksabox 583a556
feat: privacy translations
micksabox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| You are an expert in React Router 7, TailwindCSS, and TypeScript, focusing on scalable web development. | ||
|
|
||
| **Key Principles** | ||
|
|
||
| - Provide clear, precise React Router 7 and TypeScript examples. | ||
| - Apply immutability and pure functions where applicable. | ||
| - Favor route modules and nested layouts for composition and modularity. | ||
| - Use meaningful variable names (e.g., `isAuthenticated`, `userRole`). | ||
| - Always use kebab-case for file names (e.g., `user-profile.tsx`). | ||
| - Prefer named exports for loaders, actions, and components. | ||
|
|
||
| **TypeScript & Remix** | ||
|
|
||
| - Define data structures with interfaces for type safety. | ||
| - Avoid the `any` type, fully utilize TypeScript's type system. | ||
| - Organize files: imports, loaders/actions, component logic. | ||
| - Use template strings for multi-line literals. | ||
| - Utilize optional chaining and nullish coalescing. | ||
| - Use nested layouts and dynamic routes where applicable. | ||
| - Leverage loaders for efficient server-side rendering and data fetching. | ||
| - Use `useFetcher` and `useLoaderData` for seamless data management between client and server. | ||
|
|
||
| **File Naming Conventions** | ||
|
|
||
| - `*.tsx` for React components | ||
| - `*.ts` for utilities, types, and configurations | ||
| - `root.tsx` for the root layout | ||
| - All files use kebab-case. | ||
|
|
||
| **Code Style** | ||
|
|
||
| - Use single quotes for string literals. | ||
| - Indent with 2 spaces. | ||
| - Ensure clean code with no trailing whitespace. | ||
| - Use `const` for immutable variables. | ||
| - Use template strings for string interpolation. | ||
|
|
||
| **Remix-Specific Guidelines** | ||
|
|
||
| - Routes are mapped from URL schemas to files in `app/routes.ts` | ||
| - Use `<Link>` for navigation, avoiding full page reloads. | ||
| - Implement loaders and actions for server-side data loading and mutations. | ||
| - Import type `Route` from `./+types/{route-filename}.ts` to type loaders and actions. | ||
| - Ensure accessibility with semantic HTML and ARIA labels. | ||
| - Leverage route-based loading, error boundaries, and catch boundaries. | ||
| - Use the `useFetcher` hook for non-blocking data updates. | ||
| - Cache and optimize resource loading where applicable to improve performance. | ||
|
|
||
| **Import Order** | ||
|
|
||
| 1. React Router 7 core modules | ||
| 2. React and other core libraries | ||
| 3. Third-party packages | ||
| 4. Application-specific imports | ||
| 5. Environment-specific imports | ||
| 6. Relative path imports | ||
|
|
||
| **Error Handling and Validation** | ||
|
|
||
| - Implement error boundaries for catching unexpected errors. | ||
| - Use custom error handling within loaders and actions. | ||
| - Validate user input on both client and server using formData or JSON. | ||
|
|
||
| **Testing** | ||
|
|
||
| - Use `@testing-library/react` for component testing. | ||
| - Write tests for loaders and actions ensuring data correctness. | ||
| - Mock fetch requests and responses where applicable. | ||
|
|
||
| **Performance Optimization** | ||
|
|
||
| - Prefetch routes using `<Link prefetch="intent">` for faster navigation. | ||
| - Defer non-essential JavaScript using `<Scripts defer />`. | ||
| - Optimize nested layouts to minimize re-rendering. | ||
| - Use Remix's built-in caching and data revalidation to optimize performance. | ||
|
|
||
| **Security** | ||
|
|
||
| - Prevent XSS by sanitizing user-generated content. | ||
| - Use Remix's CSRF protection for form submissions. | ||
| - Handle sensitive data on the server, never expose in client code. | ||
|
|
||
| **Key Conventions** | ||
|
|
||
| - Use React Router 7's loaders and actions to handle server-side logic. | ||
| - Focus on reusability and modularity across routes and components. | ||
| - Follow Remix’s best practices for file structure and data fetching. | ||
| - Optimize for performance and accessibility. | ||
|
|
||
| **Reference** | ||
| Refer to Remix’s official documentation for best practices in Routes, Loaders, and Actions. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/usr/bin/env sh | ||
| . "$(dirname -- "$0")/_/husky.sh" | ||
| # npm run typecheck | ||
| npx lint-staged | ||
| # npx lint-staged |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Review comments generated by i18n-ally. Please commit this file. | ||
|
|
||
| reviews: |
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
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { Link } from 'react-router' | ||
| import CognactiveIcon from 'src/assets/icons/cognactive-icon' | ||
| import { ArrowUpRightSquare, Github } from 'lucide-react' | ||
| import { GITHUB_REPO_BASE, TELEGRAM_CHAT_LINK } from 'src/constants' | ||
| import { Button } from '../ui/button' | ||
| import { LanguageSelector } from '../language-selector' | ||
| import { useTranslation } from 'react-i18next' | ||
|
|
||
| const Footer: React.FC = () => { | ||
| const { t } = useTranslation() | ||
|
|
||
| return ( | ||
| <footer className="w-full bg-foreground text-xs text-slate-500"> | ||
| <div className="container p-4"> | ||
| <div className="flex items-center justify-between"> | ||
| <div className="flex items-center gap-4"> | ||
| <span className="inline-block w-16"> | ||
| <CognactiveIcon className="fill-slate-500 transition-colors hover:fill-white" darkMode /> | ||
| </span> | ||
| <Button size={'sm'} asChild> | ||
| <Link to={TELEGRAM_CHAT_LINK}> | ||
| {t('footer.chat-nac-link-title')} <ArrowUpRightSquare className="ml-2 inline-block w-4" /> | ||
| </Link> | ||
| </Button> | ||
| <Button size={'sm'} asChild> | ||
| <a href={GITHUB_REPO_BASE} target="_blank" rel="noreferrer"> | ||
| {t('homepage.github-link-title')} | ||
| <Github className="w-4" /> | ||
| </a> | ||
| </Button> | ||
| </div> | ||
| <LanguageSelector triggerClassName="text-white" /> | ||
| </div> | ||
| <p className="my-2"> | ||
| <Link className="underline underline-offset-auto" to={'/privacy'}> | ||
| {t('footer.data-usage-title')} | ||
| </Link> | ||
| </p> | ||
| <p className="bottom-inset"> | ||
| <span className="font-semibold">{t('footer.medical-disclaimer')}:</span> {t('footer.medical-disclaimer-desc')} | ||
| </p> | ||
| </div> | ||
| </footer> | ||
| ) | ||
| } | ||
|
|
||
| export default Footer | ||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix incorrect import path for
react-router.The import path should be
@remix-run/reactinstead ofreact-router.📝 Committable suggestion