Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-djangularjs-translate

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-djangularjs-translate

Grunt tasks to automatically extract translations from your djangularjs project

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Grunt tasks to automatically extract translations from your djangularjs project

##Status

Stable

Build Status

Getting Started

npm install grunt-djangularjs-translate

NOTE: This extraction tool is made to work with the djangularjs framework.

Example

The configuration below generates 2 translation files:

  • public/i18n/en.js
  • public/i18n/fr.js file
// gruntfile.js 
module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);
    grunt.initConfig({
        // ...
        translate: {
            all: {
                src: [
                    "public/*[!_]*/*.js",
                    "public/*[!_]*/*[!tests]*/*.js",
                    "public/*[!_]*/*[!tests]*/*.html"
                ],
                lang: ['en', 'fr'],
                dest: 'i18n',
                moduleName: 'core'
            }
        },
        // ...
    });
}
// public/i18n/en.js
angular
    .module('core')
    .config(['$translateProvider', function($translateProvider) {
        $translateProvider.translations('en', {
            key1: 'trans1-en',
            // ...
        });
    }]);

// public/i18n/fr.js
angular
    .module('core')
    .config(['$translateProvider', function($translateProvider) {
        $translateProvider.translations('fr', {
            key1: 'trans1-fr',
            // ...
        });
    }]);

Options

src

List files containing the translations.

Type: Array

Default:

[
  "public/*[!_]*/*.js",
  "public/*[!_]*/*[!tests]*/*.js",
  "public/*[!_]*/*[!tests]*/*.html
]
lang

Define used languages.

Type: Array

Default: ['en']

dest

Name of the translations folder.

Type: String

Default: 'i18n'

moduleName

Name of the angular module mainModule.

Type: String

Default: 'core'

Test

You will find the tests files into test directory.

To run test use grunt test

Credits

Inspired from grunt-angular-translate.

License

The MIT License (MIT)

Copyright (c) 2015-2016 Nicolas Panel

Keywords

FAQs

Package last updated on 04 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc