angular-gettext library- fails to compile JSON files?

314 views Asked by At

I am using grunt-angular-gettext.

I am trying to compile PO files present in PO folder and output the JSON files in different folder. The folder and JSON files are not getting generated. Below is the grunt config for compile:

nggettext_compile: {
            all: {
                options: {
                    format: "json"
                },
                files: [
                    {
                        expand: true,
                        cwd:"../",
                        src: ["po/*.po"],
                        dest: '../lang/',
                        ext: ".json"
                    }
                ]
            },
        },

Can anyone help me with configuration to generate JSON file in "lang" folder. "lang" folder is at the same level as "po" folder. How would i specify relative path for destination folder?

Thanks.

1

There are 1 answers

0
TriPSs On BEST ANSWER

try

nggettext_compile: {
            all: {
                options: {
                    format: "json"
                },
                files: [
                    {
                        expand: true,
                        cwd:"[po-loc]",
                        src: ["*.po"],
                        dest: '[dest-loc]',
                        ext: ".json"
                    }
                ]
            },
        },

Change [po-loc] to where the po's are located
And change [dest-loc] to where you want to have the JSON files located use full paths so no ../