Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eliumhq/elium-i18n

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eliumhq/elium-i18n - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

scripts/utils.js

2

package.json
{
"name": "@eliumhq/elium-i18n",
"version": "1.0.5",
"version": "1.0.6",
"engines": {

@@ -5,0 +5,0 @@ "node": ">=9",

@@ -1,2 +0,2 @@

const { exec } = require('child_process')
const { exec } = require('./utils')

@@ -7,3 +7,3 @@ function ensureArray (arr) {

module.exports = (languages, commit = true) => {
module.exports = async (languages, commit = true, source) => {
console.log('Pulling PO files...')

@@ -15,23 +15,29 @@ const langs = languages

: '-a '
exec(`tx pull ${langs}`, (error, stdout, stderr) => {
if (error) {
console.error(error)
console.warn('Be sure to have the transifex-client : pip install transifex-cli')
process.exit(1)
try {
// We have to force the pull otherwise existing languages are skipped
await exec(`tx pull ${langs} -f`)
// Transifex does not download the translation file for the source language
if (source) {
console.log('Download translations for source language')
await exec(`tx pull -l ${source} -f`)
}
console.log('Translations downloaded.')
} catch (err) {
console.error(err)
console.warn('Be sure to have the transifex-client : pip install transifex-cli')
process.exit(1)
}
console.log('Translations downloaded.')
if (commit) {
console.log('Committing...')
exec('git add translations/*/*.po', () => {
exec(`git commit -m"chore(i18n): Update translations"`, (error, stdout, stderr) => {
if (error) {
console.error(error)
process.exit(1)
}
console.log('Done !')
})
})
if (commit) {
console.log('Committing...')
try {
await exec('git add translations/*/*.po')
await exec(`git commit -m"chore(i18n): Update translations"`)
console.log('Done !')
} catch (err) {
console.error(err)
process.exit(1)
}
})
}
}

@@ -1,17 +0,16 @@

const { exec } = require('child_process')
const { exec } = require('./utils')
module.exports = () => {
module.exports = async () => {
console.log('Pushing POT to Transifex...')
exec(`tx push -s`, (error, stdout, stderr) => {
if (error) {
console.warn(`
Be sure you have :
1. pip install transifex-cli
2. ~/.transifexrc
`)
console.error(error)
return
}
try {
await exec(`tx push -s`)
console.log('Template pushed.')
})
} catch (err) {
console.warn(`
Be sure you have :
1. pip install transifex-cli
2. ~/.transifexrc
`)
console.error(err)
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc