grunt-ovh-translation

Grunt task to convert xml translations into json files

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
grunt-ovh-translation
002.1.27 years ago7 years agoMinified + gzip package size for grunt-ovh-translation in KB

Readme

grunt-ovh-translation
githubbanner Maintenance() Chat on gitter NPM
Convert xml translations into JSON key-value
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
Example
```javascript grunt.loadNpmTasks('grunt-ovh-translation'); ```

Configuration

In your project's Gruntfile, add a section named ovhTranslation to the data object passed into grunt.initConfig(). The options (and defaults) are: ```JavaScript grunt.initConfig({ ovhTranslation: {
dev: {
files: [
{
expand: true,
flatten: false,
cwd: 'client',
src: [
'app/**/translations/*.xml',
'components/**/translations/*.xml'
],
dest: '.tmp',
filter: 'isFile',
extendFrom: ['en_GB', 'fr_FR'],
lint: true      // [optionnal] set it to false to disable linter
}
]
}
}, }) ```

Installation

This plugin requires Grunt. If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm

``` npm install grunt-ovh-translation --save-dev ```

Get the sources

```
git clone https://github.com/ovh-ux/grunt-ovh-translation.git
cd grunt-ovh-translation
npm install
bower install
```

For Windows User

If you get ```shell Warning: Your translation file must have a linebreak at the end of the file (file: client/app/module-otrs/details/translations/MessagescsCZ.xml). Use --force to continue. Aborted due to warnings. ``` it might be because your file does not end with LF, but with CRLF. To fix this: ```bash
Change your git config to LF
git config --global core.eol lf git config --global core.autocrlf false
You might have to change all the files in the repo
git rm -rf --cached . git reset --hard HEAD ```
Related links
Contribute: https://github.com/ovh-ux/grunt-ovh-translation/CONTRIBUTING.md Report bugs: https://github.com/ovh-ux/grunt-ovh-translation/issues Get latest version: https://github.com/ovh-ux/grunt-ovh-translation
License
See https://github.com/ovh-ux/grunt-ovh-translation/blob/master/LICENSE