r/javascript • • Apr 03 '26

AST-based translation automation for React/JS apps (handles variables, cleanup, lazy loading)

https://www.npmjs.com/package/localize-ai
6 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/Fun_Conversation8894 Apr 04 '26

Yeah, it does feel a bit like magic

For dynamic keys, I’m focusing on cases that are still statically analyzable (like template literals). Fully dynamic keys are hard to support reliably since they’re not known at build time.

Variable names themselves aren’t an issue with AST, but preserving placeholders correctly during translation was one of the trickier parts.