GithubHelp home page GithubHelp logo

gulp-transifex's People

Contributors

danmichaelo avatar kevinmartin avatar lukewaite avatar lukewaite-intouch avatar marcoslhc avatar xaralis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gulp-transifex's Issues

Newer version on the server. No operation done.

Hi,

Not sure if this is the right place to report this but for a couple of days now when trying to push resource to Transifex I am getting the following error message...

[11:29:47] Starting 'transifex:push'...
[11:29:48] Newer version of locale.json on the server. No operation done
[11:29:48] Finished 'transifex:push' after 521 ms

Here is my complete gulp file...

const argv = require('yargs').argv;
const gulp = require('gulp');
const gulpTransifex = require('gulp-transifex');
const osHomedir = require('os-homedir');

function verifyParameters() {
  if (!argv.project) {
    console.error('project parameter must be supplied');
  }
}

function createClient() {
  // credential file must be place in your user home directory (i.e. c:\users\myname\transifexrc.json)
  const config = require(osHomedir() + '/transifexrc.json');

  const env = config.env;
  const options = {
    user: config.transifex[env].user,
    password: config.transifex[env].password,
    project: argv.project,
    local_path: './src/resources/src/'
  };

  return gulpTransifex.createClient(options);
}

gulp.task('transifex:push', function () {
  verifyParameters();
  return gulp.src('./src/resources/src/en/locale.json')
    .pipe(createClient().pushResource());
});

gulp.task('transifex:pull', function () {
  verifyParameters();
  return gulp.src('./src/resources/src/en/locale.json')
    .pipe(createClient().pullResource());
});

I've waited a couple of days before to retry thinking it could be related to timezone or whatever but still getting the error.

Any idea what would cause this?

In Transifex documentation they mention the use of --force flag to avoid checking for modification time ... is there any way to provide the flag when using gulp-transifex?

Reference for --force flag: https://docs.transifex.com/client/push#command-options

Structure of languages and resources

Hello
I found this project when I was looking to integrate Transifex in the build process for our Ionic based app.

Since Ionic uses Angular.js internally, We will be using Angular-translate.
I have a few questions on how to best setup your module:

  • How can we define the correct file format (ie; KEYVALUEJSON)?
  • Our files are structured ´/assets/lang/{lang tag}/{resourcename}.json´. How can we structure the gulp task to process this correctly?

"File saved" but nothing happens?

Hi, I am having a hard time getting this work and would really appreciate some help.

Below is my gulpfile.js

var env = require('dotenv').config({silent: true});
var gulp = require('gulp');
var gutil = require('gulp-util');

var transifex = require('gulp-transifex').createClient({
  host: 'www.transifex.com',
  base_path: '/api/2/project/',
  user: 'myusername',
  password: 'mypassword',
  project: 'myprojectname',
  local_path: 'data/translations/gulp'
});

gulp.task('tx:pull', function() {
  return gulp.src('data/translations/gulp/*')
    .pipe(transifex.pullResource())
})

Running gulp tx:pull results in the following output, but no files are actually generated.

› gulp tx:pull
[10:38:13] Using gulpfile ~/Work/myproject/gulpfile.js
[10:38:13] Starting 'tx:pull'...
[10:38:13] File saved
[10:38:13] Finished 'tx:pull' after 16 ms

Issues on other format support

Hello! I tried implementing gulp-transfix now that JSON were supposed to be supported after the latest update, see #21

I noticed two problems

The plugin still assumes that the .po file extensions is to be used in pushResource and createNewResource functions, after a quick look around I found on line, 222, 243, 387, 392 in index.js. The solution to this would be as marcoslhc suggested in his original post, to add file extension to the config object or just scrap the file validation entirely and make sure your gulp.src() actually only includes the files you want.

The pullResource function puzzles the endpoint url together wrongly! If I use the following code
gulp.src('../lang/**/*.json').pipe(transifex.pullResource());
it creates an endpoint url in this format
/api/2/project/mobile-5/resource/{resource}json/translation/{langIso}/
whereas the correct url would be if you were to omit the json part of the string, that is
/api/2/project/mobile-5/resource/{resource}/translation/{langIso}/.
A solution to this would be on line 512 in index.js to change from
path.basename(file.path).replace(/[^a-z0-9_-]/ig, '')
to
path.basename(file.path).replace(/[^a-z0-9_-]/ig, '').replace(path.extname(file.path), '')
But then that might just be how our project is set up, because I notice that you have consciously added the extensions to the end of the resource name in line for example 243.

I'd probably have time to commit a pull request but would just want to make sure that my thoughts here is correct

Update NPMJS package for gulp-transifex

30f5d17 Fixes this for me:

httpsClient.STATUS_CODES[res.statusCode]);
TypeError: Cannot read property '400' of undefined

I encountered this error today. To be honest, I don't know what the error is about.

License?

What is the license under which this project is distributed?

What are the current bugs/issues?

I'm looking into using this at the moment. You highlight that it is still buggy and needs improvement, do you have a list of these problems? I should hopefully be able to devote some time to it during the process.

Cheers

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.