CLI tool to create locale json files in Ghost themes.
Ensure you have Node.js installed. Then, install GTL globally using npm:
npm install -g ghost-theme-localesor install locally in your project:
npm install -D ghost-theme-localesBefore 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.
gtl <command> [options]gtl [option]| Option | Description |
|---|---|
--version |
Output the version number |
--help |
Output usage information |
gtl c [options]or
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 |
- Fork this repo
git clone https://github.com/priority-vision/ghost-theme-locales.git path/to/your/workspacecd path/to/your/workspacenpm install
To run the CLI using your workspace files
npm linkgtl <command> [options]( you can run anywhere on your system)
- MIT License
- Copyright (c) 2024 Priority Vision.
- Original idea from https://github.com/biswajit-saha/ghost-theme-translator
- Ghost is a trademark of Ghost Foundation Ltd.