Giter VIP home page Giter VIP logo

grunt-i18n-static's People

Contributors

danhper avatar dependabot[bot] avatar dhoko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

grunt-i18n-static's Issues

Could not manage to make JSON work

Hi and thank you this Grunt plugin!

I didn't manage to make it work with the JSON format. It looks like the json files are not read at all.
It worked like a charm as soon as I switched to YML.

My grunt conf:

    i18n: {
      dist: {
        options: {
          baseDir: 'src',
          outputDir: 'translated',
        }
      },
      options: {
        fileFormat: 'json',
        locales: ['en', 'fr'],
        locale: 'en',
        localesPath: 'src/locales'
      }
    }

My project structure and my JSON files were good.

From what I see in the node-static-i18n code, the JSON files are never read. Have a look at the return here: https://github.com/claudetech/node-static-i18n/blob/master/src/index.coffee#L52

Do you think it's a bug, or did I make something wrong?

Bump version of loadash / static-i18n

I.e. this should have the latest versions:

"dependencies": {
"lodash": "^4.17.10",
"static-i18n": "^0.2.2"
}

Otherwise "npm audit" warns about Critical issues with dependencies

"staticI18n.processDir()" doesn't execute properly

Hi,

I've just picked up an old project and updated all the dependencies in my package.json and suddenly your grunt task stop working properly.

Actually, the task works just fine. It creates the new translated files but it stops executing the next tasks.

What I found is that staticI18n.processDir returns a promise (created by promisify-node) but your code doesn't expect a promise. It passes a function as a callback instead. And that's why staticI18n.processDir never executes.

Here's my solution:

staticI18n.processDir options.baseDir, options
    .then done, (err) ->
        grunt.log.error 'Failed to compile: #{err}'
        grunt.fail.warn 'i18n task failed'

That's working for me now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.