accent_cli_dart 0.1.7
accent_cli_dart: ^0.1.7 copied to clipboard
A Dart implementation of accent-cli for managing translations with Accent
Accent CLI Dart #
A Dart implementation of accent-cli for managing translations with Accent.
Installation #
From Source #
git clone https://github.com/moaazsalama/accent-cli-dart.git
cd accent-cli-dart
dart pub get
dart compile exe bin/main.dart -o accent
Move the compiled accent
executable to a directory in your PATH to use it globally.
From Pub.dev #
dart pub global activate accent_cli_dart
Usage #
Create an accent.json
file in your project root with your Accent API configuration:
{
"apiUrl": "http://your.accent.instance",
"apiKey": "your-api-key",
"files": [
{
"language": "en",
"format": "json",
"source": "localization/en/*.json",
"target": "localization/%slug%/%original_file_name%.json",
"hooks": {
"afterSync": "echo 'Sync completed!'"
}
}
]
}
Commands #
Export
Export files from Accent and write them to your local filesystem:
accent export [--order-by=index|key-asc]
JIPT
Export JIPT (Just-in-place-translation) files from Accent:
accent jipt PSEUDOLANGUAGENAME
Stats
Fetch statistics from Accent and display them:
accent stats
Sync
Sync files with Accent and optionally write them to your local filesystem:
accent sync [options]
Options:
--add-translations
: Add translations in Accent to help translators--merge-type=smart|passive|force
: Merge type for add translations (default: smart)--order-by=index|key-asc
: Order of keys in export (default: index)--sync-type=smart|passive
: Sync type (default: smart)--write
: Write exported files after operation
Configuration #
Document Configuration #
Each operation section can contain the following:
language
: The identifier of the document's languageformat
: The format of the documentsource
: The path of the document (supports glob patterns)target
: Path of the target languageshooks
: List of hooks to be run
Hooks #
Available hooks:
beforeSync
afterSync
beforeExport
afterExport
beforeAddTranslations
afterAddTranslations
License #
MIT