Socket
Book a DemoInstallSign in
Socket

i18n-key-extractor

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-key-extractor

CLI tool for extracting i18n keys from source files

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

i18n Key Extractor

A Node.js CLI tool to extract internationalization (i18n) keys from JavaScript and TypeScript source files.
It scans code for translation keys used in t() function calls and <Trans> JSX components, and generates JSON, CSV, and Excel reports to help manage localization efforts.

Features

  • Extracts i18n keys from:
    • t('key', {...}) or i18next.t('key', {...}) function calls
    • <Trans i18nKey="key" {...props}>...</Trans> or <Trans>key text</Trans> JSX elements
  • Supports parsing TypeScript and JSX syntax
  • Processes multiple named glob patterns for file matching
  • Ignores specified glob patterns (e.g., test files)
  • Loads existing keys to avoid duplicates
  • Outputs:
    • JSON files separating successful keys, warnings, and errors per glob pattern
    • A consolidated CSV file for translation management
    • An Excel .xlsx spreadsheet with language columns ready for translators
  • Configurable output directory and base filename

Usage

i18n-extract \
  --globs frontend::\"src/frontend/**/*.{ts,tsx,js,jsx}\" \
  --globs backend::src/backend/**/*.js \
  --ignore '**/__tests__/**' \
  --outputDir ./dist/translations \
  --baseName translation \
  --existingKeysPath ./dist/translations/existingkeys.json \
  --languages es,fr,de,it

Keywords

i18n

FAQs

Package last updated on 09 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.