node package manager

lang-rep

lang-rep

Language report plugin

Getting Started

This plugin requires Grunt ~0.4.5

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 install lang-rep

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

grunt.loadNpmTasks('lang-rep');

The "langRep" task

Will check language files and compare them to a 'master' language outputting the keys that do not have a translations in the non-master files

grunt langRep -<options>

Options

-sep

Separates the output files of the langRep task into separate files, where each file is a different language #### -zip Like the separate option but also then zips the separate files into a zip file

langRep:
  lang:
    files: [
      expand: true
      cwd: 'client/assets/strings'
      dest: 'tmpDir/'
      src: '**/str.coffee'
    ]
    langs: ['en''fr''es''it''pt''ru''te''zh']
    master: 'en'

The "verify" task

grunt verify

used for checking a directory for keys of an object, to see if they are in use

verify:
    verf:
        master: 'client/assets/strings/en/str.coffee'
        include: [
            'client/**/*.coffee'
            'client/**/*.html'
        ]
        exclude: [  
            'client/assets/**'  
            'client/config/**'  
            'client/vendor/** '  
        ]  

The "import" task

imports new translations (csv/coffee) and combines with an existing string file

grunt import -<options>

Options

-q

silences all warning #### -f forced past non-existant string error, for creating files even if an perceived error occurred

import:
  imp:
    master: 'en'
    # files to be imported csv and coffee are supported 
    trans: './Translations/*'
    langs:  ['de''es''fr''it''hi''nl''pt''ru''te''tr''zh']
    # delimiter used for csv-parse default: ',' 
    csvDelim: '\t'
    # existing string files to combine with imported files 
    files: [
      expand: true
      cwd: './strings'
      src: '**/str.coffee'
      dest: './tmpDir/'
    ]