-
Notifications
You must be signed in to change notification settings - Fork 836
Description
Bug Description
When dev.usePseudotranslator: true is set in i18n.json, the CLI still requires API keys to be configured. This should not happen - the pseudotranslator works entirely locally without any external APIs.
Current Behavior
// i18n.json
{
"provider": "google",
"dev": {
"usePseudotranslator": true
}
}Running lingo.dev run still requires GOOGLE_API_KEY to be set, even though the pseudotranslator doesn't use it.
Root Cause
In packages/cli/src/cli/cmd/run/setup.ts:
const provider = ctx.flags.pseudo ? "pseudo" : ctx.config?.provider;The CLI only checks for the --pseudo CLI flag. It does NOT check ctx.config?.dev?.usePseudotranslator.
The config-based pseudotranslator setting is only evaluated inside TranslationService, which is created after the localizer setup and API key validation.
Expected Behavior
When dev.usePseudotranslator: true is set in config, the CLI should:
- Skip API key validation
- Use the pseudo localizer (same as
--pseudoflag) - Work without any environment variables
Workaround
Use the --pseudo CLI flag instead:
lingo.dev run --pseudoBut this defeats the purpose of having the config option.
Proposed Fix
In setup.ts, also check the config:
const isPseudo = ctx.flags.pseudo || ctx.config?.dev?.usePseudotranslator;
const provider = isPseudo ? "pseudo" : ctx.config?.provider;This ensures both the CLI flag and config option work identically.