
Product
Announcing Bun and vlt Support in Socket
Bringing supply chain security to the next generation of JavaScript package managers
@bullhorn/linguist
Advanced tools
A CLI to help manage localization files developed and used by Bullhorn
npm install -g @bullhorn/linguist
Setup you .linguistrc file
{
locale: 'en-US', // default locale used for translations
sources: ['./src'], // list of directories to search for KEYS.
dest: './l10n', // where localization files are stored
patterns: [ // file patterns to look for keys in
'/**/*.html',
'/**/*.ts'
],
prefix: 'messages.', // file prefix for saving localization files
format: 'json', // localization file format, ie. json, namespaced-json, pot, xliff, xliff2
verbose: false, // display extra information in console
replace: false, // replace existing translations when extraction keys
clean: false, // removed unused keys when extracting new keys
keys: [] // Extra regular expression to be used by the parser
}
linguist check [lang]
Usage: check [options] [lang]
Check for missing translation keys
Options:
-h, --help output usage information
-s, --sources [sources] specify source directories.
-d, --dest <dest> specify output directory.
-v, --verbose list all keys found.
$ linguist check en-US
+ Custom keys found, adding regular expression parser
✔︎ Extracted 109 strings from '/Projects/test/js'
✔︎ Extracted 349 strings from '/Projects/test/partials'
✔︎ Extracted 237 strings from '/Projects/test/node_modules/package'
* Loaded Control file
✔︎ 515 existing keys found
âś— Missing 105 keys
âś— Found 72 unused keys
linguist extract [lang]
Usage: extract [options] [lang]
Updates translation file with missing keys
Options:
-h, --help output usage information
-s, --sources [sources] specify source directories.
-d, --dest <dest> specify lang directory.
-f, --format <format> specify output format. (json, xliff, pot)
-r, --replace Replace the contents of output file if it exists (Merges by default).
-c, --clean Remove obsolete strings when merging.
$ linguist extract en-US
â ´ extracting...
✔︎ Extracted 100 strings from '/Projects/test/src'
✔︎ Saved to ./shared/i18n/de.json
linguist translate [lang]
Usage: translate [options] [lang]
Translate source file to new language
Options:
-h, --help output usage information
-d, --dest <dest> specify localization resources directory.
-f, --format <format> specify output format. (json, xliff)
$ linguist translate de-DE
* Loaded Control file
✔︎ 1026 existing keys found
âś— Missing 352 translations
â § translating...350 of 352
✔︎ Saved to './shared/i18n/de-DE.json'
linguist convert [lang] [to]
Usage: convert [options] [lang] [to]
Convert translations to new format
Options:
-h, --help output usage information
-d, --dest <dest> specify localization resources directory.
-f, --format <format> specify output format. (json, xliff)
$ linguist convert -f xliff de-DE
* Loaded Control file
✔︎ Saved to './shared/i18n/de-DE.xlf'
To run all the unit tests, simply run:
yarn test
FAQs
A universal localization managment tool for web projects
We found that @bullhorn/linguist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.