Remove Translations

Remove translations for specified buckets, files, keys, or locales.

Usage

npx lingo.dev@latest purge [options]

Description

The purge command enables you to remove translations from your project based on specific criteria. You can target particular buckets, files, keys, or locales. This is useful for cleaning up obsolete or unwanted translations.

Tip: For best results when retranslating, first run the purge command, then use the run command without --force. This approach leverages the built-in caching mechanism for more efficient retranslation (as opposed to using run --force).

Options

OptionDescriptionExample
--bucket <bucket>Bucket(s) to process. Can be used multiple times.--bucket json --bucket markdown
--file [files...]File(s) to process. Only processes files that match the given glob pattern(s).--file src/**/*.json
--key <key>Key to remove. Removes all translation keys matching the given glob pattern.--key app.title
--locale <locale>Locale(s) to process. Can be used multiple times.--locale fr --locale de
--yes-reallySkips interactive confirmation and deletes without asking.--yes-really
-h, --helpShow help.--help

Examples

Purge a Specific Key

npx lingo.dev@latest purge --key app.title

Purge All Translations in a Bucket

npx lingo.dev@latest purge --bucket json

Purge for Specific Locales

npx lingo.dev@latest purge --locale fr --locale de

Purge with File Pattern

npx lingo.dev@latest purge --file src/**/*.json

Purge Without Confirmation

npx lingo.dev@latest purge --key obsolete.key --yes-really