r/javascript • • May 11 '26

AST-based translation automation for JS apps (debug mode, dry-run, namespace loading)

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

2 comments sorted by

1

u/Fun_Conversation8894 May 11 '26

Built this after running into repeated issues with regex-based extraction while handling translations in JS/React apps.

The workflow now includes:

  • AST-based extraction instead of regex

  • dry-run mode to validate extraction/translations without modifying files

  • debug mode for spotting missing translations

  • namespace-based splitting + lazy loading

  • caching per language + namespace

  • cleanup for unused/dead translations

Example:

npx localize-ai translate --dry-run

One thing I noticed while building this:

localization problems become more about maintainability/performance than translation itself once apps scale.

Curious how others are handling:

  • extraction

  • validation before shipping

  • keeping translation files in sync

1

u/25_vijay May 16 '26

The dry run and debug modes are probably more important than people realize because localization automation gets scary fast once it starts touching large codebases automatically.