Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tdegrunt/broccoli-ember-i18n-precompile
Opinionated broccoli ember-i18n precompilation plugin
https://github.com/tdegrunt/broccoli-ember-i18n-precompile
Last synced: 26 days ago
JSON representation
Opinionated broccoli ember-i18n precompilation plugin
- Host: GitHub
- URL: https://github.com/tdegrunt/broccoli-ember-i18n-precompile
- Owner: tdegrunt
- License: mit
- Created: 2014-05-24T22:22:53.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-30T17:02:06.000Z (about 10 years ago)
- Last Synced: 2024-10-07T17:36:20.798Z (about 1 month ago)
- Language: JavaScript
- Size: 199 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# broccoli-ember-i18n-precompile
The broccoli-ember-i18n-precompile plugin precompiles `.json` files with translations.
This is an opinionated plugin, it assumes a top level folder with the language name,
with individual folders and JSON files beneath them. It assumes you will load the translations at initialization time.Your translations folder will look something like this:
```
app
|- translations
| |- en
| | navigation.json
| | |- users
| | | |- index.json
| |- de
| | navigation.json
| | |- users
| | | |- index.json
```You should end up with js files, with an object:
```
{
"navigation": {
...
},
"users": {
"index": {
...
}
}
}
```## Installation
```bash
npm install --save-dev broccoli-ember-i18n-precompile
```## Usage
```js
var emberI18nPrecompile = require('broccoli-ember-i18n-precompile');var outputTree = emberI18nPrecompile(inputTree, options)
```* **`inputTree`**: Trees that act as the source
* **`options`**: A hash of options.
### Example
```js
var appTranslations = emberI18nPrecompile("app/translations", {outputFolder: 'assets/translations'});
```