【问题标题】:angular-gettext library- fails to compile JSON files?angular-gettext 库 - 无法编译 JSON 文件?
【发布时间】:2015-01-16 10:38:00
【问题描述】:

我正在使用 grunt-angular-gettext。

我正在尝试编译 PO 文件夹中的 PO 文件并将 JSON 文件输出到不同的文件夹中。未生成文件夹和 JSON 文件。 下面是编译的 grunt 配置:

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

谁能帮我配置在“lang”文件夹中生成 JSON 文件。 “lang”文件夹与“po”文件夹处于同一级别。 如何指定目标文件夹的相对路径?

谢谢。

【问题讨论】:

    标签: json angularjs gruntjs gettext grunt-angular-gettext


    【解决方案1】:

    试试

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

    将 [po-loc] 更改为 po 所在的位置
    并将 [dest-loc] 更改为您希望使用完整路径定位 JSON 文件的位置,因此没有 ../

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-18
      • 2021-01-25
      • 2013-11-24
      • 2012-09-04
      • 2021-02-25
      • 1970-01-01
      相关资源
      最近更新 更多