CLI tool to create locale json files in Ghost themes
npm install ghost-theme-localesCLI tool to create locale json files in Ghost themes.
- Installation
- Preparation
- Usage
- Commands
- gtl
- gtl create
- Developer Setup
- Copyright \& License
Ensure you have Node.js installed. Then, install GTL globally using npm:
``bash`
npm install -g ghost-theme-locales
or install locally in your project:
`bash`
npm install -D ghost-theme-locales
Before using this tool prepare your theme files. Use {{t}} in your .hbs files to make the hard coded strings translatable. Know more about {{t}} helper here at Ghost official documentation.
After preparing your theme you can use this tool to generate your language file.
`bash`
gtl
`bash`
gtl [option]
| Option | Description |
| ----------------- | :----------------------------------------------------------- |
| --version | Output the version number |--help
| | Output usage information |
`bash`
gtl c [options]
or
`bash`
gtl create [options]
| Option | Description | Default |
| ----------------- | :----------------------------------------------------------- | :------ |
| -l , --language | Language code | en |-f
| , --forceRewrite | Force rewrite existing locales file even if it has no new strings | false |
1. Fork this repo
2. git clone https://github.com/priority-vision/ghost-theme-locales.git path/to/your/workspacecd path/to/your/workspace
3. npm install
4.
To run the CLI using your workspace files
1. npm linkgtl
2.
- MIT License
- Copyright (c) 2024 Priority Vision.
- Original idea from
- Ghost is a trademark of Ghost Foundation Ltd.