https://github.com/brkn/ember-i18n-export-json
https://github.com/brkn/ember-i18n-export-json
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brkn/ember-i18n-export-json
- Owner: brkn
- Created: 2020-05-28T10:23:57.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T07:15:13.000Z (over 2 years ago)
- Last Synced: 2025-04-01T04:04:07.549Z (about 2 months ago)
- Language: JavaScript
- Size: 207 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### How to run
1. To copy all locale.js files with thier original paths run a similiar command like the below.
- Make sure you clone this repository as a seibling to your target repository. If it is not seibling, edit the paths according to your setup.
- `cd` into your TARGET directory then run this command. Then come back to this repo directory.
- I've used `fd` for this. It's an alternative to unix find command. You can install via `brew install fd`.
```sh
fd locale.js -x sh -c "mkdir -p ../ember-i18n-export-json/{//}; cp {} ../ember-i18n-export-json/{}"
```
2. Copy and paste your main locale file where you have all your locale.js imports to `index.js`. Move all imports into the translations object.
3. `npm install`
4. Fix the paths at the scripts at package.json. It needs babel to transpile all `es6 import`.
5. Then run this to have your json
```sh
npm run start > tr.json
```
6. Cleanup the other output at the top of your file.
7. Optionally you can run prettier here.