lingo.dev icon indicating copy to clipboard operation
lingo.dev copied to clipboard

Add file watching feature for automatic retranslation

Open maxprilutskiy opened this issue 1 year ago • 7 comments

WHAT

Implement a "watch" mode that automatically triggers retranslation when changes are detected in the source file.

WHY

  • Saves time by eliminating manual retranslation after each edit
  • Improves workflow for users working on iterative translations
  • Keeps target language files in sync with source file changes

HOW

  1. Monitor specified source file for changes via lingo.dev run --watch
  2. When changes detected, trigger retranslation process
  3. Implement debounce mechanism to avoid excessive retranslations on rapid changes

Additional Context

No response

maxprilutskiy avatar Oct 14 '24 05:10 maxprilutskiy

I would like to try my hands on the same, @maxprilutskiy .

bluzeey avatar Oct 17 '24 06:10 bluzeey

@bluzeey awesome, go ahead!

maxprilutskiy avatar Oct 21 '24 14:10 maxprilutskiy

Hey Max, I was trying on adding a file in the @replexica/cli for the watch command , such that it changes the source file. However in the package json , there were these libraries from replexica which were causing me error while running npm i .

"@replexica/sdk": "workspace:", "@replexica/spec": "workspace:",

Any ideas what should i do to remove this error ?

bluzeey avatar Oct 26 '24 17:10 bluzeey

hey @bluzeey, we're using pnpm:

git clone https://github.com/lingodotdev/lingo.dev
cd lingo.dev
pnpm i
pnpm turbo build

# in terminal window 1
cd packages/cli
pnpm run dev # to start watching for changes in the cli code

# in terminal window 2
cd package
pnpm lingo.dev --help # this command will use the current cli code + demo config from ./package/i18n.json

feel free to ask questions on discord as well (lingo.dev/go/discord)

maxprilutskiy avatar Nov 10 '24 08:11 maxprilutskiy

can i work on this issue?

Akshat76845 avatar Jan 03 '25 12:01 Akshat76845

@Akshat76845 yep, go ahead!

maxprilutskiy avatar Jan 20 '25 17:01 maxprilutskiy

this one is available again! ✨

maxprilutskiy avatar May 20 '25 16:05 maxprilutskiy

@maxprilutskiy @mathio I would like to work on this issue ? is 20 s debouncing time is okay? let me what you think?

VAIBHAVSING avatar Jun 25 '25 16:06 VAIBHAVSING

PR looks good. Let's go with 5s debounce, as you have in your PR. Testing it locally now.

mathio avatar Jun 26 '25 08:06 mathio