claudetech / grunt-i18n-static Goto Github PK
View Code? Open in Web Editor NEWGrunt task for static-i18n
Home Page: https://www.npmjs.com/package/grunt-i18n-static
License: MIT License
Grunt task for static-i18n
Home Page: https://www.npmjs.com/package/grunt-i18n-static
License: MIT License
I haven't been able to pinpoint the exact problem yet, but I am recieving the following error in my build since last week:
Running "i18n:dist" (i18n) task
Fatal error: object is not a function
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?
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
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.
at version 0.1.9 it throws an error unknown object when I set the selector to '[translate]'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.