<commit_before># grunt-generate-translations

> Generates json files for [angular-translate](https://github.com/angular-translate/angular-translate) module.

## Getting Started
This plugin requires Grunt `~0.4.4`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install --save-dev kamilkisiela/grunt-generate-translations
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-generate-translations');
```

## The "generateTranslation" task

### Overview
In your project's Gruntfile, add a section named `generateTranslation` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  generateTranslation: {
    options: {
      {
        path: '...'
      }
    },
    your_domain: {
      src: [...]
    },
  },
})
```

### Options

#### options.path
Type: `String`
Default value: `''`

The path to use when saving files. 

#### domain.src
Include the given files.

### Usage Examples
Configure your task like this:

```js
grunt.initConfig({
  generateTranslation: {
    options: {
      path: 'app/translations/'
    },
    articles: {
      src: ['private/translations/articles/*.yml']
    },
    comments: {
      src: ['private/translations/comments/*.yaml', 'private/translations/basic/comments.yml']
    }
  }
})
```

You have now two groups of files. First group is for articles, second for domains.  
Each group has translations files. If you defined _pl_ at least once there will be file with polish translations created.  
Look at this pattern:  
```
path/to/save/translations/{domain}-{lang}.json

### Source files
This task works only with translations of a single namespace. _I will work on it later_  
__Task target name is name of our namespace!__  

### example
```yaml
title:
    pl: Witaj
    en: Welcome
subtitle:
    pl: Na naszej stronie
    en: On our website
```<commit_msg>Fix code directive in readme<commit_after># grunt-generate-translations

> Generates json files for [angular-translate](https://github.com/angular-translate/angular-translate) module.

## Getting Started
This plugin requires Grunt `~0.4.4`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install --save-dev kamilkisiela/grunt-generate-translations
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-generate-translations');
```

## The "generateTranslation" task

### Overview
In your project's Gruntfile, add a section named `generateTranslation` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  generateTranslation: {
    options: {
      {
        path: '...'
      }
    },
    your_domain: {
      src: [...]
    },
  },
})
```

### Options

#### options.path
Type: `String`
Default value: `''`

The path to use when saving files. 

#### domain.src
Include the given files.

### Usage Examples
Configure your task like this:

```js
grunt.initConfig({
  generateTranslation: {
    options: {
      path: 'app/translations/'
    },
    articles: {
      src: ['private/translations/articles/*.yml']
    },
    comments: {
      src: ['private/translations/comments/*.yaml', 'private/translations/basic/comments.yml']
    }
  }
})
```

You have now two groups of files. First group is for articles, second for domains.  
Each group has translations files. If you defined _pl_ at least once there will be file with polish translations created.  
Look at this pattern:  

```
path/to/save/translations/{domain}-{lang}.json
```

### Source files
This task works only with translations of a single namespace. _I will work on it later_  
__Task target name is name of our namespace!__  

### example
```yaml
title:
    pl: Witaj
    en: Welcome
subtitle:
    pl: Na naszej stronie
    en: On our website
```
{'fraction_non_alphanumeric': 0.1208668453976765, 'fraction_numerical': 0.0013404825737265416, 'mean_word_length': 3.6202270381836947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2157442', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1318, 'n_words': 468}