Deep merge localized json files, based on their language, with the option to a fallback language.
$ npm install --save-dev grunt-merge-locales
In your Gruntfile
module.exports = function (grunt) {
grunt.initConfig({
mergeLocales: {
// default options
options: {
fallbackLanguage: 'en'
},
i18n: {
sourceDirectory: 'source/directory',
destinationDirectory: 'destination/directory',
locales: [
"de_AT",
"de_CH",
"en_GB",
"en_IE"
]
}
}
}
grunt.loadNpmTasks('grunt-merge-locales');
Type: String
Default: null
Loads a language as fallback language, which will deep merged to every generated file.
Type: Boolean
Default: false
Generates languages files from the source files and if fallbackLanguage
is set,
also merges the fallback language into it.
Type: Boolean
Default: true
Generates localized i18n files based on the given locales
. It merges the locale from
the source directory with the language file of the locale and also the fallbackLanguage
if given.
Type: Number
Default: null
The number of spaces to indent the json file during formatting. If null is given the file will be minified.
MIT