translate-helper
Collection all text while project
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 grunt-translate-helper --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "translate_helper" task
Overview
In your project's Gruntfile, add a section named translateHelper
to the data object passed into grunt.initConfig()
.
grunt; grunt;
Usage Examples
In Javascript code you must use translator('Hello')
.
Default Options
grunt;
after run grunt task, dic_source.json create in $dictionary_path and you can translate this file. After run grunt task again
dic.js
update with translated text and you can add this file in index.html and use this file in you project.
Use In Javascript
for use translated object file use this function in js library:
var { var translate = dicword; if translate !== undefined return translate; else return word; };
Use In AngularJs
This task can extract text from AngularJs directive.
Hello
and add this directive in your project
// Handle global translate function// <trans>Word Or Phrase </trans>ModuleName; // Handle global translate function// <trans>Word Or Phrase </trans>ModuleName;
Lisense
MIT 2016