1.0.0-rc.7 • Published 2 years ago
@intl-schematic/cli v1.0.0-rc.7
@intl-schematic/cli (WIP)
npm i -D @intl-schematic/cli
intl-schematic, as well as its plugins, defines a JSON-schema API designed specifically to allow type-checking JSON translation documents.
This CLI allows to quickly create such a schema based on the intl-schematic plugins you have currently installed.
Using the CLI
Broken right now, see manual definition.
To quickly define the translation.schema.json for your translation documents,
you can run the official CLI in your project's root:
npx intl-schematic init
# or provide an optional custom file name
npx intl-schematic init ./locales/my-translation.schema.jsonAnd then use it in your translation document:
// en.json
{
// Path to the schema from the example above
"$schema": "./translation.schema.json",
"key": "Translation of my key"
}import translation from './en.json';
const t = createTranslator(() => translation);
// Etc., see example at the start of this fileNote: the
$schemakey will be automatically excluded\ from type hints fort()for your convenience!
1.0.0-rc.7
2 years ago
1.0.0-rc.6
2 years ago