0.1.5 • Published 10 years ago

grunt-simple-i18n v0.1.5

Weekly downloads
1
License
-
Repository
github
Last release
10 years ago

grunt-simple-i18n

A Simple i18n Translator for Html-Files

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-simple-i18n --save-dev

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

grunt.loadNpmTasks('grunt-simple-i18n');

Usage Examples

simple_i18n: {
    main: {
        files: [
            {
                src: '**',
                cwd: 'app/views',
                dest: 'public/views',
                i18n: 'translations'
            }
        ]
    },
},

Templates

<button>[[ change ]]</button>

You can also use namespaces

<button>[[ filter:change ]]</button>

i18n-files

This Task only supports json-files.

Example

{
    "CHANGE" : "Change Image"
}

Naming

First Part of a Filename is the language. The Second is the Namespace, if you use it.

/translation/de.json
/translation/de.filter.json
/translation/en.json
/translation/en.filter.json

History

19.10.2015 - Adding Error Message if Translation was not found

License

Copyright (c) 2015 Björn Hase under the MIT license

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago