Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run command on Gulp? #18

Open
alvarotrigo opened this issue Dec 22, 2017 · 3 comments
Open

Run command on Gulp? #18

alvarotrigo opened this issue Dec 22, 2017 · 3 comments

Comments

@alvarotrigo
Copy link
Contributor

alvarotrigo commented Dec 22, 2017

Is there a way to run the command on gulp without using the gulp plugin?
I had a few issues with the plugin and it seems not to be using the global static-i18n module anyways.

I tried the gulp-shell module but I never managed to run my script, not quite sure why:

static-i18n -l en -i en -i es --fileFormat yml --allowHtml --i18n "{\"keyseparator\": \"::\"}" www
@danhper
Copy link
Member

danhper commented Dec 27, 2017

Hi!
To be honest, the projects where I use this module are still using Grunt, with the plugin I wrote
https://github.com/claudetech/grunt-i18n-static
It should probably work with gulp, and I am aware someone wrote a plugin for it, but I never tried it.
Both the gulp and grunt plugin should change static-i18n to a peer dependency to avoid staying blocked to an older version. I think using the plugin would be a better solution than using gulp-shell, although I am not sure why gulp-shell would not work. I will give it a try if I have a moment, but please let me know if you find a solution.
Thank you.

@alvarotrigo
Copy link
Contributor Author

Both the gulp and grunt plugin should change static-i18n to a peer dependency to avoid staying blocked to an older version

Yeah I think that's the issue.

@alvarotrigo
Copy link
Contributor Author

alvarotrigo commented Dec 29, 2017

In any case, I manage to run the script using gulp-shell by playing a bit with the quotes here and there:

gulp.task('shell', shell.task([
  "static-i18n -l en -i en -i es --fileFormat yml --allowHtml true www"
]));

But... for some reason, it seems to create different results than when executing exactly the same command on the terminal (or running it from a .sh file).

#!/bin/bash
static-i18n -l en -i en -i es --fileFormat yml --allowHtml true www

It seems as if gulp-shell is also using an older version of node-static-i18n totally ignoring the latest changes. Same as gulp-static-i18n-html.

<p>
    texto aqui
    Whatever here
</p>

Instead of the following, created when running the exact same command on the console:

<p data-t-interpolate="">
    texto aqui
    <div>Whatever here</div>
</p>

when using the following original file:

<p data-t data-t-interpolate>
    {{text here}}
    <div>Whatever here</div>
</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants