-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Ai gf #315
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
Closed
lueckpeter76-lgtm
wants to merge
21
commits into
siddharthvaddem:fix/pr-181-conflicts
from
lueckpeter76-lgtm:main
Closed
Ai gf #315
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
3d680e8
Merge feat(export): allow re-saving exported video on dialog cancel (…
siddharthvaddem 4a29906
lang support
siddharthvaddem 7aca8b8
move project settings to top
siddharthvaddem cbbe2d7
movable camera pip
siddharthvaddem a8bb0e8
improved vertical split gated behind 9:16
siddharthvaddem 5d561ff
feat: add fullscreen video player
ateendra24 eae3f11
feat: Implement `PlaybackControls` component and add i18n files for c…
ateendra24 e35780b
Merge pull request #244 from ateendra24/fix-issue-226
siddharthvaddem 0a5e57c
feat: add webcam source selector with stable HUD layout
EtienneLescot 317089d
fix: restore flex layout to ensure HUD renders in transparent Electro…
EtienneLescot e72851d
fix: use fixed positioning for HUD and device selectors to avoid h-fu…
EtienneLescot a9222c9
fix: equalize badge heights and reduce window to 160px
EtienneLescot fed5a44
fix: enforce identical badge height with h-[36px] on both selectors
EtienneLescot eade280
fix: address PR review comments
EtienneLescot 9762448
fix: address coderabbit comments (loading state + keyboard access)
EtienneLescot 9817c85
fix: address coderabbit review (concurrent stream, collapsed label, u…
EtienneLescot baec9a7
fix: focusable element when webcam expanded with no devices, add erro…
EtienneLescot 2f36160
version bump
siddharthvaddem 846cf71
fix: prevent double-finalize race condition in restartRecording on Wi…
abres33 3061c14
Merge pull request #249 from EtienneLescot/feat/webcam-selector-optim…
siddharthvaddem b101820
Merge pull request #293 from abres33/fix/restart-recording-windows
siddharthvaddem 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
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,59 @@ | ||
| // Lightweight i18n for the Electron main process. | ||
| // Imports the same JSON translation files used by the renderer. | ||
|
|
||
| import commonEn from "../src/i18n/locales/en/common.json"; | ||
| import dialogsEn from "../src/i18n/locales/en/dialogs.json"; | ||
| import commonEs from "../src/i18n/locales/es/common.json"; | ||
| import dialogsEs from "../src/i18n/locales/es/dialogs.json"; | ||
| import commonZh from "../src/i18n/locales/zh-CN/common.json"; | ||
| import dialogsZh from "../src/i18n/locales/zh-CN/dialogs.json"; | ||
|
|
||
| type Locale = "en" | "zh-CN" | "es"; | ||
| type Namespace = "common" | "dialogs"; | ||
| type MessageMap = Record<string, unknown>; | ||
|
|
||
| const messages: Record<Locale, Record<Namespace, MessageMap>> = { | ||
| en: { common: commonEn, dialogs: dialogsEn }, | ||
| "zh-CN": { common: commonZh, dialogs: dialogsZh }, | ||
| es: { common: commonEs, dialogs: dialogsEs }, | ||
| }; | ||
|
|
||
| let currentLocale: Locale = "en"; | ||
|
|
||
| export function setMainLocale(locale: string) { | ||
| if (locale === "en" || locale === "zh-CN" || locale === "es") { | ||
| currentLocale = locale; | ||
| } | ||
| } | ||
|
|
||
| export function getMainLocale(): Locale { | ||
| return currentLocale; | ||
| } | ||
|
|
||
| function getMessageValue(obj: unknown, dotPath: string): string | undefined { | ||
| const keys = dotPath.split("."); | ||
| let current: unknown = obj; | ||
| for (const key of keys) { | ||
| if (current == null || typeof current !== "object") return undefined; | ||
| current = (current as Record<string, unknown>)[key]; | ||
| } | ||
| return typeof current === "string" ? current : undefined; | ||
| } | ||
|
|
||
| function interpolate(str: string, vars?: Record<string, string | number>): string { | ||
| if (!vars) return str; | ||
| return str.replace(/\{\{(\w+)\}\}/g, (_, key: string) => String(vars[key] ?? `{{${key}}}`)); | ||
| } | ||
|
|
||
| export function mainT( | ||
| namespace: Namespace, | ||
| key: string, | ||
| vars?: Record<string, string | number>, | ||
| ): string { | ||
| const value = | ||
| getMessageValue(messages[currentLocale]?.[namespace], key) ?? | ||
| getMessageValue(messages.en?.[namespace], key); | ||
|
|
||
| if (value == null) return `${namespace}.${key}`; | ||
| return interpolate(value, vars); | ||
| } |
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
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.
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.
The
set-localeIPC handler rebuilds the tray menu withupdateTrayMenu()but does not pass the current recording state, so it falls back torecording = false. If a user changes language while actively recording (the launch HUD allows this), the tray menu is reset to the idle actions and loses theStop Recordingentry until another recording-state update arrives.Useful? React with 👍 / 👎.