
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
@gira-de/t9n-cli
Advanced tools
> A tiny Node.js based CLI that provides some tools to improve all things around t9n (translation) and i18n (internationalization).
A tiny Node.js based CLI that provides some tools to improve all things around t9n (translation) and i18n (internationalization).
This cli is designed to support developers as well as translators and make their life easier. It...
Everything here is built around the following workflow. Sure, use it however you like, but this was in our mind when we created it.
t9n typedefs <filename>
whenever it changes to create a typescript declaration file. Use this declaration file with your translation library to use your translation keys safe. (💡 Using Svelte? Use our Svelte Wrapper to make life even easier.)t9n export <folderpath>
to create a xlsx-sheet with all translation keys. Send this to your translation agency.t9n import <filename>
to create json files for every defined language. Like en.json, de.json,... .# using npm
npm install @gira-de/t9n-cli -D
# or using yarn
yarn add @gira-de/t9n-cli -D
You should also be able to use the command line tool via npx:
npx t9n
Now you need to create some files and put everything together. Here is an example (final) folder structure:
.
└── app/
├── src/
│ └── t9n.ts
└── locale/
├── meta.json
├── en.json (<-- updated by t9n cli)
└── types.ts (<-- generated by t9n cli)
{
"pageOne": {
"headline": "This is a fancy headline written by a developer. Don't trust this! 🦹♀️🦹♂️"
}
}
{
"pageOne": {
"headline": "Das ist die Überschrift von einem echten Übersetzer. Echt. 👩🏫👨🏫"
}
}
npx t9n typedefs ./meta.json -o locale-types.ts
import type { TranslationArgs } from '../locale/types';
This command will generate a Typescript declaration file (*.ts) based on the provided json file.
t9n typedefs <filename>
Flags
-o, --output <filename> Filename/-path for the declaration file
This command creates a xlsx translation file based on a meta.json within a given folder. If there are additional languages files (for example de.json, en.json) within this folder, the command will put this into the resulting xlsx too.
This command currently needs some config:
// t9n.config.json
{
"version": "0.0.1",
"worksheetName": "Translation",
"languages": ["meta", "de"]
};
t9n export <folderpath>
Flags
-o, --output <folderpath> Folderpath for the resulting xlsx
Import a translation.xlsx and create .json file out of it (like de.json, en.json,...).
t9n import <excel-input> [--output <folderpath>]
Flags
-o, --output <folderpath> Folderpath for the resulting <language>.json.
This command checks all .json compared to a meta.json reference within a given folder. The result will be printed to stdout.
t9n check <input>
Prints a table like this to stdout:
(index) | __filename | translationKeys | missingTranslationKeys | coverage | missingParams |
---|---|---|---|---|---|
0 | 'de' | 3 | 1 | 0.67 | [] |
1 | 'en' | 3 | 2 | 0.33 | ['missingKey'] |
FAQs
> A tiny Node.js based CLI that provides some tools to improve all things around t9n (translation) and i18n (internationalization).
We found that @gira-de/t9n-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.