Skip to content

Commit 1cce386

Browse files
KlhmtAFCMS
authored andcommitted
remove Trans component and update copilot instruction
1 parent 5f04b52 commit 1cce386

File tree

4 files changed

+47
-32
lines changed

4 files changed

+47
-32
lines changed

.github/copilot-instructions.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ Fluorite is an elegant Progressive Web App (PWA) video player built with React,
1515
**Development Workflow:**
1616

1717
1. Install dependencies: `pnpm install`
18-
2. Run linting: `pnpm run lint` (run ESLint to ensure code quality)
19-
3. Build the project: `pnpm run build` (typecheck and build application, NEVER CANCEL, set timeout to 30+ seconds)
20-
4. Run development server: `pnpm run dev` (starts development server with hot reload)
21-
5. Run preview server: `pnpm run preview` (for serving built application)
18+
2. Run text extract command for translation: `pnpm run extract`
19+
3. Add the translation in all locale sub-directory of `src/locales`
20+
4. Run linting: `pnpm run lint` (run ESLint to ensure code quality)
21+
5. Build the project: `pnpm run build` (typecheck and build application, NEVER CANCEL, set timeout to 30+ seconds)
22+
6. Run development server: `pnpm run dev` (starts development server with hot reload)
23+
7. Run preview server: `pnpm run preview` (for serving built application)
2224

2325
### Running the Application
2426

@@ -90,6 +92,7 @@ After making any changes, ALWAYS test these scenarios:
9092
- `components/`: UI components (ControlBar.tsx)
9193
- `hooks/`: Custom React hooks (useFileHandler.ts, etc.)
9294
- `utils.ts`: Utility functions and constants
95+
- `locales/`: Extracted and translated text in PO format
9396
- `public/`: Static assets (fluorite.svg)
9497
- `dist/`: Build output (generated)
9598

@@ -101,6 +104,7 @@ After making any changes, ALWAYS test these scenarios:
101104
- `tsconfig.app.json`: Application TypeScript settings
102105
- `eslint.config.js`: ESLint configuration
103106
- `prettier.config.js`: Prettier formatting configuration
107+
- `lingui.config.ts`: Lingui configuration
104108

105109
**Important Implementation Details:**
106110

@@ -109,6 +113,7 @@ After making any changes, ALWAYS test these scenarios:
109113
- PWA features include service worker, manifest, and file handling
110114
- Tailwind CSS for styling
111115
- React 19 with TypeScript strict mode
116+
- Use the Lingui macro for translating UI text (not the `<Trans>` component)
112117

113118
## Common Commands Reference
114119

@@ -127,6 +132,9 @@ pnpm run lint # Run ESLint
127132
# Formatting
128133
pnpx prettier --write . # Format all files
129134
pnpx prettier --check . # Check formatting
135+
136+
# Translating
137+
pnpm run extract # Extract text from the app and add them in PO translation files
130138
```
131139

132140
**Troubleshooting:**
@@ -143,6 +151,7 @@ pnpx prettier --check . # Check formatting
143151
**Language:** TypeScript (strict mode)
144152
**Styling:** Tailwind CSS v4 with Vite plugin
145153
**PWA:** vite-plugin-pwa with Workbox
154+
**Internationalization:** Lingui with Vite plugin
146155

147156
**Deploy Target:** Vercel (based on README badges)
148157
**Browser Support:** Modern browsers with PWA support

src/components/VideoPlayer.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
updatePlayStateAtom,
2222
updateVolumeStateAtom,
2323
} from "../store/video";
24-
import { useLingui, Trans } from "@lingui/react/macro";
24+
import { useLingui } from "@lingui/react/macro";
2525

2626
export default function VideoPlayerApp() {
2727
const videoRef = useRef<HTMLVideoElement>(null);
@@ -374,9 +374,7 @@ export default function VideoPlayerApp() {
374374
<div className="flex justify-center">
375375
<HiFilm className="h-12 w-12" />
376376
</div>
377-
<p>
378-
<Trans>Drop video file here</Trans>
379-
</p>
377+
<p>t`Drop video file here`</p>
380378
</div>
381379
</div>
382380
</div>

src/locales/en/messages.po

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ msgstr "Color Space:"
4747
msgid "Container Format"
4848
msgstr "Container Format"
4949

50-
#: src/components/VideoPlayer.tsx:372
50+
#: src/components/VideoPlayer.tsx:355
5151
msgid "Drop a video file anywhere or click here to open one"
5252
msgstr "Drop a video file anywhere or click here to open one"
5353

5454
#: src/components/VideoPlayer.tsx:395
55-
msgid "Drop video file here"
56-
msgstr "Drop video file here"
55+
#~ msgid "Drop video file here"
56+
#~ msgstr "Drop video file here"
5757

5858
#: src/components/VideoInfoOverlay.tsx:27
5959
msgid "Duration"
6060
msgstr "Duration"
6161

62-
#: src/components/ControlBar.tsx:192
62+
#: src/components/ControlBar.tsx:202
6363
msgid "Enter fullscreen"
6464
msgstr "Enter fullscreen"
6565

66-
#: src/components/ControlBar.tsx:191
66+
#: src/components/ControlBar.tsx:201
6767
msgid "Exit fullscreen"
6868
msgstr "Exit fullscreen"
6969

@@ -83,22 +83,26 @@ msgstr "fps"
8383
msgid "Frame Rate:"
8484
msgstr "Frame Rate:"
8585

86-
#: src/components/ControlBar.tsx:142
86+
#: src/components/ControlBar.tsx:152
8787
msgid "Mute"
8888
msgstr "Mute"
8989

90-
#: src/components/ControlBar.tsx:204
90+
#: src/components/ControlBar.tsx:214
9191
msgid "Open File"
9292
msgstr "Open File"
9393

94-
#: src/components/ControlBar.tsx:119
94+
#: src/components/ControlBar.tsx:126
9595
msgid "Pause"
9696
msgstr "Pause"
9797

98-
#: src/components/ControlBar.tsx:119
98+
#: src/components/ControlBar.tsx:126
9999
msgid "Play"
100100
msgstr "Play"
101101

102+
#: src/components/ControlBar.tsx:126
103+
msgid "Replay"
104+
msgstr "Replay"
105+
102106
#: src/components/VideoInfoOverlay.tsx:29
103107
msgid "Resolution"
104108
msgstr "Resolution"
@@ -107,18 +111,18 @@ msgstr "Resolution"
107111
msgid "Sample Rate:"
108112
msgstr "Sample Rate:"
109113

110-
#: src/components/ControlBar.tsx:142
114+
#: src/components/ControlBar.tsx:152
111115
msgid "Unmute"
112116
msgstr "Unmute"
113117

114118
#: src/components/VideoInfoOverlay.tsx:103
115119
msgid "Video Details"
116120
msgstr "Video Details"
117121

118-
#: src/components/ControlBar.tsx:180
122+
#: src/components/ControlBar.tsx:190
119123
msgid "Video Information"
120124
msgstr "Video Information"
121125

122-
#: src/components/ControlBar.tsx:169
126+
#: src/components/ControlBar.tsx:179
123127
msgid "Volume"
124128
msgstr "Volume"

src/locales/fr/messages.po

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ msgstr "Espace colorimétrique :"
4747
msgid "Container Format"
4848
msgstr "Format de conteneur"
4949

50-
#: src/components/VideoPlayer.tsx:372
50+
#: src/components/VideoPlayer.tsx:355
5151
msgid "Drop a video file anywhere or click here to open one"
5252
msgstr "Déposez un fichier vidéo n'importe où, ou cliquez ici pour en ouvrir un"
5353

5454
#: src/components/VideoPlayer.tsx:395
55-
msgid "Drop video file here"
56-
msgstr "Déposez un fichier vidéo ici"
55+
#~ msgid "Drop video file here"
56+
#~ msgstr "Déposez un fichier vidéo ici"
5757

5858
#: src/components/VideoInfoOverlay.tsx:27
5959
msgid "Duration"
6060
msgstr "Durée"
6161

62-
#: src/components/ControlBar.tsx:192
62+
#: src/components/ControlBar.tsx:202
6363
msgid "Enter fullscreen"
6464
msgstr "Mettre en plein écran"
6565

66-
#: src/components/ControlBar.tsx:191
66+
#: src/components/ControlBar.tsx:201
6767
msgid "Exit fullscreen"
6868
msgstr "Sortir du plein écran"
6969

@@ -83,22 +83,26 @@ msgstr "fps"
8383
msgid "Frame Rate:"
8484
msgstr "Fréquence d'images :"
8585

86-
#: src/components/ControlBar.tsx:142
86+
#: src/components/ControlBar.tsx:152
8787
msgid "Mute"
8888
msgstr "Désactiver le son"
8989

90-
#: src/components/ControlBar.tsx:204
90+
#: src/components/ControlBar.tsx:214
9191
msgid "Open File"
9292
msgstr "Ouvrir un fichier"
9393

94-
#: src/components/ControlBar.tsx:119
94+
#: src/components/ControlBar.tsx:126
9595
msgid "Pause"
9696
msgstr "Pause"
9797

98-
#: src/components/ControlBar.tsx:119
98+
#: src/components/ControlBar.tsx:126
9999
msgid "Play"
100100
msgstr "Lire"
101101

102+
#: src/components/ControlBar.tsx:126
103+
msgid "Replay"
104+
msgstr "Relancer"
105+
102106
#: src/components/VideoInfoOverlay.tsx:29
103107
msgid "Resolution"
104108
msgstr "Résolution"
@@ -107,18 +111,18 @@ msgstr "Résolution"
107111
msgid "Sample Rate:"
108112
msgstr "Fréquence d'échantillonnage :"
109113

110-
#: src/components/ControlBar.tsx:142
114+
#: src/components/ControlBar.tsx:152
111115
msgid "Unmute"
112116
msgstr "Activer le son"
113117

114118
#: src/components/VideoInfoOverlay.tsx:103
115119
msgid "Video Details"
116120
msgstr "Détails vidéo"
117121

118-
#: src/components/ControlBar.tsx:180
122+
#: src/components/ControlBar.tsx:190
119123
msgid "Video Information"
120124
msgstr "Informations sur la vidéo"
121125

122-
#: src/components/ControlBar.tsx:169
126+
#: src/components/ControlBar.tsx:179
123127
msgid "Volume"
124128
msgstr "Volume"

0 commit comments

Comments
 (0)