From 0b70f32bb913c8acb7660587cc32f86973edcdcf Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 8 May 2018 17:49:46 -0400 Subject: [PATCH 1/8] initial work for i18n --- .eslintrc.json | 3 + lib/cmd.js | 86 ++++++------ lib/cmds/blockchain/blockchain.js | 20 +-- lib/cmds/blockchain/geth_commands.js | 12 +- lib/cmds/reset.js | 2 +- lib/cmds/simulator.js | 4 +- lib/cmds/template_generator.js | 14 +- lib/contracts/compiler.js | 2 +- lib/contracts/contracts.js | 26 ++-- lib/contracts/deploy.js | 58 ++++---- lib/contracts/deploy_manager.js | 20 +-- lib/core/config.js | 10 +- lib/core/engine.js | 6 +- lib/core/events.js | 2 +- lib/core/file.js | 2 +- lib/core/plugin.js | 2 +- lib/core/services_monitor.js | 2 +- lib/dashboard/console.js | 18 +-- lib/dashboard/dashboard.js | 2 +- lib/dashboard/monitor.js | 16 +-- lib/index.js | 49 ++++--- lib/modules/ipfs/index.js | 4 +- lib/modules/ipfs/upload.js | 12 +- lib/modules/solidity/index.js | 10 +- lib/modules/swarm/index.js | 4 +- lib/modules/swarm/upload.js | 10 +- lib/modules/vyper/index.js | 6 +- lib/modules/webserver/index.js | 8 +- lib/modules/webserver/server.js | 6 +- lib/pipeline/pipeline.js | 4 +- lib/pipeline/watch.js | 2 +- lib/tests/test.js | 10 +- lib/versions/library_manager.js | 6 +- lib/versions/npm.js | 1 + locales/en.json | 4 + locales/pt.json | 73 ++++++++++ package-lock.json | 191 ++++++++++++++++++++++++++- package.json | 1 + test_apps/test_app/package-lock.json | 5 + test_apps/test_app/package.json | 1 + 40 files changed, 498 insertions(+), 216 deletions(-) create mode 100644 locales/en.json create mode 100644 locales/pt.json diff --git a/.eslintrc.json b/.eslintrc.json index ce639c6c6..4723ecbff 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,6 +9,9 @@ "sourceType": "module", "ecmaVersion": 2017 }, + "globals": { + "__": true + }, "rules": { "accessor-pairs": "error", "array-bracket-newline": "error", diff --git a/lib/cmd.js b/lib/cmd.js index 669086fe2..1fe90f2a8 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -2,8 +2,18 @@ const program = require('commander'); const promptly = require('promptly'); const utils = require('./utils/utils.js'); const Embark = require('../lib/index'); +const i18n = require('i18n'); let embark = new Embark; +i18n.configure({ + locales: ['en', 'pt'], + register: global, + //updateFiles: false, + directory: utils.joinPath(__dirname, '/../locales') +}); + +i18n.setLocale('pt'); + class Cmd { constructor() { program.version(embark.version); @@ -37,22 +47,22 @@ class Cmd { try { if (value.match(/^[a-zA-Z\s-]+$/)) return value; } catch (e) { - throw new Error('Name must be only letters, spaces, or dashes'); + throw new Error(__('Name must be only letters, spaces, or dashes')); } }; program .command('new [name]') - .description('new application') - .option('--simple', 'create a barebones project meant only for contract development') + .description(__('New Application')) + .option('--simple', __('create a barebones project meant only for contract development')) .action(function (name, options) { if (name === undefined) { - return promptly.prompt("Name your app (default is embarkDApp):", { + return promptly.prompt(__("Name your app (default is %s):", 'embarkDapp'), { default: "embarkDApp", validator: validateName }, function (err, inputvalue) { if (err) { - console.error('Invalid name:', err.message); + console.error(__('Invalid name') + ':', err.message); // Manually call retry // The passed error has a retry method to easily prompt again. err.retry(); @@ -78,7 +88,7 @@ class Cmd { demo() { program .command('demo') - .description('create a working dapp with a SimpleStorage contract') + .description(__('create a working dapp with a SimpleStorage contract')) .action(function () { embark.generateTemplate('demo', './', 'embark_demo'); }); @@ -87,9 +97,9 @@ class Cmd { build() { program .command('build [environment]') - .option('--logfile [logfile]', 'filename to output logs (default: none)') - .option('--loglevel [loglevel]', 'level of logging to display ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') - .description('deploy and build dapp at dist/ (default: development)') + .option('--logfile [logfile]', __('filename to output logs (default: none)')) + .option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') + .description(__('deploy and build dapp at ') + 'dist/ (default: development)') .action(function (env, _options) { _options.env = env || 'development'; _options.logFile = _options.logfile; // fix casing @@ -101,14 +111,14 @@ class Cmd { run() { program .command('run [environment]') - .option('-p, --port [port]', 'port to run the dev webserver (default: 8000)') - .option('-b, --host [host]', 'host to run the dev webserver (default: localhost)') - .option('--noserver', 'disable the development webserver') - .option('--nodashboard', 'simple mode, disables the dashboard') - .option('--no-color', 'no colors in case it\'s needed for compatbility purposes') - .option('--logfile [logfile]', 'filename to output logs (default: none)') - .option('--loglevel [loglevel]', 'level of logging to display ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') - .description('run dapp (default: development)') + .option('-p, --port [port]', __('port to run the dev webserver (default: %s)', '8000')) + .option('-b, --host [host]', __('host to run the dev webserver (default: %s)', 'localhost')) + .option('--noserver', __('disable the development webserver')) + .option('--nodashboard', __('simple mode, disables the dashboard')) + .option('--no-color', __('no colors in case it\'s needed for compatbility purposes')) + .option('--logfile [logfile]', __('filename to output logs (default: %s)', 'none')) + .option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') + .description(__('run dapp (default: %s)', 'development')) .action(function (env, options) { embark.run({ env: env || 'development', @@ -125,8 +135,8 @@ class Cmd { blockchain() { program .command('blockchain [environment]') - .option('-c, --client [client]', 'Use a specific ethereum client or simulator (supported: geth, testrpc)') - .description('run blockchain server (default: development)') + .option('-c, --client [client]', __('Use a specific ethereum client or simulator (supported: %s)', 'geth, testrpc')) + .description(__('run blockchain server (default: %s)', 'development')) .action(function (env, options) { embark.initConfig(env || 'development', { embarkConfig: 'embark.json', @@ -139,13 +149,13 @@ class Cmd { simulator() { program .command('simulator [environment]') - .description('run a fast ethereum rpc simulator') - .option('--testrpc', 'use testrpc as the rpc simulator [default]') - .option('-p, --port [port]', 'port to run the rpc simulator (default: 8545)') - .option('-h, --host [host]', 'host to run the rpc simulator (default: localhost)') - .option('-a, --accounts [numAccounts]', 'number of accounts (default: 10)') - .option('-e, --defaultBalanceEther [balance]', 'Amount of ether to assign each test account (default: 100)') - .option('-l, --gasLimit [gasLimit]', 'custom gas limit (default: 8000000)') + .description(__('run a fast ethereum rpc simulator')) + .option('--testrpc', __('use testrpc as the rpc simulator [%s]', 'default')) + .option('-p, --port [port]', __('port to run the rpc simulator (default: %s)', '8545')) + .option('-h, --host [host]', __('host to run the rpc simulator (default: %s)', 'localhost')) + .option('-a, --accounts [numAccounts]', __('number of accounts (default: %s)', '10')) + .option('-e, --defaultBalanceEther [balance]', __('Amount of ether to assign each test account (default: %s)', '100')) + .option('-l, --gasLimit [gasLimit]', __('custom gas limit (default: %s)', '8000000')) .action(function (env, options) { embark.initConfig(env || 'development', { @@ -165,7 +175,7 @@ class Cmd { test() { program .command('test [file]') - .description('run tests') + .description(__('run tests')) .action(function (file) { embark.initConfig('development', { embarkConfig: 'embark.json', interceptLogs: false @@ -177,9 +187,9 @@ class Cmd { upload() { program .command('upload [environment]') - .option('--logfile [logfile]', 'filename to output logs (default: none)') - .option('--loglevel [loglevel]', 'level of logging to display ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') - .description('Upload your dapp to a decentralized storage (e.g embark upload ipfs).') + .option('--logfile [logfile]', __('filename to output logs (default: %s)', 'none')) + .option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') + .description(__('Upload your dapp to a decentralized storage') + ' (e.g embark upload ipfs).') .action(function (platform, env, _options) { _options.env = env || 'development'; _options.logFile = _options.logfile; // fix casing @@ -191,10 +201,10 @@ class Cmd { graph() { program .command('graph [environment]') - .option('--skip-undeployed', 'Graph will not include undeployed contracts') - .option('--skip-functions', 'Graph will not include functions') - .option('--skip-events', 'Graph will not include events') - .description('generates documentation based on the smart contracts configured') + .option('--skip-undeployed', __('Graph will not include undeployed contracts')) + .option('--skip-functions', __('Graph will not include functions')) + .option('--skip-events', __('Graph will not include events')) + .description(__('generates documentation based on the smart contracts configured')) .action(function (env, options) { embark.graph({ env: env || 'development', @@ -209,7 +219,7 @@ class Cmd { reset() { program .command('reset') - .description('resets embarks state on this dapp including clearing cache') + .description(__('resets embarks state on this dapp including clearing cache')) .action(function () { embark.initConfig('development', { embarkConfig: 'embark.json', interceptLogs: false @@ -221,7 +231,7 @@ class Cmd { versionCmd() { program .command('version') - .description('output the version number') + .description(__('output the version number')) .action(function () { console.log(embark.version); process.exit(0); @@ -231,11 +241,11 @@ class Cmd { otherCommands() { program .action(function (cmd) { - console.log('unknown command "%s"'.red, cmd); + console.log((__('unknown command') + ' "%s"').red, cmd); let dictionary = ['new', 'demo', 'build', 'run', 'blockchain', 'simulator', 'test', 'upload', 'version']; let suggestion = utils.proposeAlternative(cmd, dictionary); if (suggestion) { - console.log('did you mean "%s"?'.green, suggestion); + console.log((__('did you mean') + ' "%s"?').green, suggestion); } console.log("type embark --help to see the available commands"); process.exit(0); diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index d0fa21372..1e01893ef 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -11,7 +11,7 @@ var Blockchain = function(options) { this.client = options.client; if ((this.blockchainConfig === {} || JSON.stringify(this.blockchainConfig) === '{"enabled":true}') && this.env !== 'development') { - console.log("===> warning: running default config on a non-development environment"); + console.log("===> " + __("warning: running default config on a non-development environment")); } this.config = { @@ -62,12 +62,12 @@ var Blockchain = function(options) { }; Blockchain.prototype.runCommand = function(cmd, options) { - console.log(("running: " + cmd.underline).green); + console.log(__("running: %s", cmd.underline).green); return shelljs.exec(cmd, options, (err, stdout, _stderr) => { if (err && this.env === 'development' && stdout.indexOf('Failed to unlock developer account') > 0) { - console.warn('\nDevelopment blockchain has changed to use the --dev option.'.yellow); - console.warn('You can reset your workspace to fix the problem with'.yellow + ' embark reset'.cyan); - console.warn('Otherwise, you can change your data directory in blockchain.json (datadir)'.yellow); + console.warn('\n' + __('Development blockchain has changed to use the --dev option.').yellow); + console.warn(__('You can reset your workspace to fix the problem with').yellow + ' embark reset'.cyan); + console.warn(__('Otherwise, you can change your data directory in blockchain.json (datadir)').yellow); } }); }; @@ -76,11 +76,11 @@ Blockchain.prototype.run = function() { var self = this; console.log("===============================================================================".magenta); console.log("===============================================================================".magenta); - console.log(("Embark Blockchain Using: " + this.client.name.underline).magenta); + console.log(__("Embark Blockchain Using: %s", this.client.name.underline).magenta); console.log("===============================================================================".magenta); console.log("===============================================================================".magenta); if (!this.isClientInstalled()) { - console.log(("could not find " + this.config.geth_bin + " command; is " + this.client.name + " installed or in the PATH?").green); + console.log(__("could not find {{geth_bin}} command; is {{client_name}} installed or in the PATH?", {geth_bin: this.config.geth_bin, client_name: this.client.name}).green); return; } let address = ''; @@ -115,16 +115,16 @@ Blockchain.prototype.initChainAndGetAddress = function() { // check if an account already exists, create one if not, return address result = this.runCommand(this.client.listAccountsCommand()); if (result.output === undefined || result.output.match(/{(\w+)}/) === null || result.output.indexOf("Fatal") >= 0) { - console.log("no accounts found".green); + console.log(__("no accounts found").green); if (this.config.genesisBlock) { - console.log("initializing genesis block".green); + console.log(__("initializing genesis block").green); result = this.runCommand(this.client.initGenesisCommmand()); } result = this.runCommand(this.client.newAccountCommand()); address = result.output.match(/{(\w+)}/)[1]; } else { - console.log("already initialized".green); + console.log(__("already initialized").green); address = result.output.match(/{(\w+)}/)[1]; } diff --git a/lib/cmds/blockchain/geth_commands.js b/lib/cmds/blockchain/geth_commands.js index 84d28dcf0..379bf54e1 100644 --- a/lib/cmds/blockchain/geth_commands.js +++ b/lib/cmds/blockchain/geth_commands.js @@ -80,14 +80,14 @@ class GethCommands { if (config.rpcCorsDomain) { if (config.rpcCorsDomain === '*') { console.log('=================================='); - console.log('rpcCorsDomain set to *'); - console.log('make sure you know what you are doing'); + console.log(__('rpcCorsDomain set to *')); + console.log(__('make sure you know what you are doing')); console.log('=================================='); } cmd += "--rpccorsdomain=\"" + config.rpcCorsDomain + "\" "; } else { console.log('=================================='); - console.log('warning: cors is not set'); + console.log(__('warning: cors is not set')); console.log('=================================='); } @@ -104,14 +104,14 @@ class GethCommands { if (config.wsOrigins) { if (config.wsOrigins === '*') { console.log('=================================='); - console.log('wsOrigins set to *'); - console.log('make sure you know what you are doing'); + console.log(__('wsOrigins set to *')); + console.log(__('make sure you know what you are doing')); console.log('=================================='); } cmd += "--wsorigins \"" + config.wsOrigins + "\" "; } else { console.log('=================================='); - console.log('warning: wsOrigins is not set'); + console.log(__('warning: wsOrigins is not set')); console.log('=================================='); } } diff --git a/lib/cmds/reset.js b/lib/cmds/reset.js index c2b14756d..557e7b67f 100644 --- a/lib/cmds/reset.js +++ b/lib/cmds/reset.js @@ -4,5 +4,5 @@ module.exports = function() { fs.removeSync('./chains.json'); fs.removeSync('.embark/'); fs.removeSync('dist/'); - console.log("reset done!".green); + console.log(__("reset done!").green); }; diff --git a/lib/cmds/simulator.js b/lib/cmds/simulator.js index 6366290d9..8f2f22f71 100644 --- a/lib/cmds/simulator.js +++ b/lib/cmds/simulator.js @@ -12,8 +12,8 @@ class Simulator { const testrpc = shelljs.which('testrpc'); const ganache = shelljs.which('ganache-cli'); if (!testrpc && !ganache) { - this.logger.warn('Ganache CLI (TestRPC) is not installed on your machine'); - this.logger.info('You can install it by running: npm -g install ganache-cli'); + this.logger.warn(__('%s is not installed on your machine', 'Ganache CLI (TestRPC)')); + this.logger.info(__('You can install it by running: %s', 'npm -g install ganache-cli')); process.exit(); } diff --git a/lib/cmds/template_generator.js b/lib/cmds/template_generator.js index 3bb8c4a34..801becf00 100644 --- a/lib/cmds/template_generator.js +++ b/lib/cmds/template_generator.js @@ -8,7 +8,7 @@ class TemplateGenerator { generate(destinationFolder, name) { let templatePath = fs.embarkPath(utils.joinPath('templates', this.templateName)); - console.log('Initializing Embark Template....'.green); + console.log(__('Initializing Embark Template....').green); let fspath = utils.joinPath(destinationFolder, name); fs.copySync(templatePath, fspath); @@ -16,21 +16,21 @@ class TemplateGenerator { utils.sed('package.json', '%APP_NAME%', name); if (name === 'embark_demo') { - console.log('Installing packages...'.green); + console.log(__('Installing packages...').green); utils.runCmd('npm install'); } - console.log('Init complete'.green); - console.log('\nApp ready at '.green + fspath); + console.log(__('Init complete').green); + console.log('\n' + __('App ready at ').green + fspath); if (name === 'embark_demo') { console.log('-------------------'.yellow); - console.log('Next steps:'.green); + console.log(__('Next steps:').green); console.log(('-> ' + ('cd ' + fspath).bold.cyan).green); console.log('-> '.green + 'embark blockchain'.bold.cyan + ' or '.green + 'embark simulator'.bold.cyan); - console.log('open another console in the same directory and run'.green); + console.log(__('open another console in the same directory and run').green); console.log('-> '.green + 'embark run'.bold.cyan); - console.log('For more info go to http://embark.status.im'.green); + console.log(__('For more info go to http://embark.status.im').green); } } } diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index 8699b842c..af2cc5eb9 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -40,7 +40,7 @@ class Compiler { function (err) { contractFiles.forEach(file => { if (!file.compiled) { - self.logger.warn(`${file.filename} doesn't have a compatible contract compiler. Maybe a plugin exists for it.`); + self.logger.warn(__("%s doesn't have a compatible contract compiler. Maybe a plugin exists for it.", file.filename)); } }); diff --git a/lib/contracts/contracts.js b/lib/contracts/contracts.js index 10f567085..5b8a9329f 100644 --- a/lib/contracts/contracts.js +++ b/lib/contracts/contracts.js @@ -86,7 +86,7 @@ class ContractsManager { } if (contract.code === "") { - self.logger.info("assuming " + className + " to be an interface"); + self.logger.info(__("assuming %s to be an interface", className)); contract.deploy = false; } } @@ -108,15 +108,15 @@ class ContractsManager { parentContract = self.contracts[parentContractName]; if (parentContract === className) { - self.logger.error(className + ": instanceOf is set to itself"); + self.logger.error(__("%s : instanceOf is set to itself", className)); continue; } if (parentContract === undefined) { - self.logger.error(className + ": couldn't find instanceOf contract " + parentContractName); + self.logger.error(__("{{className}}: couldn't find instanceOf contract {{parentContractName}}", {className: className, parentContractName: parentContractName})); let suggestion = utils.proposeAlternative(parentContractName, dictionary, [className, parentContractName]); if (suggestion) { - self.logger.warn('did you mean "' + suggestion + '"?'); + self.logger.warn(__('did you mean "%s"?', suggestion)); } continue; } @@ -126,7 +126,7 @@ class ContractsManager { } if (contract.code !== undefined) { - self.logger.error(className + " has code associated to it but it's configured as an instanceOf " + parentContractName); + self.logger.error(__("{{className}} has code associated to it but it's configured as an instanceOf {{parentContractName}}", {className: className, parentContractName: parentContractName})); } contract.code = parentContract.code; @@ -149,10 +149,10 @@ class ContractsManager { contract = self.contracts[className]; if (contract.code === undefined) { - self.logger.error(className + " has no code associated"); + self.logger.error(__("%s has no code associated", className)); let suggestion = utils.proposeAlternative(className, dictionary, [className]); if (suggestion) { - self.logger.warn('did you mean "' + suggestion + '"?'); + self.logger.warn(__('did you mean "%s"?', suggestion)); } delete self.contracts[className]; } @@ -216,7 +216,7 @@ class ContractsManager { } ], function (err, _result) { if (err) { - self.logger.error("Error Compiling/Building contracts: " + err); + self.logger.error(__("Error Compiling/Building contracts: ") + err); } self.logger.trace("finished".underline); done(err, self); @@ -242,9 +242,9 @@ class ContractsManager { try { orderedDependencies = toposort(converted_dependencies.filter((x) => x[0] != x[1])).reverse(); } catch(e) { - this.logger.error(("Error: " + e.message).red); - this.logger.error("there are two or more contracts that depend on each other in a cyclic manner".bold.red); - this.logger.error("Embark couldn't determine which one to deploy first".red); + this.logger.error((__("Error: ") + e.message).red); + this.logger.error(__("there are two or more contracts that depend on each other in a cyclic manner").bold.red); + this.logger.error(__("Embark couldn't determine which one to deploy first").red); throw new Error("CyclicDependencyError"); //process.exit(0); } @@ -279,7 +279,7 @@ class ContractsManager { if (contract.deploy === false) { contractData = [ className.green, - 'Interface or set to not deploy'.green, + __('Interface or set to not deploy').green, "\t\tn/a".green ]; } else if (contract.error) { @@ -292,7 +292,7 @@ class ContractsManager { contractData = [ className.green, (contract.deployedAddress || '...').green, - ((contract.deployedAddress !== undefined) ? "\t\tDeployed".green : "\t\tPending".magenta) + ((contract.deployedAddress !== undefined) ? ("\t\t" + __("Deployed")).green : ("\t\t" + __("Pending")).magenta) ]; } diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index 62e54f6b0..afdd72b7a 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -40,7 +40,7 @@ class Deploy { for (let input of abi.inputs) { let inputValue = suppliedArgs[input.name]; if (!inputValue) { - this.logger.error(input.name + " has not been defined for " + contract.className + " constructor"); + this.logger.error(__("{{inputName}} has not been defined for {{className}} constructor", {inputName: input.name, className: contract.className})); } args.push(inputValue || ""); } @@ -88,14 +88,14 @@ class Deploy { try { this.web3.utils.toChecksumAddress(contract.address); } catch(e) { - self.logger.error("error deploying " + contract.className); + self.logger.error(__("error deploying %s", contract.className)); self.logger.error(e.message); contract.error = e.message; self.events.emit('contractsState', self.contractsManager.contractsState()); return callback(e.message); } contract.deployedAddress = contract.address; - self.logger.info(contract.className.bold.cyan + " already deployed at ".green + contract.address.bold.cyan); + self.logger.info(contract.className.bold.cyan + __(" already deployed at ").green + contract.address.bold.cyan); if (this.deployTracker) { self.deployTracker.trackContract(contract.className, contract.realRuntimeBytecode, realArgs, contract.address); self.deployTracker.save(); @@ -124,7 +124,7 @@ class Deploy { contractAlreadyDeployed(contract, trackedContract, callback) { const self = this; - self.logger.info(contract.className.bold.cyan + " already deployed at ".green + trackedContract.address.bold.cyan); + self.logger.info(contract.className.bold.cyan + __(" already deployed at ").green + trackedContract.address.bold.cyan); contract.deployedAddress = trackedContract.address; self.events.emit('contractsState', self.contractsManager.contractsState()); @@ -154,7 +154,7 @@ class Deploy { RunCode.doEval(contractCode, self.web3); if (contract.onDeploy !== undefined) { - self.logger.info('executing onDeploy commands'); + self.logger.info(__('executing onDeploy commands')); let contractCode = codeGenerator.generateContractCode(contract, self.gasLimit); RunCode.doEval(contractCode, self.web3); @@ -166,23 +166,23 @@ class Deploy { let referedContractName = match.slice(1); let referedContract = self.contractsManager.getContract(referedContractName); if (!referedContract) { - self.logger.error('error executing onDeploy for ' + contract.className); - self.logger.error(referedContractName + ' does not exist'); - self.logger.error("error running onDeploy: " + cmd); + self.logger.error(__('error executing onDeploy for ') + contract.className.cyan); + self.logger.error(referedContractName + __(' does not exist')); + self.logger.error(__("error running onDeploy: ") + cmd); withErrors = true; return; } if (referedContract && referedContract.deploy === false) { - self.logger.error('error executing onDeploy for ' + contract.className); - self.logger.error(referedContractName + " exists but has been set to not deploy"); - self.logger.error("error running onDeploy: " + cmd); + self.logger.error(__('error executing onDeploy for ') + contract.className.cyan); + self.logger.error(referedContractName + __(" exists but has been set to not deploy")); + self.logger.error(__("error running onDeploy: ") + cmd); withErrors = true; return; } if (referedContract && !referedContract.deployedAddress) { - self.logger.error('error executing onDeploy for ' + contract.className); - self.logger.error("couldn't find a valid address for " + referedContractName + ". has it been deployed?"); - self.logger.error("error running onDeploy: " + cmd); + self.logger.error(__('error executing onDeploy for ') + contract.className.cyan); + self.logger.error(__("couldn't find a valid address for %s has it been deployed?", referedContractName)); + self.logger.error(__("error running onDeploy: ") + cmd); withErrors = true; return; } @@ -198,12 +198,12 @@ class Deploy { // TODO: convert to for to avoid repeated callback for(let cmd of onDeployCode) { - self.logger.info("executing: " + cmd); + self.logger.info(__("executing: ") + cmd); try { RunCode.doEval(cmd, self.web3); } catch(e) { if (e.message.indexOf("invalid opcode") >= 0) { - self.logger.error('the transaction was rejected; this usually happens due to a throw or a require, it can also happen due to an invalid operation'); + self.logger.error(__('the transaction was rejected; this usually happens due to a throw or a require, it can also happen due to an invalid operation')); } return callback(new Error(e)); } @@ -234,11 +234,11 @@ class Deploy { if (typeof contract.fromIndex == 'number') { deploymentAccount = accounts[contract.fromIndex]; if (deploymentAccount === undefined) { - return next("error deploying " + contract.className + ": no account found at index " + contract.fromIndex + " check the config"); + return next(__("error deploying") + " " + contract.className + ": " + __("no account found at index") + " " + contract.fromIndex + __(" check the config")); } } if (typeof contract.from == 'string' && typeof contract.fromIndex != 'undefined') { - self.logger.warn('Both "from" and "fromIndex" are defined for contract "'+contract.className+'". Using "from" as deployer account.'); + self.logger.warn(__('Both "from" and "fromIndex" are defined for contract') + ' "' + contract.className + '". ' + __('Using "from" as deployer account.')); } if (typeof contract.from == 'string') { deploymentAccount = contract.from; @@ -262,12 +262,12 @@ class Deploy { continue; } if (linkReference.length > 40) { - return next(new Error(linkReference + " is too long, try reducing the path of the contract (" + filename + ") and/or its name " + contractObj.className)); + return next(new Error(__("{{linkReference}} is too long, try reducing the path of the contract ({{filename}}) and/or its name {{contractName}}", {linkReference: linkReference, filename: filename, contractName: contractObj.className}))); } let toReplace = linkReference + "_".repeat(40 - linkReference.length); if (deployedAddress === undefined) { let libraryName = contractObj.className; - return next(new Error(contract.className + " needs " + libraryName + " but an address was not found, did you deploy it or configured an address?")); + return next(new Error(__("{{contractName}} needs {{libraryName}} but an address was not found, did you deploy it or configured an address?", {contractName: contract.className, libraryName: libraryName}))); } contractCode = contractCode.replace(new RegExp(toReplace, "g"), deployedAddress); } @@ -280,7 +280,7 @@ class Deploy { //self.logger.info("applying beforeDeploy plugins...", beforeDeployPlugins.length); async.eachSeries(beforeDeployPlugins, (plugin, eachPluginCb) => { - self.logger.info("running beforeDeploy plugin " + plugin.name + " ."); + self.logger.info(__("running beforeDeploy plugin %s .", plugin.name)); // calling each beforeDeploy handler declared by the plugin async.eachSeries(plugin.beforeDeploy, (beforeDeployFn, eachCb) => { @@ -313,7 +313,7 @@ class Deploy { deployObject = contractObject.deploy({arguments: contractParams, data: dataCode}); } catch(e) { if (e.message.indexOf('Invalid number of parameters for "undefined"') >= 0) { - return next(new Error("attempted to deploy " + contract.className + " without specifying parameters")); + return next(new Error(__("attempted to deploy %s without specifying parameters", contract.className))); } else { return next(new Error(e)); } @@ -330,7 +330,7 @@ class Deploy { next(); }, function deployTheContract(next) { - self.logger.info("deploying " + contract.className.bold.cyan + " with ".green + contract.gas + " gas".green); + self.logger.info(__("deploying") + " " + contract.className.bold.cyan + " " + __("with").green + " " + contract.gas + " " + __("gas").green); deployObject.send({ from: deploymentAccount, @@ -338,7 +338,7 @@ class Deploy { gasPrice: contract.gasPrice }).on('receipt', function(receipt) { if (receipt.contractAddress !== undefined) { - self.logger.info(contract.className.bold.cyan + " deployed at ".green + receipt.contractAddress.bold.cyan); + self.logger.info(contract.className.bold.cyan + " " + __("deployed at").green + " " + receipt.contractAddress.bold.cyan); contract.deployedAddress = receipt.contractAddress; contract.transactionHash = receipt.transactionHash; self.events.emit('contractsState', self.contractsManager.contractsState()); @@ -347,7 +347,7 @@ class Deploy { self.events.emit('contractsState', self.contractsManager.contractsState()); }).on('error', function(error) { self.events.emit('contractsState', self.contractsManager.contractsState()); - return next(new Error("error deploying =" + contract.className + "= due to error: " + error.message)); + return next(new Error(__("error deploying") + " =" + contract.className + "= " + __("due to error") + ": " + error.message)); }); } ], callback); @@ -355,7 +355,7 @@ class Deploy { deployAll(done) { let self = this; - this.logger.info("deploying contracts"); + this.logger.info(__("deploying contracts")); let contracts = this.contractsManager.listContracts(); async.eachOfSeries(contracts, @@ -365,15 +365,15 @@ class Deploy { }, function (err, _results) { if (err) { - self.logger.error("error deploying contracts"); + self.logger.error(__("error deploying contracts")); self.logger.error(err.message); self.logger.debug(err.stack); } if (contracts.length === 0) { - self.logger.info("no contracts found"); + self.logger.info(__("no contracts found")); return done(); } - self.logger.info("finished deploying contracts"); + self.logger.info(__("finished deploying contracts")); self.logger.trace(arguments); done(err); } diff --git a/lib/contracts/deploy_manager.js b/lib/contracts/deploy_manager.js index 2ddbea33a..447a3f57f 100644 --- a/lib/contracts/deploy_manager.js +++ b/lib/contracts/deploy_manager.js @@ -24,7 +24,7 @@ class DeployManager { let self = this; if (self.blockchainConfig === {} || self.blockchainConfig.enabled === false) { - self.logger.info("Blockchain component is disabled in the config".underline); + self.logger.info(__("Blockchain component is disabled in the config").underline); this.events.emit('blockchainDisabled', {}); return done(); } @@ -47,15 +47,15 @@ class DeployManager { } if (self.web3.currentProvider === undefined) { - self.logger.error(("Couldn't connect to an Ethereum node are you sure it's on?").red); - self.logger.info("make sure you have an Ethereum node or simulator running. e.g 'embark blockchain'".magenta); + self.logger.error(__("Couldn't connect to an Ethereum node are you sure it's on?").red); + self.logger.info(__("make sure you have an Ethereum node or simulator running. e.g '%s'", 'embark blockchain').magenta); return callback(Error("error connecting to blockchain node")); } self.web3.eth.getAccounts(function(err, _accounts) { if (err) { - self.logger.error(("Couldn't connect to an Ethereum node are you sure it's on?").red); - self.logger.info("make sure you have an Ethereum node or simulator running. e.g 'embark blockchain'".magenta); + self.logger.error(__("Couldn't connect to an Ethereum node are you sure it's on?").red); + self.logger.info(__("make sure you have an Ethereum node or simulator running. e.g '%s'", 'embark blockchain').magenta); return callback(Error("error connecting to blockchain node")); } return callback(null, contractsManager, self.web3); @@ -108,19 +108,19 @@ class DeployManager { let referedContract = contractsManager.getContract(referedContractName); if (!referedContract) { self.logger.error(referedContractName + ' does not exist'); - self.logger.error("error running afterDeploy: " + cmd); + self.logger.error(__("error running afterDeploy: ") + cmd); withErrors = true; return; } if (referedContract && referedContract.deploy === false) { self.logger.error(referedContractName + " exists but has been set to not deploy"); - self.logger.error("error running afterDeploy: " + cmd); + self.logger.error(__("error running afterDeploy: ") + cmd); withErrors = true; return; } if (referedContract && !referedContract.deployedAddress) { self.logger.error("couldn't find a valid address for " + referedContractName + ". has it been deployed?"); - self.logger.error("error running afterDeploy: " + cmd); + self.logger.error(__("error running afterDeploy: ") + cmd); withErrors = true; return; } @@ -135,12 +135,12 @@ class DeployManager { // TODO: convert to for to avoid repeated callback for(let cmd of onDeployCode) { - self.logger.info("executing: " + cmd); + self.logger.info(__("executing") + ": " + cmd); try { RunCode.doEval(cmd, web3); } catch(e) { if (e.message.indexOf("invalid opcode") >= 0) { - self.logger.error('the transaction was rejected; this usually happens due to a throw or a require, it can also happen due to an invalid operation'); + self.logger.error(__('the transaction was rejected; this usually happens due to a throw or a require, it can also happen due to an invalid operation')); } return callback(new Error(e)); } diff --git a/lib/core/config.js b/lib/core/config.js index 43e7160af..44dace7b0 100644 --- a/lib/core/config.js +++ b/lib/core/config.js @@ -31,7 +31,7 @@ Config.prototype.loadConfigFiles = function(options) { } if (!fs.existsSync(options.embarkConfig)){ - this.logger.error('Cannot find file ' + options.embarkConfig + '. Please ensure you are running this command inside the Dapp folder'); + this.logger.error(__('Cannot find file %s Please ensure you are running this command inside the Dapp folder', options.embarkConfig)); process.exit(1); } @@ -78,7 +78,7 @@ Config.prototype._mergeConfig = function(configFilePath, defaultConfig, env, ena if (!fs.existsSync(configFilePath)) { // TODO: remove this if if (this.logger) { - this.logger.warn("no config file found at " + configFilePath + ". using default config"); + this.logger.warn(__("no config file found at %s using default config", configFilePath)); } return defaultConfig['default'] || {}; } @@ -162,7 +162,7 @@ Config.prototype.loadExternalContractsFiles = function() { if (contract.file.startsWith('http') || contract.file.startsWith('git')) { const fileObj = utils.getExternalContractUrl(contract.file); if (!fileObj) { - return this.logger.error("HTTP contract file not found: " + contract.file); + return this.logger.error(__("HTTP contract file not found") + ": " + contract.file); } const localFile = fileObj.filePath; this.contractsFiles.push(new File({filename: localFile, type: File.types.http, basedir: '', path: fileObj.url})); @@ -171,7 +171,7 @@ Config.prototype.loadExternalContractsFiles = function() { } else if (fs.existsSync(path.join('./node_modules/', contract.file))) { this.contractsFiles.push(new File({filename: path.join('./node_modules/', contract.file), type: File.types.dapp_file, basedir: '', path: path.join('./node_modules/', contract.file)})); } else { - this.logger.error("contract file not found: " + contract.file); + this.logger.error(__("contract file not found") + ": " + contract.file); } } }; @@ -253,7 +253,7 @@ Config.prototype.loadPipelineConfigFile = function() { Config.prototype.loadChainTrackerFile = function() { if (!fs.existsSync(this.chainsFile)) { - this.logger.info(this.chainsFile + ' file not found, creating it...'); + this.logger.info(this.chainsFile + ' ' + __('file not found, creating it...')); fs.writeJSONSync(this.chainsFile, {}); } diff --git a/lib/core/engine.js b/lib/core/engine.js index bef11c74a..2254d1acf 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -280,18 +280,18 @@ class Engine { self.servicesMonitor.addCheck('Ethereum', function (cb) { if (self.web3.currentProvider === undefined) { - return cb({name: "No Blockchain node found", status: 'off'}); + return cb({name: __("No Blockchain node found"), status: 'off'}); } self.web3.eth.getAccounts(function(err, _accounts) { if (err) { - return cb({name: "No Blockchain node found", status: 'off'}); + return cb({name: __("No Blockchain node found"), status: 'off'}); } // TODO: web3_clientVersion method is currently not implemented in web3.js 1.0 self.web3._requestManager.send({method: 'web3_clientVersion', params: []}, (err, version) => { if (err) { - return cb({name: "Ethereum node (version unknown)", status: 'on'}); + return cb({name: __("Ethereum node (version unknown)"), status: 'on'}); } if (version.indexOf("/") < 0) { return cb({name: version, status: 'on'}); diff --git a/lib/core/events.js b/lib/core/events.js index c561f0008..f63e282bf 100644 --- a/lib/core/events.js +++ b/lib/core/events.js @@ -3,7 +3,7 @@ var EventEmitter = require('events'); function warnIfLegacy(eventName) { const legacyEvents = ['abi-vanila', 'abi', 'abi-contracts-vanila', 'abi-vanila-deployment']; if (legacyEvents.indexOf(eventName) >= 0) { - console.info("this event is deprecated and will be removed in future versions: " + eventName); + console.info(__("this event is deprecated and will be removed in future versions %s", eventName)); } } diff --git a/lib/core/file.js b/lib/core/file.js index 62cd859ee..65e5e634d 100644 --- a/lib/core/file.js +++ b/lib/core/file.js @@ -93,7 +93,7 @@ class File { } ], (err, content) => { if (err) { - console.error('Error while downloading the file', err); + console.error(__('Error while downloading the file'), err); return callback(''); } callback(content.toString()); diff --git a/lib/core/plugin.js b/lib/core/plugin.js index 00abe240c..2e53238c4 100644 --- a/lib/core/plugin.js +++ b/lib/core/plugin.js @@ -56,7 +56,7 @@ Plugin.prototype.hasContext = function(context) { Plugin.prototype.loadPlugin = function() { if (!this.isContextValid()) { console.log(this.acceptedContext); - this.logger.warn(`Plugin ${this.name} can only be loaded in the context of "${this.acceptedContext.join(', ')}"`); + this.logger.warn(__('Plugin {{name}} can only be loaded in the context of "{{contextes}}"', {name: this.name, contextes: this.acceptedContext.join(', ')})); return false; } this.loaded = true; diff --git a/lib/core/services_monitor.js b/lib/core/services_monitor.js index 9b830568e..1cfc506ef 100644 --- a/lib/core/services_monitor.js +++ b/lib/core/services_monitor.js @@ -70,7 +70,7 @@ ServicesMonitor.prototype.startMonitor = function () { callback(); }, function (err) { if (err) { - self.logger.error("error running service check"); + self.logger.error(__("error running service check")); self.logger.error(err.message); } }); diff --git a/lib/dashboard/console.js b/lib/dashboard/console.js index 907e9844b..7bdae32b3 100644 --- a/lib/dashboard/console.js +++ b/lib/dashboard/console.js @@ -14,21 +14,21 @@ class Console { } processEmbarkCmd (cmd) { - if (cmd === 'help') { + if (cmd === 'help' || cmd === __('help')) { let helpText = [ - 'Welcome to Embark ' + this.version, + __('Welcome to Embark') + ' ' + this.version, '', - 'possible commands are:', - 'versions - display versions in use for libraries and tools like web3 and solc', + __('possible commands are:'), + 'versions - ' + __('display versions in use for libraries and tools like web3 and solc'), // TODO: only if the blockchain is actually active! // will need to pass te current embark state here - 'web3 - instantiated web3.js object configured to the current environment', - 'quit - to immediatly exit (alias: exit)', + 'web3 - ' + __('instantiated web3.js object configured to the current environment'), + 'quit - ' + __('to immediatly exit (alias: exit)'), '', - 'The web3 object and the interfaces for the deployed contracts and their methods are also available' + __('The web3 object and the interfaces for the deployed contracts and their methods are also available') ]; return helpText.join('\n'); - } else if (['quit', 'exit', 'sair', 'sortir'].indexOf(cmd) >= 0) { + } else if (['quit', 'exit', 'sair', 'sortir', __('quit')].indexOf(cmd) >= 0) { utils.exit(); } return false; @@ -52,7 +52,7 @@ class Console { } catch (e) { if (e.message.indexOf('not defined') > 0) { - return callback(("error: " + e.message).red + ("\nType " + "help".bold + " to see the list of available commands").cyan); + return callback(("error: " + e.message).red + ("\n" + __("Type") + " " + "help".bold + " " + __("to see the list of available commands")).cyan); } else { return callback(e.message); } diff --git a/lib/dashboard/dashboard.js b/lib/dashboard/dashboard.js index 2ce994fb0..029b14e85 100644 --- a/lib/dashboard/dashboard.js +++ b/lib/dashboard/dashboard.js @@ -38,7 +38,7 @@ class Dashboard { self.events.setCommandHandler("console:command", monitor.executeCmd.bind(monitor)); self.logger.info('========================'.bold.green); - self.logger.info(('Welcome to Embark ' + self.version).yellow.bold); + self.logger.info((__('Welcome to Embark') + ' ' + self.version).yellow.bold); self.logger.info('========================'.bold.green); // TODO: do this after monitor is rendered diff --git a/lib/dashboard/monitor.js b/lib/dashboard/monitor.js index 2b98967ae..193b2b9c2 100644 --- a/lib/dashboard/monitor.js +++ b/lib/dashboard/monitor.js @@ -67,7 +67,7 @@ class Dashboard { setContracts(contracts) { let data = []; - data.push(["Contract Name", "Address", "Status"]); + data.push([__("Contract Name"), __("Address"), __("Status")]); contracts.forEach(function (row) { data.push(row); @@ -84,7 +84,7 @@ class Dashboard { layoutLog() { this.log = blessed.box({ - label: "Logs", + label: __("Logs"), padding: 1, width: "100%", height: "55%", @@ -123,7 +123,7 @@ class Dashboard { layoutModules() { this.modules = blessed.box({ - label: "Contracts", + label: __("Contracts"), tags: true, padding: 1, width: "75%", @@ -166,7 +166,7 @@ class Dashboard { layoutAssets() { this.assets = blessed.box({ - label: "Asset Pipeline", + label: __("Asset Pipeline"), tags: true, padding: 1, width: "50%", @@ -217,7 +217,7 @@ class Dashboard { this.status = blessed.box({ parent: this.wrapper, - label: "Environment", + label: __("Environment"), tags: true, padding: { left: 1 @@ -238,7 +238,7 @@ class Dashboard { this.operations = blessed.box({ parent: this.wrapper, - label: "Status", + label: __("Status"), tags: true, padding: { left: 1 @@ -259,7 +259,7 @@ class Dashboard { this.progress = blessed.box({ parent: this.wrapper, - label: "Available Services", + label: __("Available Services"), tags: true, padding: this.minimal ? { left: 1 @@ -283,7 +283,7 @@ class Dashboard { layoutCmd() { this.consoleBox = blessed.box({ - label: 'Console', + label: __('Console'), tags: true, padding: 0, width: '100%', diff --git a/lib/index.js b/lib/index.js index 81481e7d0..a55fc1a00 100644 --- a/lib/index.js +++ b/lib/index.js @@ -87,7 +87,7 @@ class Embark { if (!options.useDashboard) { engine.logger.info('========================'.bold.green); - engine.logger.info(('Welcome to Embark ' + this.version).yellow.bold); + engine.logger.info((__('Welcome to Embark') + ' ' + this.version).yellow.bold); engine.logger.info('========================'.bold.green); } @@ -106,14 +106,14 @@ class Embark { contractsConfig: engine.config.contractsConfig }); dashboard.start(function () { - engine.logger.info('dashboard start'); + engine.logger.info(__('dashboard start')); callback(); }); }, function (callback) { let pluginList = engine.plugins.listPlugins(); if (pluginList.length > 0) { - engine.logger.info("loaded plugins: " + pluginList.join(", ")); + engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", ")); } engine.startMonitor(); @@ -125,17 +125,17 @@ class Embark { engine.startService(engine.config.storageConfig.provider, {bzz: engine.web3.bzz}); engine.events.on('check:backOnline:Ethereum', function () { - engine.logger.info('Ethereum node detected..'); + engine.logger.info(__('Ethereum node detected') + '..'); engine.config.reloadConfig(); engine.deployManager.deployContracts(function () { - engine.logger.info('Deployment Done'); + engine.logger.info(__('Deployment Done')); }); }); engine.events.on('outputDone', function () { - engine.logger.info("Looking for documentation? You can find it at ".cyan + "http://embark.readthedocs.io/".green.underline + ".".cyan); - engine.logger.info("Ready".underline); - engine.events.emit("status", "Ready".green); + engine.logger.info((__("Looking for documentation? You can find it at") + " ").cyan + "http://embark.status.im/docs/".green.underline + ".".cyan); + engine.logger.info(__("Ready").underline); + engine.events.emit("status", __("Ready").green); }); engine.deployManager.deployContracts(function (err) { @@ -158,7 +158,7 @@ class Embark { let size = windowSize.get(); if (size.height < 40 || size.width < 118) { - engine.logger.warn("tip: you can resize the terminal or disable the dashboard with " + "embark run --nodashboard".bold.underline); + engine.logger.warn(__("tip: you can resize the terminal or disable the dashboard with") + " embark run --nodashboard".bold.underline); } } }); @@ -186,7 +186,7 @@ class Embark { function startServices(callback) { let pluginList = engine.plugins.listPlugins(); if (pluginList.length > 0) { - engine.logger.info("loaded plugins: " + pluginList.join(", ")); + engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", ")); } engine.startService("libraryManager"); @@ -208,7 +208,7 @@ class Embark { engine.logger.error(err.message); engine.logger.debug(err.stack); } else { - engine.logger.info("finished building".underline); + engine.logger.info(__("finished building").underline); } // needed due to child processes process.exit(); @@ -235,13 +235,12 @@ class Embark { }); engine.init(); - async.parallel([ - + function (callback) { let pluginList = engine.plugins.listPlugins(); if (pluginList.length > 0) { - engine.logger.info("loaded plugins: " + pluginList.join(", ")); + engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", ")); } engine.startMonitor(); @@ -264,7 +263,7 @@ class Embark { let graphGen = new GraphGenerator(engine); graphGen.generate(options); - engine.logger.info("Done. ./diagram.svg generated".underline); + engine.logger.info(__("Done. %s generated", "./diagram.svg").underline); process.exit(); } }); @@ -278,7 +277,7 @@ class Embark { } upload(platform, options) { - + this.context = options.context || [constants.contexts.upload, constants.contexts.build]; let engine = new Engine({ @@ -297,9 +296,9 @@ class Embark { let cmdPlugin; async.waterfall([ - + function startServices(callback) { - + engine.startService("libraryManager"); engine.startService("web3"); engine.startService("pipeline"); @@ -322,7 +321,7 @@ class Embark { } checkFn.fn(function (serviceCheckResult) { if (!serviceCheckResult.status || serviceCheckResult.status === 'off') { - return callback({message: `Cannot upload: ${platform} node is not running on http://${engine.config.storageConfig.host}:${engine.config.storageConfig.port}.`}); + return callback({message: __('Cannot upload: {{platform}} node is not running on {{url}}.', {platform: platform, url: `http://${engine.config.storageConfig.host}:${engine.config.storageConfig.port}`})}); } callback(); }); @@ -330,12 +329,12 @@ class Embark { function setupStoragePlugin(callback){ let pluginList = engine.plugins.listPlugins(); if (pluginList.length > 0) { - engine.logger.info("loaded plugins: " + pluginList.join(", ")); + engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", ")); } - + // check use has input existing storage plugin let cmdPlugins = engine.plugins.getPluginsFor('uploadCmds'); - + if (cmdPlugins.length > 0) { cmdPlugin = cmdPlugins.find((pluginCmd) => { return pluginCmd.uploadCmds.some(uploadCmd => { @@ -344,7 +343,7 @@ class Embark { }); } if (!cmdPlugin) { - engine.logger.info('try "embark upload ipfs" or "embark upload swarm"'.green); + engine.logger.info(__('try "{{ipfs}}" or "{{swarm}}"', {ipfs: 'embark upload ipfs', swarm: 'embark upload swarm'}).green); return callback({message: 'unknown platform: ' + platform}); } callback(); @@ -360,7 +359,7 @@ class Embark { }); // 1. build the contracts and dapp webpack engine.deployManager.deployContracts(function (err) { - engine.logger.info("finished deploying".underline); + engine.logger.info(__("finished deploying").underline); if(err){ callback(err); } @@ -371,7 +370,7 @@ class Embark { engine.logger.error(err.message); engine.logger.debug(err.stack); } else { - engine.logger.info(`finished building DApp and deploying to ${platform}`.underline); + engine.logger.info((__("finished building DApp and deploying to") + " " + platform).underline); } // needed due to child processes diff --git a/lib/modules/ipfs/index.js b/lib/modules/ipfs/index.js index e433be6d3..d5a310708 100644 --- a/lib/modules/ipfs/index.js +++ b/lib/modules/ipfs/index.js @@ -43,11 +43,11 @@ class IPFS { } self.events.on('check:backOnline:IPFS', function () { - self.logger.info('IPFS node detected..'); + self.logger.info(__('IPFS node detected') + '..'); }); self.events.on('check:wentOffline:IPFS', function () { - self.logger.info('IPFS node is offline..'); + self.logger.info(__('IPFS node is offline') + '..'); }); if (!self.addCheck) { diff --git a/lib/modules/ipfs/upload.js b/lib/modules/ipfs/upload.js index 36c65e407..273b2f452 100644 --- a/lib/modules/ipfs/upload.js +++ b/lib/modules/ipfs/upload.js @@ -20,7 +20,7 @@ class IPFS { let ipfs_bin = shelljs.which(self.configIpfsBin); if (ipfs_bin === 'ipfs not found' || !ipfs_bin) { - console.log(('=== WARNING: ' + self.configIpfsBin + ' not found or not in the path. Guessing ~/go/bin/ipfs for path').yellow); + console.log(('=== WARNING: ' + self.configIpfsBin + ' ' + __('not found or not in the path. Guessing %s for path', '~/go/bin/ipfs')).yellow); ipfs_bin = "~/go/bin/ipfs"; } @@ -28,7 +28,7 @@ class IPFS { }, function runCommand(ipfs_bin, callback) { let cmd = `"${ipfs_bin}" add -r ${self.buildDir}`; - console.log(("=== adding " + self.buildDir + " to ipfs").green); + console.log(("=== " + __("adding %s to ipfs", self.buildDir)).green); console.debug(cmd); shelljs.exec(cmd, {silent:true}, function(code, stdout, stderr){ // {silent:true}: don't echo cmd output so it can be controlled via logLevel console.log(stdout.green); @@ -43,18 +43,18 @@ class IPFS { callback(null, dir_hash); }, function printUrls(dir_hash, callback) { - console.log(("=== DApp available at http://localhost:8080/ipfs/" + dir_hash + "/").green); - console.log(("=== DApp available at http://gateway.ipfs.io/ipfs/" + dir_hash + "/").green); + console.log(("=== " + __("DApp available at") + " http://localhost:8080/ipfs/" + dir_hash + "/").green); + console.log(("=== " + __("DApp available at") + " http://gateway.ipfs.io/ipfs/" + dir_hash + "/").green); callback(); } ], function (err, _result) { if (err) { - console.log("error uploading to ipfs".red); + console.log(__("error uploading to ipfs").red); console.log(err); reject(err); } - else resolve('successfully uploaded to ipfs'); + else resolve(__('successfully uploaded to ipfs')); }); }); } diff --git a/lib/modules/solidity/index.js b/lib/modules/solidity/index.js index 424ab59d2..054a7287f 100644 --- a/lib/modules/solidity/index.js +++ b/lib/modules/solidity/index.js @@ -28,7 +28,7 @@ class Solidity { file.content(function(fileContent) { if (!fileContent) { - self.logger.error('Error while loading the content of ' + filename); + self.logger.error(__('Error while loading the content of ') + filename); return fileCb(); } input[filename] = {content: fileContent.replace(/\r\n/g, '\n')}; @@ -47,13 +47,13 @@ class Solidity { return callback(); } - self.logger.info("loading solc compiler.."); + self.logger.info(__("loading solc compiler") + ".."); solcW.load_compiler(function (err) { callback(err); }); }, function compileContracts(callback) { - self.logger.info("compiling solidity contracts..."); + self.logger.info(__("compiling solidity contracts") + "..."); let jsonObj = { language: 'Solidity', sources: input, @@ -88,11 +88,11 @@ class Solidity { let json = output.contracts; if (!output || !output.contracts) { - return callback(new Error("error compiling for unknown reasons")); + return callback(new Error(__("error compiling for unknown reasons"))); } if (Object.keys(output.contracts).length === 0 && output.sourceList.length > 0) { - return callback(new Error("error compiling. There are sources available but no code could be compiled, likely due to fatal errors in the solidity code").message); + return callback(new Error(__("error compiling. There are sources available but no code could be compiled, likely due to fatal errors in the solidity code")).message); } let compiled_object = {}; diff --git a/lib/modules/swarm/index.js b/lib/modules/swarm/index.js index 07660f4b3..a8901cc16 100644 --- a/lib/modules/swarm/index.js +++ b/lib/modules/swarm/index.js @@ -52,11 +52,11 @@ class Swarm { } this.events.on('check:backOnline:Swarm', function () { - self.logger.info('Swarm node detected...'); + self.logger.info(__('Swarm node detected...')); }); this.events.on('check:wentOffline:Swarm', function () { - self.logger.info('Swarm node is offline...'); + self.logger.info(__('Swarm node is offline...')); }); if (!this.addCheck) { diff --git a/lib/modules/swarm/upload.js b/lib/modules/swarm/upload.js index fbe64924a..4defd9118 100644 --- a/lib/modules/swarm/upload.js +++ b/lib/modules/swarm/upload.js @@ -11,12 +11,12 @@ class Swarm { deploy() { return new Promise((resolve, reject) => { - console.log("deploying to swarm!"); + console.log(__("deploying to swarm!")); let self = this; let bzz = this.bzz; async.waterfall([ function runCommand(callback) { - console.log(("=== adding " + self.buildDir + " to swarm").green); + console.log(("=== " + __("adding %s to swarm", self.buildDir)).green); bzz.upload({ path: self.buildDir, // path to data / file / directory kind: "directory", // could also be "file" or "data" @@ -31,17 +31,17 @@ class Swarm { if (!dir_hash) { return callback('No directory hash was returned'); } - console.log((`=== DApp available at ${self.storageConfig.getUrl}${dir_hash}/`).green); + console.log(("=== " + __("DApp available at") + `${self.storageConfig.getUrl}${dir_hash}/`).green); callback(); } ], function (err, _result) { if (err) { - console.log("error uploading to swarm".red); + console.log(__("error uploading to swarm").red); console.log(err); return reject(err); } - resolve('successfully uploaded to swarm'); + resolve(__('successfully uploaded to swarm')); }); }); } diff --git a/lib/modules/vyper/index.js b/lib/modules/vyper/index.js index 04bbd2106..f05ba4aad 100644 --- a/lib/modules/vyper/index.js +++ b/lib/modules/vyper/index.js @@ -19,10 +19,10 @@ class Vyper { return callback(stderr); } if (code !== 0) { - return callback(`Vyper exited with error code ${code}`); + return callback(__('Vyper exited with error code ') + code); } if (!stdout) { - return callback('Execution returned no result'); + return callback(__('Execution returned no result')); } callback(null, stdout.replace(/\n/g, '')); }); @@ -33,7 +33,7 @@ class Vyper { if (!contractFiles || !contractFiles.length) { return cb(); } - self.logger.info("compiling Vyper contracts..."); + self.logger.info(__("compiling Vyper contracts") + "..."); const compiled_object = {}; async.each(contractFiles, function (file, fileCb) { diff --git a/lib/modules/webserver/index.js b/lib/modules/webserver/index.js index e3a313fec..63232cc35 100644 --- a/lib/modules/webserver/index.js +++ b/lib/modules/webserver/index.js @@ -16,7 +16,7 @@ class WebServer { this.host = options.host || this.webServerConfig.host; this.port = options.port || this.webServerConfig.port; - this.events.emit("status", "Starting Server"); + this.events.emit("status", __("Starting Server")); this.server = new Server({logger: this.logger, host: this.host, port: this.port}); this.setServiceCheck(); @@ -32,14 +32,14 @@ class WebServer { //embark.registerServiceCheck('WebserverService', function (cb) { this.addCheck('Webserver', function (cb) { utils.checkIsAvailable(url, function (available) { - let devServer = 'Webserver (' + url + ')'; + let devServer = __('Webserver') + ' (' + url + ')'; let serverStatus = (available ? 'on' : 'off'); return cb({name: devServer, status: serverStatus}); }); }); this.events.on('check:wentOffline:Webserver', () => { - this.logger.info("Webserver is offline"); + this.logger.info(__("Webserver is offline")); }); } @@ -57,7 +57,7 @@ class WebServer { } if (cmd === 'webserver stop') { self.events.request("stop-webserver"); - return "stopping webserver..."; + return __("stopping webserver") + "..."; } return false; }); diff --git a/lib/modules/webserver/server.js b/lib/modules/webserver/server.js index 99c824ac9..9f1c64edb 100644 --- a/lib/modules/webserver/server.js +++ b/lib/modules/webserver/server.js @@ -13,7 +13,7 @@ class Server { start(callback) { if (this.server && this.server.listening) { - this.logger.warn("a webserver is already running at " + ("http://" + this.hostname + ":" + this.port).bold.underline.green); + this.logger.warn(__("a webserver is already running at") + " " + ("http://" + this.hostname + ":" + this.port).bold.underline.green); if (callback) { callback(); } @@ -25,7 +25,7 @@ class Server { serve(req, res, finalhandler(req, res)); }).withShutdown(); - this.logger.info("webserver available at " + ("http://" + this.hostname + ":" + this.port).bold.underline.green); + this.logger.info(__("webserver available at") + " " + ("http://" + this.hostname + ":" + this.port).bold.underline.green); this.server.listen(this.port, this.hostname); if (callback) { callback(); @@ -34,7 +34,7 @@ class Server { stop(callback) { if (!this.server || !this.server.listening) { - this.logger.warn("no webserver is currently running"); + this.logger.warn(__("no webserver is currently running")); if (callback) { callback(); } diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index b1a5e86b7..041382af5 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -112,7 +112,7 @@ class Pipeline { }, function (err, contentFiles) { if (err) { - self.logger.error('errors found while generating ' + targetFile); + self.logger.error(__('errors found while generating') + ' ' + targetFile); } let dir = targetFile.split('/').slice(0, -1).join('/'); self.logger.trace("creating dir " + self.buildDir + dir); @@ -142,7 +142,7 @@ class Pipeline { return file.content; }).join("\n"); - self.logger.info("writing file " + (self.buildDir + targetFile).bold.dim); + self.logger.info(__("writing file") + " " + (self.buildDir + targetFile).bold.dim); fs.writeFile(self.buildDir + targetFile, content, cb); } ); diff --git a/lib/pipeline/watch.js b/lib/pipeline/watch.js index 2bce33d1b..910bb382e 100644 --- a/lib/pipeline/watch.js +++ b/lib/pipeline/watch.js @@ -31,7 +31,7 @@ class Watch { self.logger.trace('ready to watch config changes'); }); - this.logger.info("ready to watch file changes"); + this.logger.info(__("ready to watch file changes")); } restart() { diff --git a/lib/tests/test.js b/lib/tests/test.js index 7fc4f2e4a..ddd9feef4 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -11,15 +11,15 @@ var getSimulator = function() { return sim; } catch (e) { if (e.code === 'MODULE_NOT_FOUND') { - console.log('Simulator not found; Please install it with "npm install ethereumjs-testrpc --save"'); - console.log('IMPORTANT: if you using a NodeJS version older than 6.9.1 then you need to install an older version of testrpc "npm install ethereumjs-testrpc@2.0 --save"'); + console.log(__('Simulator not found; Please install it with "%s"', 'npm install ethereumjs-testrpc --save')); + console.log(__('IMPORTANT: if you using a NodeJS version older than 6.9.1 then you need to install an older version of testrpc "%s"', 'npm install ethereumjs-testrpc@2.0 --save')); console.log('For more information see https://github.com/ethereumjs/testrpc'); // TODO: should throw exception instead return process.exit(); } console.log("=============="); - console.log("Tried to load testrpc but an error occurred. This is a problem with testrpc"); - console.log('IMPORTANT: if you using a NodeJS version older than 6.9.1 then you need to install an older version of testrpc "npm install ethereumjs-testrpc@2.0 --save". Alternatively install node 6.9.1 and the testrpc 3.0'); + console.log(__("Tried to load testrpc but an error occurred. This is a problem with testrpc")); + console.log(__('IMPORTANT: if you using a NodeJS version older than 6.9.1 then you need to install an older version of testrpc "%s". Alternatively install node 6.9.1 and the testrpc 3.0', 'npm install ethereumjs-testrpc@2.0 --save')); console.log("=============="); throw e; } @@ -88,7 +88,7 @@ Test.prototype.deployAll = function(contractsConfig, cb) { } ], function(err, result) { if (err) { - console.log('terminating due to error'); + console.log(__('terminating due to error')); process.exit(1); } // this should be part of the waterfall and not just something done at the diff --git a/lib/versions/library_manager.js b/lib/versions/library_manager.js index 05bf2879a..3eb1f72b6 100644 --- a/lib/versions/library_manager.js +++ b/lib/versions/library_manager.js @@ -31,7 +31,7 @@ class LibraryManager { Object.keys(this.versions).forEach(versionKey => { const newVersion = this.versions[versionKey].trim(); if (newVersion !== this.versions[versionKey]) { - this.embark.logger.warn(`There a a space in the version of ${versionKey}. We corrected it for you ("${this.versions[versionKey]}" => "${newVersion}").`); + this.embark.logger.warn(__('There a a space in the version of {{versionKey}}. We corrected it for you ({{correction}}).', {versionKey: versionKey, correction: `"${this.versions[versionKey]}" => "${newVersion}"`})); this.versions[versionKey] = newVersion; } }); @@ -40,8 +40,8 @@ class LibraryManager { registerCommands() { const self = this; this.embark.registerConsoleCommand((cmd, _options) => { - if (cmd === "versions") { - let text = ['versions in use:']; + if (cmd === "versions" || cmd === __('versions')) { + let text = [__('versions in use') + ':']; for (let lib in self.versions) { text.push(lib + ": " + self.versions[lib]); } diff --git a/lib/versions/npm.js b/lib/versions/npm.js index a6d50246b..1bac43063 100644 --- a/lib/versions/npm.js +++ b/lib/versions/npm.js @@ -18,6 +18,7 @@ class Npm { } this.logger.info("downloading " + packageName + " " + version + "...."); + this.logger.info(__("downloading {{packageName}} {{version}}....", {packageName: packageName, version: version})); manager.install(packageName, version).then((result) => { callback(null , result.location); }).catch(callback); diff --git a/locales/en.json b/locales/en.json new file mode 100644 index 000000000..83356359d --- /dev/null +++ b/locales/en.json @@ -0,0 +1,4 @@ +{ + "new_application": "new_application", + "Contract Name": "Contract Name" +} \ No newline at end of file diff --git a/locales/pt.json b/locales/pt.json new file mode 100644 index 000000000..200b234f8 --- /dev/null +++ b/locales/pt.json @@ -0,0 +1,73 @@ +{ + "New Application": "Nova Aplicacao", + "Contract Name": "Contracto", + "Address": "Endereço", + "Status": "Estado", + "Embark Blockchain Using: %s": "Embark Blockchain esta usando o commando: %s", + "running: %s": "executando: %s", + "already initialized": "ja esta inicializado", + "create a barebones project meant only for contract development": "criar um projeto vazio destinado apenas ao desenvolvimento de contratos", + "loading solc compiler": "carregando o compilador solc", + "Welcome to Embark": "Bem-vindo ao Embark", + "possible commands are:": "comandos possíveis são:", + "display versions in use for libraries and tools like web3 and solc": "lista versões em uso para bibliotecas e ferramentas como web3 e solc", + "instantiated web3.js object configured to the current environment": "objeto web3.js instanciado configurado para o ambiente atual", + "to immediatly exit (alias: exit)": "para sair imediatamente (alias: exit)", + "The web3 object and the interfaces for the deployed contracts and their methods are also available": "O objeto web3 e as interfaces para os contratos implantados e seus métodos também estão disponíveis", + "create a working dapp with a SimpleStorage contract": "Cria uma dapp funcional com o contrato SimpleStorage", + "filename to output logs (default: none)": "ficheiro/arquivo para saída dos logs (predefinido: none)", + "level of logging to display": "nivel do log", + "deploy and build dapp at ": "Publica os contractos e constroi a applicacao em ", + "port to run the dev webserver (default: %s)": "porta para correr o servidor web para desenvolvimento (default: %s)", + "host to run the dev webserver (default: %s)": "host para correr o servidor web para desenvolvimento (default: %s)", + "disable the development webserver": "disativa o servidor web para desenvolvimento", + "simple mode, disables the dashboard": "modo simples, disativa o dashboard", + "no colors in case it's needed for compatbility purposes": "sem cores, em caso seja necessario para compabitilidade com a terminal", + "filename to output logs (default: %s)": "ficheiro/arquivo para os logs (predefinido: %s)", + "run dapp (default: %s)": "executa a dapp (applicacao decentralizada) (predefinido: %s)", + "Use a specific ethereum client or simulator (supported: %s)": "Usa um cliente ou simulador de ethereum específico (supportado: %s)", + "run blockchain server (default: %s)": "executa un node de blockchain (predefinido: %s)", + "run a fast ethereum rpc simulator": "executa um simulador RPC de ethereum", + "use testrpc as the rpc simulator [%s]": "usa testrpc como simulator de rpc [%s]", + "port to run the rpc simulator (default: %s)": "porta para executar simulador de rpc (predefinido: %s)", + "host to run the rpc simulator (default: %s)": "host para executar servidor de rpc (predefinido: %s)", + "number of accounts (default: %s)": "numero de contas (predefinido: %s)", + "Amount of ether to assign each test account (default: %s)": "Quantidade de éter para atribuir cada conta de teste (predefinido: %s)", + "custom gas limit (default: %s)": "limite de gás (predefinido: %s)", + "run tests": "executar os testes", + "resets embarks state on this dapp including clearing cache": "recomenca o estado do Embark nesta appliacao, incluindo a cache", + "generates documentation based on the smart contracts configured": "gera documentação baseada nos contratos configurados", + "Upload your dapp to a decentralized storage": "Carrega a appliacao para armazenamento descentralizado", + "output the version number": "produz a versão actual", + "Logs": "Logs", + "Environment": "Ambiente", + "Available Services": "Serviços Disponíveis", + "Contracts": "Contratos", + "Console": "Consola", + "dashboard start": "inicia o painel de controle", + "loaded plugins": "plugins carregados", + "compiling solidity contracts": "Compilando contratos Solidity", + "%s doesn't have a compatible contract compiler. Maybe a plugin exists for it.": "%s não tem um compilador de contrato compatível. Talvez exista um plugin para isso.", + "assuming %s to be an interface": "assumindo que %s é uma interface", + "{{className}}: couldn't find instanceOf contract {{parentContractName}}": "{{className}}: não foi possível encontrar instancia de (instanceOf) do contrato {{parentContractName}}", + "did you mean \"%s\"?": "você quis dizer \"%s\"?", + "%s has no code associated": "%s não tem código associado", + "deploying contracts": "publicando contratos", + "running beforeDeploy plugin %s .": "executando plugin beforeDeploy %s .", + "deploying": "publicando", + "with": "com", + "gas": "gas", + "Pending": "Pendente", + "Interface or set to not deploy": "Interface ou configurado para não ser publicado", + "error deploying": "erro de publicação", + "due to error": "devido a erro", + "error deploying contracts": "erro publicando contratos", + "finished deploying contracts": "publicação de contratos concluida", + "error running afterDeploy: ": "erro executado afterDeploy: ", + "ready to watch file changes": "pronto para monitorar alterações em ficheiros/arquivos", + "Starting Server": "iniciando o servidor", + "webserver available at": "servidor web disponivel em", + "Webserver": "Servidor Web", + " already deployed at ": " already deployed at ", + "Deployed": "Deployed" +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d693481d3..b2cbd9a18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,8 +65,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=", - "dev": true + "integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=" }, "accepts": { "version": "1.3.5", @@ -2212,6 +2211,11 @@ "randomfill": "1.0.4" } }, + "csextends": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/csextends/-/csextends-1.2.0.tgz", + "integrity": "sha512-S/8k1bDTJIwuGgQYmsRoE+8P+ohV32WhQ0l4zqrc0XDdxOhjQQD7/wTZwCzoZX53jSX3V/qwjT+OkPTxWQcmjg==" + }, "css-color-names": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", @@ -2626,6 +2630,14 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "eachr": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/eachr/-/eachr-2.0.4.tgz", + "integrity": "sha1-Rm98qhBwj2EFCeMsgHqv5X/BIr8=", + "requires": { + "typechecker": "2.1.0" + } + }, "ecc-jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", @@ -2635,6 +2647,11 @@ "jsbn": "0.1.1" } }, + "editions": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", + "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==" + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -3240,6 +3257,21 @@ } } }, + "extendr": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/extendr/-/extendr-2.1.0.tgz", + "integrity": "sha1-MBqgu+pWX00tyPVw8qImEahSe1Y=", + "requires": { + "typechecker": "2.0.8" + }, + "dependencies": { + "typechecker": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-2.0.8.tgz", + "integrity": "sha1-6D2oS7ZMWEzLNFg4V2xAsDN9uC4=" + } + } + }, "external-editor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", @@ -3260,6 +3292,21 @@ "is-extglob": "1.0.0" } }, + "extract-opts": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/extract-opts/-/extract-opts-2.2.0.tgz", + "integrity": "sha1-H6KOunNSxttID4hc63GkaBC+bX0=", + "requires": { + "typechecker": "2.0.8" + }, + "dependencies": { + "typechecker": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-2.0.8.tgz", + "integrity": "sha1-6D2oS7ZMWEzLNFg4V2xAsDN9uC4=" + } + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -4752,6 +4799,19 @@ "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" }, + "i18n": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/i18n/-/i18n-0.8.3.tgz", + "integrity": "sha1-LYzxwkciYCwgQdAbpq5eqlE4jw4=", + "requires": { + "debug": "2.6.9", + "make-plural": "3.0.6", + "math-interval-parser": "1.1.0", + "messageformat": "0.3.1", + "mustache": "2.3.0", + "sprintf-js": "1.0.3" + } + }, "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", @@ -4842,6 +4902,20 @@ "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, + "ignorefs": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ignorefs/-/ignorefs-1.2.0.tgz", + "integrity": "sha1-2ln7hYl25KXkNwLM0fKC/byeV1Y=", + "requires": { + "editions": "1.3.4", + "ignorepatterns": "1.1.0" + } + }, + "ignorepatterns": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ignorepatterns/-/ignorepatterns-1.1.0.tgz", + "integrity": "sha1-rI9DbyI5td+2bV8NOpBKh6xnzF4=" + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -5985,6 +6059,22 @@ "pify": "3.0.0" } }, + "make-plural": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-3.0.6.tgz", + "integrity": "sha1-IDOgO6wpC487uRJY9lud9+iwHKc=", + "requires": { + "minimist": "1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "optional": true + } + } + }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", @@ -6029,6 +6119,14 @@ "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", "integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw=" }, + "math-interval-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-interval-parser/-/math-interval-parser-1.1.0.tgz", + "integrity": "sha1-2+2lsGsySZc8bfYXD94jhvCv2JM=", + "requires": { + "xregexp": "2.0.0" + } + }, "md5.js": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", @@ -6208,6 +6306,37 @@ "source-map": "0.5.7" } }, + "messageformat": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/messageformat/-/messageformat-0.3.1.tgz", + "integrity": "sha1-5Y//gkXps5cXmeW0PbWLPpQX9aI=", + "requires": { + "async": "1.5.2", + "glob": "6.0.4", + "make-plural": "3.0.6", + "nopt": "3.0.6", + "watchr": "2.4.13" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -6500,6 +6629,11 @@ "resolved": "https://registry.npmjs.org/murmurhash3js/-/murmurhash3js-3.0.1.tgz", "integrity": "sha1-Ppg+W0fCoG9DpxMXTn5DXKBEuZg=" }, + "mustache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.0.tgz", + "integrity": "sha1-QCj3d4sXcIpImTCm5SrDvKDaQdA=" + }, "mute-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", @@ -6699,7 +6833,6 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, "requires": { "abbrev": "1.1.1" } @@ -8573,6 +8706,14 @@ "ret": "0.1.15" } }, + "safefs": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/safefs/-/safefs-3.2.2.tgz", + "integrity": "sha1-gXDBRE1wOOCMrqBaN0+uL6NJ4Vw=", + "requires": { + "graceful-fs": "4.1.11" + } + }, "samsam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", @@ -8584,6 +8725,16 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=" }, + "scandirectory": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/scandirectory/-/scandirectory-2.5.0.tgz", + "integrity": "sha1-bOA/VKCQtmjjy+2/IO354xBZPnI=", + "requires": { + "ignorefs": "1.2.0", + "safefs": "3.2.2", + "taskgroup": "4.3.1" + } + }, "schema-utils": { "version": "0.4.5", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz", @@ -9773,6 +9924,15 @@ } } }, + "taskgroup": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/taskgroup/-/taskgroup-4.3.1.tgz", + "integrity": "sha1-feGT/r12gnPEV3MElwJNUSwnkVo=", + "requires": { + "ambi": "2.5.0", + "csextends": "1.2.0" + } + }, "text-encoding": { "version": "0.6.4", "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", @@ -9968,6 +10128,11 @@ "mime-types": "2.1.18" } }, + "typechecker": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-2.1.0.tgz", + "integrity": "sha1-0cIJOlT/ihn1jP+HfuqlTyJC04M=" + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -10369,6 +10534,21 @@ "neo-async": "2.5.1" } }, + "watchr": { + "version": "2.4.13", + "resolved": "https://registry.npmjs.org/watchr/-/watchr-2.4.13.tgz", + "integrity": "sha1-10hHu01vkPYf4sdPn2hmKqDgdgE=", + "requires": { + "eachr": "2.0.4", + "extendr": "2.1.0", + "extract-opts": "2.2.0", + "ignorefs": "1.2.0", + "safefs": "3.2.2", + "scandirectory": "2.5.0", + "taskgroup": "4.3.1", + "typechecker": "2.1.0" + } + }, "web3": { "version": "1.0.0-beta.34", "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.34.tgz", @@ -11021,6 +11201,11 @@ "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz", "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=" }, + "xregexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", + "integrity": "sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=" + }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", diff --git a/package.json b/package.json index 8599dd442..02271d346 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "globule": "^1.1.0", "hard-source-webpack-plugin": "^0.6.6", "http-shutdown": "^1.2.0", + "i18n": "^0.8.3", "ipfs-api": "17.2.4", "live-plugin-manager": "https://github.com/iurimatias/live-plugin-manager.git", "merge": "^1.2.0", diff --git a/test_apps/test_app/package-lock.json b/test_apps/test_app/package-lock.json index 73520be33..6a0c2c661 100644 --- a/test_apps/test_app/package-lock.json +++ b/test_apps/test_app/package-lock.json @@ -152,6 +152,11 @@ "ua-parser-js": "0.7.17" } }, + "haml": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/haml/-/haml-0.4.3.tgz", + "integrity": "sha1-90BTGPPC7dGXpIsbjysvE+C7U3g=" + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", diff --git a/test_apps/test_app/package.json b/test_apps/test_app/package.json index b29e3d6ca..8dd7bc59e 100644 --- a/test_apps/test_app/package.json +++ b/test_apps/test_app/package.json @@ -15,6 +15,7 @@ "dependencies": { "bootstrap": "^3.3.6", "embark-service": "file:extensions/embark-service", + "haml": "^0.4.3", "jquery": "^1.11.3", "react": "^16.0.0", "react-bootstrap": "^0.32.0", From 63504e5da9641a2e8284a927ef58b41fdeab92ff Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 8 May 2018 19:11:45 -0400 Subject: [PATCH 2/8] add other locale keys --- locales/en.json | 71 +++++++++++++++++++++++++++- locales/pt.json | 121 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 189 insertions(+), 3 deletions(-) diff --git a/locales/en.json b/locales/en.json index 83356359d..6c3743252 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1,4 +1,73 @@ { "new_application": "new_application", - "Contract Name": "Contract Name" + "Contract Name": "Contract Name", + "New Application": "New Application", + "create a barebones project meant only for contract development": "create a barebones project meant only for contract development", + "create a working dapp with a SimpleStorage contract": "create a working dapp with a SimpleStorage contract", + "filename to output logs (default: none)": "filename to output logs (default: none)", + "level of logging to display": "level of logging to display", + "deploy and build dapp at ": "deploy and build dapp at ", + "port to run the dev webserver (default: %s)": "port to run the dev webserver (default: %s)", + "host to run the dev webserver (default: %s)": "host to run the dev webserver (default: %s)", + "disable the development webserver": "disable the development webserver", + "simple mode, disables the dashboard": "simple mode, disables the dashboard", + "no colors in case it's needed for compatbility purposes": "no colors in case it's needed for compatbility purposes", + "filename to output logs (default: %s)": "filename to output logs (default: %s)", + "run dapp (default: %s)": "run dapp (default: %s)", + "Use a specific ethereum client or simulator (supported: %s)": "Use a specific ethereum client or simulator (supported: %s)", + "run blockchain server (default: %s)": "run blockchain server (default: %s)", + "run a fast ethereum rpc simulator": "run a fast ethereum rpc simulator", + "use testrpc as the rpc simulator [%s]": "use testrpc as the rpc simulator [%s]", + "port to run the rpc simulator (default: %s)": "port to run the rpc simulator (default: %s)", + "host to run the rpc simulator (default: %s)": "host to run the rpc simulator (default: %s)", + "number of accounts (default: %s)": "number of accounts (default: %s)", + "Amount of ether to assign each test account (default: %s)": "Amount of ether to assign each test account (default: %s)", + "custom gas limit (default: %s)": "custom gas limit (default: %s)", + "run tests": "run tests", + "resets embarks state on this dapp including clearing cache": "resets embarks state on this dapp including clearing cache", + "generates documentation based on the smart contracts configured": "generates documentation based on the smart contracts configured", + "Upload your dapp to a decentralized storage": "Upload your dapp to a decentralized storage", + "output the version number": "output the version number", + "Logs": "Logs", + "Environment": "Environment", + "Status": "Status", + "Available Services": "Available Services", + "Contracts": "Contracts", + "Console": "Console", + "Welcome to Embark": "Welcome to Embark", + "dashboard start": "dashboard start", + "loaded plugins": "loaded plugins", + "loading solc compiler": "loading solc compiler", + "compiling solidity contracts": "compiling solidity contracts", + "%s doesn't have a compatible contract compiler. Maybe a plugin exists for it.": "%s doesn't have a compatible contract compiler. Maybe a plugin exists for it.", + "assuming %s to be an interface": "assuming %s to be an interface", + "{{className}}: couldn't find instanceOf contract {{parentContractName}}": "{{className}}: couldn't find instanceOf contract {{parentContractName}}", + "did you mean \"%s\"?": "did you mean \"%s\"?", + "%s has no code associated": "%s has no code associated", + "deploying contracts": "deploying contracts", + " already deployed at ": " already deployed at ", + "Pending": "Pending", + "Interface or set to not deploy": "Interface or set to not deploy", + "Deployed": "Deployed", + "Address": "Address", + "running beforeDeploy plugin %s .": "running beforeDeploy plugin %s .", + "deploying": "deploying", + "with": "with", + "gas": "gas", + "error deploying": "error deploying", + "due to error": "due to error", + "error deploying contracts": "error deploying contracts", + "finished deploying contracts": "finished deploying contracts", + "error running afterDeploy: ": "error running afterDeploy: ", + "ready to watch file changes": "ready to watch file changes", + "Starting Server": "Starting Server", + "webserver available at": "webserver available at", + "Webserver": "Webserver", + "versions": "versions", + "possible commands are:": "possible commands are:", + "display versions in use for libraries and tools like web3 and solc": "display versions in use for libraries and tools like web3 and solc", + "instantiated web3.js object configured to the current environment": "instantiated web3.js object configured to the current environment", + "to immediatly exit (alias: exit)": "to immediatly exit (alias: exit)", + "The web3 object and the interfaces for the deployed contracts and their methods are also available": "The web3 object and the interfaces for the deployed contracts and their methods are also available", + "versions in use": "versions in use" } \ No newline at end of file diff --git a/locales/pt.json b/locales/pt.json index 200b234f8..f243617e8 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -69,5 +69,122 @@ "webserver available at": "servidor web disponivel em", "Webserver": "Servidor Web", " already deployed at ": " already deployed at ", - "Deployed": "Deployed" -} \ No newline at end of file + "Deployed": "Deployed", + "Name must be only letters, spaces, or dashes": "Name must be only letters, spaces, or dashes", + "Name your app (default is %s)": "Name your app (default is %s)", + "Invalid name": "Invalid name", + "unknown command": "unknown command", + "did you mean": "did you mean", + "warning: running default config on a non-development environment": "warning: running default config on a non-development environment", + "could not find {{geth_bin}} command; is {{client_name}} installed or in the PATH?": "could not find {{geth_bin}} command; is {{client_name}} installed or in the PATH?", + "no accounts found": "no accounts found", + "initializing genesis block": "initializing genesis block", + "rpcCorsDomain set to *": "rpcCorsDomain set to *", + "make sure you know what you are doing": "make sure you know what you are doing", + "warning: cors is not set": "warning: cors is not set", + "wsOrigins set to *": "wsOrigins set to *", + "warning: wsOrigins is not set": "warning: wsOrigins is not set", + "reset done!": "reset done!", + "%s is not installed on your machine": "%s is not installed on your machine", + "You can install it by running: %s": "You can install it by running: %s", + "Initializing Embark Template....": "Initializing Embark Template....", + "Installing packages...": "Installing packages...", + "Init complete": "Init complete", + "App ready at ": "App ready at ", + "Next steps:": "Next steps:", + "open another console in the same directory and run": "open another console in the same directory and run", + "For more info go to http://embark.status.im": "For more info go to http://embark.status.im", + "%s : instanceOf is set to itself": "%s : instanceOf is set to itself", + "{{className}} has code associated to it but it's configured as an instanceOf {{parentContractName}}": "{{className}} has code associated to it but it's configured as an instanceOf {{parentContractName}}", + "Error Compiling/Building contracts: ": "Error Compiling/Building contracts: ", + "Error: ": "Error: ", + "there are two or more contracts that depend on each other in a cyclic manner": "there are two or more contracts that depend on each other in a cyclic manner", + "Embark couldn't determine which one to deploy first": "Embark couldn't determine which one to deploy first", + "{{inputName}} has not been defined for {{className}} constructor": "{{inputName}} has not been defined for {{className}} constructor", + "error deploying %s": "error deploying %s", + "executing onDeploy commands": "executing onDeploy commands", + "error executing onDeploy for ": "error executing onDeploy for ", + " does not exist": " does not exist", + "error running onDeploy: ": "error running onDeploy: ", + " exists but has been set to not deploy": " exists but has been set to not deploy", + "couldn't find a valid address for %s has it been deployed?": "couldn't find a valid address for %s has it been deployed?", + "executing: ": "executing: ", + "the transaction was rejected; this usually happens due to a throw or a require": "the transaction was rejected; this usually happens due to a throw or a require", + "no account found at index": "no account found at index", + " check the config": " check the config", + "Both \"from\" and \"fromIndex\" are defined for contract": "Both \"from\" and \"fromIndex\" are defined for contract", + "Using \"from\" as deployer account.": "Using \"from\" as deployer account.", + "{{linkReference}} is too long": "{{linkReference}} is too long", + "{{contractName}} needs {{libraryName}} but an address was not found, did you deploy it or configured an address?": "{{contractName}} needs {{libraryName}} but an address was not found, did you deploy it or configured an address?", + "attempted to deploy %s without specifying parameters": "attempted to deploy %s without specifying parameters", + "deployed at": "deployed at", + "no contracts found": "no contracts found", + "Blockchain component is disabled in the config": "Blockchain component is disabled in the config", + "Couldn't connect to an Ethereum node are you sure it's on?": "Couldn't connect to an Ethereum node are you sure it's on?", + "make sure you have an Ethereum node or simulator running. e.g '%s'": "make sure you have an Ethereum node or simulator running. e.g '%s'", + "executing": "executing", + "the transaction was rejected; this usually happens due to a throw or a require, it can also happen due to an invalid operation": "the transaction was rejected; this usually happens due to a throw or a require, it can also happen due to an invalid operation", + "Cannot find file %s Please ensure you are running this command inside the Dapp folder": "Cannot find file %s Please ensure you are running this command inside the Dapp folder", + "no config file found at %s using default config": "no config file found at %s using default config", + "HTTP contract file not found": "HTTP contract file not found", + "contract file not found": "contract file not found", + "file not found, creating it...": "file not found, creating it...", + "No Blockchain node found": "No Blockchain node found", + "Ethereum node (version unknown)": "Ethereum node (version unknown)", + "this event is deprecated and will be removed in future versions %s": "this event is deprecated and will be removed in future versions %s", + "Error while downloading the file": "Error while downloading the file", + "Plugin {{name}} can only be loaded in the context of \"{{contextes}}\"": "Plugin {{name}} can only be loaded in the context of \"{{contextes}}\"", + "error running service check": "error running service check", + "help": "help", + "quit": "quit", + "Type": "Type", + "to see the list of available commands": "to see the list of available commands", + "Asset Pipeline": "Asset Pipeline", + "Ethereum node detected": "Ethereum node detected", + "Deployment Done": "Deployment Done", + "Looking for documentation? You can find it at": "Looking for documentation? You can find it at", + "Ready": "Ready", + "tip: you can resize the terminal or disable the dashboard with": "tip: you can resize the terminal or disable the dashboard with", + "finished building": "finished building", + "Done": "Done", + "Cannot upload: {{platform}} node is not running on {{url}}.": "Cannot upload: {{platform}} node is not running on {{url}}.", + "try \"{{ipfs}}\" or \"{{swarm}}\"": "try \"{{ipfs}}\" or \"{{swarm}}\"", + "finished deploying": "finished deploying", + "finished building DApp and deploying to": "finished building DApp and deploying to", + "IPFS node detected": "IPFS node detected", + "IPFS node is offline": "IPFS node is offline", + "not found or not in the path. Guessing %s for path": "not found or not in the path. Guessing %s for path", + "adding %s to ipfs": "adding %s to ipfs", + "DApp available at": "DApp available at", + "error uploading to ipfs": "error uploading to ipfs", + "successfully uploaded to ipfs": "successfully uploaded to ipfs", + "Error while loading the content of ": "Error while loading the content of ", + "error compiling for unknown reasons": "error compiling for unknown reasons", + "error compiling. There are sources available but no code could be compiled, likely due to fatal errors in the solidity code": "error compiling. There are sources available but no code could be compiled, likely due to fatal errors in the solidity code", + "Swarm node detected...": "Swarm node detected...", + "Swarm node is offline...": "Swarm node is offline...", + "deploying to swarm!": "deploying to swarm!", + "adding %s to swarm": "adding %s to swarm", + "error uploading to swarm": "error uploading to swarm", + "successfully uploaded to swarm": "successfully uploaded to swarm", + "Vyper exited with error code ": "Vyper exited with error code ", + "Execution returned no result": "Execution returned no result", + "compiling Vyper contracts": "compiling Vyper contracts", + "Webserver is offline": "Webserver is offline", + "stopping webserver": "stopping webserver", + "a webserver is already running at": "a webserver is already running at", + "no webserver is currently running": "no webserver is currently running", + "couldn't find file": "couldn't find file", + "errors found while generating": "errors found while generating", + "writing file": "writing file", + "Simulator not found; Please install it with \"%s\"": "Simulator not found; Please install it with \"%s\"", + "Tried to load testrpc but an error occurred. This is a problem with testrpc": "Tried to load testrpc but an error occurred. This is a problem with testrpc", + "IMPORTANT: if you using a NodeJS version older than 6.9.1 then you need to install an older version of testrpc \"%s\". Alternatively install node 6.9.1 and the testrpc 3.0": "IMPORTANT: if you using a NodeJS version older than 6.9.1 then you need to install an older version of testrpc \"%s\". Alternatively install node 6.9.1 and the testrpc 3.0", + "terminating due to error": "terminating due to error", + "There a a space in the version of {{versionKey}}. We corrected it for you ({{correction})": "There a a space in the version of {{versionKey}}. We corrected it for you ({{correction})", + "versions": "versions", + "versions in use": "versions in use", + "downloading {{packageName}} {{version}}....": "downloading {{packageName}} {{version}}...." + + +} From 22edfac26ffbe2af29e074fbd30753adae9df796 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 9 May 2018 12:13:22 -0400 Subject: [PATCH 3/8] update more keys --- locales/pt.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locales/pt.json b/locales/pt.json index f243617e8..2ddf7e365 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -69,7 +69,7 @@ "webserver available at": "servidor web disponivel em", "Webserver": "Servidor Web", " already deployed at ": " already deployed at ", - "Deployed": "Deployed", + "Deployed": "Publicado", "Name must be only letters, spaces, or dashes": "Name must be only letters, spaces, or dashes", "Name your app (default is %s)": "Name your app (default is %s)", "Invalid name": "Invalid name", @@ -135,14 +135,14 @@ "Error while downloading the file": "Error while downloading the file", "Plugin {{name}} can only be loaded in the context of \"{{contextes}}\"": "Plugin {{name}} can only be loaded in the context of \"{{contextes}}\"", "error running service check": "error running service check", - "help": "help", - "quit": "quit", + "help": "ajuda", + "quit": "sair", "Type": "Type", "to see the list of available commands": "to see the list of available commands", "Asset Pipeline": "Asset Pipeline", "Ethereum node detected": "Ethereum node detected", "Deployment Done": "Deployment Done", - "Looking for documentation? You can find it at": "Looking for documentation? You can find it at", + "Looking for documentation? You can find it at": "A procura de Documentacao? pode encontra-la em", "Ready": "Ready", "tip: you can resize the terminal or disable the dashboard with": "tip: you can resize the terminal or disable the dashboard with", "finished building": "finished building", @@ -176,7 +176,7 @@ "no webserver is currently running": "no webserver is currently running", "couldn't find file": "couldn't find file", "errors found while generating": "errors found while generating", - "writing file": "writing file", + "writing file": "escrevendo ficheiro", "Simulator not found; Please install it with \"%s\"": "Simulator not found; Please install it with \"%s\"", "Tried to load testrpc but an error occurred. This is a problem with testrpc": "Tried to load testrpc but an error occurred. This is a problem with testrpc", "IMPORTANT: if you using a NodeJS version older than 6.9.1 then you need to install an older version of testrpc \"%s\". Alternatively install node 6.9.1 and the testrpc 3.0": "IMPORTANT: if you using a NodeJS version older than 6.9.1 then you need to install an older version of testrpc \"%s\". Alternatively install node 6.9.1 and the testrpc 3.0", From 51fab56fc57d7c9024d738b535a504bb9976468d Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 9 May 2018 17:52:49 -0400 Subject: [PATCH 4/8] update keys --- locales/pt.json | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/locales/pt.json b/locales/pt.json index 2ddf7e365..dd0143d83 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -3,7 +3,7 @@ "Contract Name": "Contracto", "Address": "Endereço", "Status": "Estado", - "Embark Blockchain Using: %s": "Embark Blockchain esta usando o commando: %s", + "Embark Blockchain Using: %s": "Embark Blockchain esta usando o commando: %s", "running: %s": "executando: %s", "already initialized": "ja esta inicializado", "create a barebones project meant only for contract development": "criar um projeto vazio destinado apenas ao desenvolvimento de contratos", @@ -68,27 +68,27 @@ "Starting Server": "iniciando o servidor", "webserver available at": "servidor web disponivel em", "Webserver": "Servidor Web", - " already deployed at ": " already deployed at ", + " already deployed at ": " já publicado em ", "Deployed": "Publicado", - "Name must be only letters, spaces, or dashes": "Name must be only letters, spaces, or dashes", - "Name your app (default is %s)": "Name your app (default is %s)", - "Invalid name": "Invalid name", - "unknown command": "unknown command", - "did you mean": "did you mean", - "warning: running default config on a non-development environment": "warning: running default config on a non-development environment", - "could not find {{geth_bin}} command; is {{client_name}} installed or in the PATH?": "could not find {{geth_bin}} command; is {{client_name}} installed or in the PATH?", - "no accounts found": "no accounts found", - "initializing genesis block": "initializing genesis block", - "rpcCorsDomain set to *": "rpcCorsDomain set to *", - "make sure you know what you are doing": "make sure you know what you are doing", - "warning: cors is not set": "warning: cors is not set", - "wsOrigins set to *": "wsOrigins set to *", - "warning: wsOrigins is not set": "warning: wsOrigins is not set", - "reset done!": "reset done!", - "%s is not installed on your machine": "%s is not installed on your machine", - "You can install it by running: %s": "You can install it by running: %s", - "Initializing Embark Template....": "Initializing Embark Template....", - "Installing packages...": "Installing packages...", + "Name must be only letters, spaces, or dashes": "O nome deve ser apenas letras, espaços ou traços", + "Name your app (default is %s)": "Nome da aplicacao (predefinido is %s)", + "Invalid name": "Nome inválido", + "unknown command": "comando desconhecido", + "did you mean": "você quis dizer", + "warning: running default config on a non-development environment": "aviso: executando a configuração padrão em um ambiente de não desenvolvimento", + "could not find {{geth_bin}} command; is {{client_name}} installed or in the PATH?": "não foi possível encontrar o comando {{geth_bin}}; o {{client_name}} instalado ou no PATH?", + "no accounts found": "nenhuma conta encontrada", + "initializing genesis block": "inicializando o bloco de gênese", + "rpcCorsDomain set to *": "rpcCorsDomain definido como *", + "make sure you know what you are doing": "certifique-se de saber o que está fazendo", + "warning: cors is not set": "aviso: cors não está definido", + "wsOrigins set to *": "wsOrigins definido como *", + "warning: wsOrigins is not set": "aviso: wsOrigins não está definido", + "reset done!": "reset feito!", + "%s is not installed on your machine": "%s não está instalado na sua máquina", + "You can install it by running: %s": "Você pode instalá-lo executando: %s", + "Initializing Embark Template....": "Inicializando Embark Template....", + "Installing packages...": "Instalando pacotes...", "Init complete": "Init complete", "App ready at ": "App ready at ", "Next steps:": "Next steps:", @@ -185,6 +185,4 @@ "versions": "versions", "versions in use": "versions in use", "downloading {{packageName}} {{version}}....": "downloading {{packageName}} {{version}}...." - - } From 517a3bf2346eeec02e96216748e5c81f1678ff28 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 9 May 2018 18:43:09 -0400 Subject: [PATCH 5/8] move i18n and locales to its own folder; abstract it a bit; detect at initialization; add cmd line option --- .gitignore | 1 + lib/cmd.js | 14 +- lib/i18n/i18n.js | 42 ++++ {locales => lib/i18n/locales}/en.json | 8 +- {locales => lib/i18n/locales}/pt.json | 0 package-lock.json | 264 +++++++++++++------------- package.json | 1 + 7 files changed, 186 insertions(+), 144 deletions(-) create mode 100644 lib/i18n/i18n.js rename {locales => lib/i18n/locales}/en.json (93%) rename {locales => lib/i18n/locales}/pt.json (100%) diff --git a/.gitignore b/.gitignore index a0723c4bb..8af777e1d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ test_apps/contracts_app/chains.json .embark/ NOTES npm-debug.log +.tern-port diff --git a/lib/cmd.js b/lib/cmd.js index 1fe90f2a8..7cbac225f 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -2,18 +2,9 @@ const program = require('commander'); const promptly = require('promptly'); const utils = require('./utils/utils.js'); const Embark = require('../lib/index'); -const i18n = require('i18n'); +const i18n = require('./i18n/i18n.js'); let embark = new Embark; -i18n.configure({ - locales: ['en', 'pt'], - register: global, - //updateFiles: false, - directory: utils.joinPath(__dirname, '/../locales') -}); - -i18n.setLocale('pt'); - class Cmd { constructor() { program.version(embark.version); @@ -118,8 +109,10 @@ class Cmd { .option('--no-color', __('no colors in case it\'s needed for compatbility purposes')) .option('--logfile [logfile]', __('filename to output logs (default: %s)', 'none')) .option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') + .option('--locale [locale]', __('language to use (default: en)')) .description(__('run dapp (default: %s)', 'development')) .action(function (env, options) { + i18n.setOrDetectLocale(options.locale); embark.run({ env: env || 'development', serverPort: options.port, @@ -251,7 +244,6 @@ class Cmd { process.exit(0); }); } - } diff --git a/lib/i18n/i18n.js b/lib/i18n/i18n.js new file mode 100644 index 000000000..dac60f0e5 --- /dev/null +++ b/lib/i18n/i18n.js @@ -0,0 +1,42 @@ +const i18n = require('i18n'); +const osLocale = require('os-locale'); +const path = require('path'); + +const supported_languages = ['en', 'pt']; + +i18n.configure({ + locales: supported_languages, + register: global, + //updateFiles: false, + directory: path.join(__dirname, 'locales') +}); + +function isSupported(locale) { + return (supported_languages.indexOf(locale.substr(0, 2)) >= 0); +} + +function setLocale(locale) { + i18n.setLocale(locale.substr(0, 2)); +} + +function setDefaultLocale() { + osLocale().then(setLocale).catch(); +} + +function setOrDetectLocale(locale) { + if (locale && !isSupported(locale)) { + console.log("===== locale " + locale + " not supported ====="); + } + if (locale) { + return i18n.setLocale(locale.substr(0, 2)); + } + setDefaultLocale(); +} + +setDefaultLocale(); + +module.exports = { + i18n: i18n, + setOrDetectLocale: setOrDetectLocale +}; + diff --git a/locales/en.json b/lib/i18n/locales/en.json similarity index 93% rename from locales/en.json rename to lib/i18n/locales/en.json index 6c3743252..0ac41e9de 100644 --- a/locales/en.json +++ b/lib/i18n/locales/en.json @@ -69,5 +69,11 @@ "instantiated web3.js object configured to the current environment": "instantiated web3.js object configured to the current environment", "to immediatly exit (alias: exit)": "to immediatly exit (alias: exit)", "The web3 object and the interfaces for the deployed contracts and their methods are also available": "The web3 object and the interfaces for the deployed contracts and their methods are also available", - "versions in use": "versions in use" + "versions in use": "versions in use", + "language to use (default: en)": "language to use (default: en)", + "executing": "executing", + "writing file": "writing file", + "errors found while generating": "errors found while generating", + "Looking for documentation? You can find it at": "Looking for documentation? You can find it at", + "Ready": "Ready" } \ No newline at end of file diff --git a/locales/pt.json b/lib/i18n/locales/pt.json similarity index 100% rename from locales/pt.json rename to lib/i18n/locales/pt.json diff --git a/package-lock.json b/package-lock.json index b2cbd9a18..3c0704628 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,7 +65,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "accepts": { "version": "1.3.5", @@ -79,7 +79,7 @@ "acorn": { "version": "5.5.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha1-9HPdR+AnegjijpvsWu6wR1HwuMk=" + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==" }, "acorn-dynamic-import": { "version": "2.0.2", @@ -405,7 +405,7 @@ "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "requires": { "sprintf-js": "1.0.3" } @@ -422,7 +422,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=" + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" }, "arr-union": { "version": "3.1.0", @@ -480,7 +480,7 @@ "asn1.js": { "version": "4.10.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha1-ucK/WAXx5kqt7tbfOiv6+1pz9aA=", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "requires": { "bn.js": "4.11.8", "inherits": "2.0.3", @@ -508,7 +508,7 @@ "async": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha1-YaKau2/MAm/qd+VtHG7FOnlZUfQ=", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", "requires": { "lodash": "4.17.5" } @@ -595,7 +595,7 @@ "babel-generator": { "version": "6.26.1", "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha1-GERAjTuPDTWkBOp6wYDwh6YBvZA=", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "requires": { "babel-messages": "6.23.0", "babel-runtime": "6.26.0", @@ -745,7 +745,7 @@ "babel-loader": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.4.tgz", - "integrity": "sha1-40Y5OL1ObVXRwXTFSF1AahiO0BU=", + "integrity": "sha512-/hbyEvPzBJuGpk9o80R0ZyTej6heEOr59GoEUtn8qFKbnx4cJm9FWES6J/iv644sYgrtVw9JJQkjaLW/bqb5gw==", "requires": { "find-cache-dir": "1.0.0", "loader-utils": "1.1.0", @@ -1249,7 +1249,7 @@ "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=" + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" }, "balanced-match": { "version": "1.0.0", @@ -1259,7 +1259,7 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "requires": { "cache-base": "1.0.1", "class-utils": "0.3.6", @@ -1288,7 +1288,7 @@ "base-x": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", - "integrity": "sha1-lMF4hzbaBl7bHWiAiGnjV8l3+nc=", + "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", "requires": { "safe-buffer": "5.1.1" } @@ -1318,7 +1318,7 @@ "big.js": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha1-pfwpi4G54Nyi5FiCR4S2XFK6WI4=" + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" }, "binary-extensions": { "version": "1.11.0", @@ -1328,7 +1328,7 @@ "bindings": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", - "integrity": "sha1-s0b27PapX1qBXFg5/HzbIlAvHtc=" + "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" }, "bip66": { "version": "1.1.5", @@ -1372,7 +1372,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha1-LN4J617jQfSEdGuwMJsyU7GxRC8=" + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, "body-parser": { "version": "1.18.2", @@ -1402,7 +1402,7 @@ "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" @@ -1590,7 +1590,7 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "requires": { "collection-visit": "1.0.0", "component-emitter": "1.2.1", @@ -1811,7 +1811,7 @@ "cids": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/cids/-/cids-0.5.3.tgz", - "integrity": "sha1-miW2l+t2+vgHr87DXEq5Nu370KQ=", + "integrity": "sha512-ujWbNP8SeLKg5KmGrxYZM4c+ttd+wwvegrdtgmbi2KNFUbQN4pqsGZaGQE3rhjayXTbKFq36bYDbKhsnD0eMsg==", "requires": { "multibase": "0.4.0", "multicodec": "0.2.6", @@ -1821,7 +1821,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "requires": { "inherits": "2.0.3", "safe-buffer": "5.1.1" @@ -1836,7 +1836,7 @@ "clap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/clap/-/clap-1.2.3.tgz", - "integrity": "sha1-TzZ0WzIAhJJVf0ZBLWbVDLmbzlE=", + "integrity": "sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA==", "requires": { "chalk": "1.1.3" } @@ -1844,7 +1844,7 @@ "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "requires": { "arr-union": "3.1.0", "define-property": "0.2.5", @@ -1994,7 +1994,7 @@ "color-convert": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha1-wSYRB66y8pTr/+ye2eytUppgl+0=", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "requires": { "color-name": "1.1.3" } @@ -2196,7 +2196,7 @@ "crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha1-OWz58xN/A+S45TLFj2mCVOAPgOw=", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "requires": { "browserify-cipher": "1.0.0", "browserify-sign": "4.0.4", @@ -2360,7 +2360,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" } @@ -2489,7 +2489,7 @@ "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha1-1Flono1lS6d+AqgX+HENcCyxbp0=", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "requires": { "is-descriptor": "1.0.2", "isobject": "3.0.1" @@ -2694,7 +2694,7 @@ "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha1-7SljTRm6ukY7bOa4CjchPqtx7EM=", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "requires": { "once": "1.4.0" } @@ -2804,7 +2804,7 @@ "escodegen": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", - "integrity": "sha1-264X75bI5L7bE1b0UE+kzC98t+I=", + "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", "requires": { "esprima": "3.1.3", "estraverse": "4.2.0", @@ -2821,7 +2821,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "optional": true } } @@ -3014,7 +3014,7 @@ "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha1-AHo7n9vCs7uH5IeeoZyS/b05Qs8=", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "requires": { "estraverse": "4.2.0" } @@ -3047,7 +3047,7 @@ "ethereumjs-testrpc": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/ethereumjs-testrpc/-/ethereumjs-testrpc-6.0.3.tgz", - "integrity": "sha1-eguHvzZw+S9gf5j6aniAHZdBsSQ=", + "integrity": "sha512-lAxxsxDKK69Wuwqym2K49VpXtBvLEsXr1sryNG4AkvL5DomMdeCBbu3D87UEevKenLHBiT8GTjARwN6Yj039gA==", "requires": { "webpack": "3.11.0" }, @@ -3140,7 +3140,7 @@ "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha1-f8vbGY3HGVlDLv4ThCaE4FJaywI=", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "requires": { "md5.js": "1.3.4", "safe-buffer": "5.1.1" @@ -3250,7 +3250,7 @@ "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { "is-plain-object": "2.0.4" } @@ -3380,7 +3380,7 @@ "file-loader": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", - "integrity": "sha1-b+iGRJsPKpNuQ8q6rAzb+zaVBvg=", + "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==", "requires": { "loader-utils": "1.1.0", "schema-utils": "0.4.5" @@ -3498,7 +3498,7 @@ "follow-redirects": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", - "integrity": "sha1-2BIPRRgZD1Wqxlu2/HuF/NZm1qo=", + "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", "requires": { "debug": "3.1.0" }, @@ -3506,7 +3506,7 @@ "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "requires": { "ms": "2.0.0" } @@ -4094,7 +4094,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", @@ -4153,7 +4153,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -4206,7 +4206,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=" + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" }, "globby": { "version": "5.0.0", @@ -4533,7 +4533,7 @@ "grunt-mocha-test": { "version": "0.13.3", "resolved": "https://registry.npmjs.org/grunt-mocha-test/-/grunt-mocha-test-0.13.3.tgz", - "integrity": "sha1-kChHK2Fb2m3eqnswpaFk6YBd4AU=", + "integrity": "sha512-zQGEsi3d+ViPPi7/4jcj78afKKAKiAA5n61pknQYi25Ugik+aNOuRmiOkmb8mN2CeG8YxT+YdT1H1Q7B/eNkoQ==", "dev": true, "requires": { "hooker": "0.2.3", @@ -4688,7 +4688,7 @@ "hash.js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha1-NA3tvmKQGHFRweodd3o0SJNd+EY=", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "requires": { "inherits": "2.0.3", "minimalistic-assert": "1.0.0" @@ -4749,7 +4749,7 @@ "hosted-git-info": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha1-IyNbKasjDFdqqw1PE/wEawsDgiI=" + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==" }, "html-comment-regex": { "version": "1.1.1", @@ -4815,7 +4815,7 @@ "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha1-90aPYBNfXl2tM5nAqBvpoWA6CCs=" + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, "icss-replace-symbols": { "version": "1.1.0", @@ -4833,7 +4833,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { "color-convert": "1.9.1" } @@ -4866,7 +4866,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "supports-color": { "version": "5.3.0", @@ -5036,7 +5036,7 @@ "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "requires": { "loose-envify": "1.3.1" } @@ -5059,7 +5059,7 @@ "ipfs-api": { "version": "17.2.4", "resolved": "https://registry.npmjs.org/ipfs-api/-/ipfs-api-17.2.4.tgz", - "integrity": "sha1-gTCl+pjhWyr49qJ7cUQs66/ImyQ=", + "integrity": "sha512-GFNy3Cj7EkzCrdyaQpvctHmtwtghzIDPTtW6XTqj+vybSwk2swyEMKaMHimqi8c8N+5+x5wfLpeUyRUhcZ9lDA==", "requires": { "async": "2.6.0", "bs58": "4.0.1", @@ -5096,7 +5096,7 @@ "ipfs-block": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/ipfs-block/-/ipfs-block-0.6.1.tgz", - "integrity": "sha1-uTBT6eqV917SkHgX/79V2ZKgatE=", + "integrity": "sha512-28dgGsb2YsYnFs+To4cVBX8e/lTCb8eWDzGhN5csj3a/sHMOYrHeK8+Ez0IV67CI3lqKGuG/ZD01Cmd6JUvKrQ==", "requires": { "cids": "0.5.3" } @@ -5113,7 +5113,7 @@ "ipfs-unixfs": { "version": "0.1.14", "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-0.1.14.tgz", - "integrity": "sha1-JWQ3/PZC2KtGtRhVguxPIekI7zc=", + "integrity": "sha512-s1tEnwKhdd17MmyC/EUMNVMDYzKhCiHDI11TF8tSBeWkEQp+0WUxkYuqvz0R5TSi2lNDJ/oVnEmwWhki2spUiQ==", "requires": { "protons": "1.0.1" } @@ -5121,7 +5121,7 @@ "ipld-dag-pb": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.11.4.tgz", - "integrity": "sha1-sPrlaB+tVpcTLjJdbC/xe18Mtqg=", + "integrity": "sha512-A514Bt4z44bxhPQVzmBFMJsV3res92eBaDX0snzVsLLasBPNh4Z7He8N2mwSeAX9bJNywRBlJbHMQPwC45rqXw==", "requires": { "async": "2.6.0", "bs58": "4.0.1", @@ -5173,7 +5173,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-builtin-module": { "version": "1.0.0", @@ -5279,7 +5279,7 @@ "is-ipfs": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-ipfs/-/is-ipfs-0.3.2.tgz", - "integrity": "sha1-xGULg442/QFR3liWsv8xn+iTYYI=", + "integrity": "sha512-82V1j4LMkYy7H4seQQzOWqo7FiW3I64/1/ryo3dhtWKfOvm7ZolLMRQQfGKs4OXWauh5rAkPnamVcRISHwhmpQ==", "requires": { "bs58": "4.0.1", "cids": "0.5.3", @@ -5308,7 +5308,7 @@ "is-odd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha1-dkZiRnH9fqVYzNmieVGC8pWPGyQ=", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", "requires": { "is-number": "4.0.0" }, @@ -5316,7 +5316,7 @@ "is-number": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha1-ACbjf1RU1z41bf5lZGmYZ8an8P8=" + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" } } }, @@ -5352,7 +5352,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "requires": { "isobject": "3.0.1" }, @@ -5423,7 +5423,7 @@ "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=" + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" }, "isarray": { "version": "1.0.0", @@ -5461,12 +5461,12 @@ "js-base64": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz", - "integrity": "sha1-LlRewrDylX9BNWUQIFIU6Y+tZYI=" + "integrity": "sha512-H7ErYLM34CvDMto3GbD6xD0JLUGYXR3QTcH6B/tr4Hi/QpSThnCsIp+Sy5FRTw3B0d6py4HcNkW7nO/wdtGWEw==" }, "js-sha3": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.7.0.tgz", - "integrity": "sha1-ClxXs295iCVzsthAUfi7hd0b1jo=" + "integrity": "sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==" }, "js-tokens": { "version": "3.0.2", @@ -5629,7 +5629,7 @@ "libp2p-crypto": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.12.1.tgz", - "integrity": "sha1-SocNJpujFQ3+AU5PmuoeVQdgFcg=", + "integrity": "sha512-1/z8rxZ0DcQNreZhEsl7PnLr7DWOioSvYbKBLGkRwNRiNh1JJLgh0PdTySBb44wkrOGT+TxcGRd7iq3/X6Wxwg==", "requires": { "asn1.js": "5.0.0", "async": "2.6.0", @@ -5649,7 +5649,7 @@ "asn1.js": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.0.0.tgz", - "integrity": "sha1-Kwq7x/pm3Aqt0GpGg8c2CMMrBpY=", + "integrity": "sha512-Y+FKviD0uyIWWo/xE0XkUl0x1allKFhzEVJ+//2Dgqpy+n+B77MlPNqvyk7Vx50M9XyVzjnRhDqJAEAsyivlbA==", "requires": { "bn.js": "4.11.8", "inherits": "2.0.3", @@ -5988,7 +5988,7 @@ "logplease": { "version": "1.2.14", "resolved": "https://registry.npmjs.org/logplease/-/logplease-1.2.14.tgz", - "integrity": "sha1-5QndTEVcGu190QWhdpTapbmsV58=" + "integrity": "sha512-n6bf1Ce0zvcmuyOzDi2xxLix6F1D/Niz7Qa4K3BmkjyaXcovzEjwZKUYsV+0F2Uv4rlXm5cToIEB+ynqSRdwGw==" }, "lolex": { "version": "2.3.2", @@ -6054,7 +6054,7 @@ "make-dir": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", - "integrity": "sha1-bWpJ7q1KrilsU7vzoaAIvWyJRps=", + "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", "requires": { "pify": "3.0.0" } @@ -6366,7 +6366,7 @@ "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha1-8IA1HIZbDcViqEYpZtqlNUPHik0=", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "requires": { "bn.js": "4.11.8", "brorand": "1.1.0" @@ -6375,7 +6375,7 @@ "mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY=" + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { "version": "1.33.0", @@ -6393,7 +6393,7 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=" + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, "mimic-response": { "version": "1.0.0", @@ -6421,7 +6421,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "1.1.11" } @@ -6449,7 +6449,7 @@ "minizlib": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", - "integrity": "sha1-EeE2WM5GvDpwomeqxYNZ0eDCnOs=", + "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "requires": { "minipass": "2.2.1" } @@ -6457,7 +6457,7 @@ "mixin-deep": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha1-pJ5yaNzhoNlpjkUybFYm3zVD0P4=", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "requires": { "for-in": "1.0.2", "is-extendable": "1.0.1" @@ -6466,7 +6466,7 @@ "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { "is-plain-object": "2.0.4" } @@ -6589,7 +6589,7 @@ "multibase": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.4.0.tgz", - "integrity": "sha1-G9tiyC3gEU+CKh2HUby+6RzS77o=", + "integrity": "sha512-fnYvZJWDn3eSJ7EeWvS8zbOpRwuyPHpDggSnqGXkQMvYED5NdO9nyqnZboGvAT+r/60J8KZ09tW8YJHkS22sFw==", "requires": { "base-x": "3.0.4" } @@ -6597,7 +6597,7 @@ "multicodec": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.2.6.tgz", - "integrity": "sha1-nS1lZfvAgVsTnfyQY3H8Od9N/ds=", + "integrity": "sha512-VGyRUDkxdJzWnj9x3C49MzI3+TtKKDYNfIBOaWBCNuPk6CE5CwwkL15gJtsLDfLay0fL4xTh4Af3kBbJSxSppw==", "requires": { "varint": "5.0.0" } @@ -6605,7 +6605,7 @@ "multihashes": { "version": "0.4.13", "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.13.tgz", - "integrity": "sha1-0QvXG9UdJKqJTipvFFcUa7e6wSU=", + "integrity": "sha512-HwJGEKPCpLlNlgGQA56CYh/Wsqa+c4JAq8+mheIgw7OK5T4QvNJqgp6TH8gZ4q4l1aiWeNat/H/MrFXmTuoFfQ==", "requires": { "bs58": "4.0.1", "varint": "5.0.0" @@ -6614,7 +6614,7 @@ "multihashing-async": { "version": "0.4.8", "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", - "integrity": "sha1-QVcrJaj8aOsxi4ViQJ/dchpyfqE=", + "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", "requires": { "async": "2.6.0", "blakejs": "1.1.0", @@ -6662,7 +6662,7 @@ "nanomatch": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha1-h59xUMstq3pHElkGbBBO7m4Pp8I=", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", "requires": { "arr-diff": "4.0.0", "array-unique": "0.3.2", @@ -6840,7 +6840,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "requires": { "hosted-git-info": "2.6.0", "is-builtin-module": "1.0.0", @@ -6972,7 +6972,7 @@ "object-inspect": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.4.1.tgz", - "integrity": "sha1-N/+xDnGtrzdI0F9xO0yUUvQCy8Q=" + "integrity": "sha512-wqdhLpfCUbEsoEwl3FXwGyv8ief1k/1aUdIPCqVnupM6e8l63BEJdiF/0swtn04/8p05tG/T0FrpTlfwvljOdw==" }, "object-keys": { "version": "1.0.11", @@ -7136,7 +7136,7 @@ "orbit-db-cache": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/orbit-db-cache/-/orbit-db-cache-0.0.7.tgz", - "integrity": "sha1-VbxNHniZujWkuGFPPHVax9owkFo=", + "integrity": "sha512-bvIimrujda1di1p0R2I0MY3VmnSz2y8l7Bc4Qvp/jsJpf5jxTIvfC97pGpO6Fm3kUGGZDhKNjY/ZW3VfXoBRFw==", "requires": { "fs-pull-blob-store": "0.4.1", "idb-pull-blob-store": "0.5.1", @@ -7240,7 +7240,7 @@ "p-limit": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", - "integrity": "sha1-DpK2vty1nwIsE9DxlJ3ILRWQnxw=", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", "requires": { "p-try": "1.0.0" } @@ -7415,7 +7415,7 @@ "peer-info": { "version": "0.11.6", "resolved": "https://registry.npmjs.org/peer-info/-/peer-info-0.11.6.tgz", - "integrity": "sha1-BICwAw0t+P1PCYebJppxWyvSuhI=", + "integrity": "sha512-xrVNiAF1IhVJNGEg5P2UQN+subaEkszT8YkC3zdy06MK0vTH3cMHB+HH+ZURkoSLssc3HbK58ecXeKpQ/4zq5w==", "requires": { "lodash.uniqby": "4.7.0", "multiaddr": "3.0.2", @@ -7498,7 +7498,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", "requires": { "chalk": "1.1.3", "js-base64": "2.4.3", @@ -7682,7 +7682,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { "color-convert": "1.9.1" } @@ -7715,7 +7715,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "supports-color": { "version": "5.3.0", @@ -7739,7 +7739,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { "color-convert": "1.9.1" } @@ -7772,7 +7772,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "supports-color": { "version": "5.3.0", @@ -7796,7 +7796,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { "color-convert": "1.9.1" } @@ -7829,7 +7829,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "supports-color": { "version": "5.3.0", @@ -7853,7 +7853,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { "color-convert": "1.9.1" } @@ -7886,7 +7886,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "supports-color": { "version": "5.3.0", @@ -8018,7 +8018,7 @@ "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha1-I4Hts2ifelPWUxkAYPz4ItLzaP8=" + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "process": { "version": "0.11.10", @@ -8028,7 +8028,7 @@ "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha1-o31zL0JxtKsa0HDTVQjoKQeI/6o=" + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "progress": { "version": "2.0.0", @@ -8047,7 +8047,7 @@ "promisify-es6": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/promisify-es6/-/promisify-es6-1.0.3.tgz", - "integrity": "sha1-sBJmjE3zyWXOE9qsKzpNFyapY0Y=" + "integrity": "sha512-N9iVG+CGJsI4b4ZGazjwLnxErD2d9Pe4DPvvXSxYA9tFNu8ymXME4Qs5HIQ0LMJpNM7zj+m0NlNnNeqFpKzqnA==" }, "promptly": { "version": "2.2.0", @@ -8081,12 +8081,12 @@ "protocol-buffers-schema": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.3.2.tgz", - "integrity": "sha1-AENPYItOjfVMWeBw7+78N/tLuFk=" + "integrity": "sha512-Xdayp8sB/mU+sUV4G7ws8xtYMGdQnxbeIfLjyO9TZZRJdztBGhlmbI5x1qcY4TG5hBkIKGnc28i7nXxaugu88w==" }, "protons": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/protons/-/protons-1.0.1.tgz", - "integrity": "sha1-HBBxRMB/wtHLi2y3ZFHmqTgjdnY=", + "integrity": "sha512-+0ZKnfVs+4c43tbAQ5j0Mck8wPcLnlxUYzKQoB4iDW4ocdXGnN4P+0dDbgX1FTpoY9+7P2Tn2scJyHHqj+S/lQ==", "requires": { "protocol-buffers-schema": "3.3.2", "safe-buffer": "5.1.1", @@ -8203,7 +8203,7 @@ "pump": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha1-Xf6DEcM7v2/BgmH580cCxHwIqVQ=", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", "requires": { "end-of-stream": "1.4.1", "once": "1.4.0" @@ -8304,7 +8304,7 @@ "randombytes": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha1-0wLFIpSFiISKjTAMkytEwkIx2oA=", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "requires": { "safe-buffer": "5.1.1" } @@ -8312,7 +8312,7 @@ "randomfill": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha1-ySGW/IarQr6YPxvzF3giSTHWFFg=", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "requires": { "randombytes": "2.0.6", "safe-buffer": "5.1.1" @@ -8436,17 +8436,17 @@ "regenerate": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", - "integrity": "sha1-DDNtOYBVPXVcObWGrjsgqknIK38=" + "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==" }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" }, "regenerator-transform": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha1-HkmWg3Ix2ot/PPQRTXG1aRoGgN0=", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", @@ -8456,7 +8456,7 @@ "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "requires": { "is-equal-shallow": "0.1.3" @@ -8465,7 +8465,7 @@ "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "requires": { "extend-shallow": "3.0.2", "safe-regex": "1.1.0" @@ -8610,7 +8610,7 @@ "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=" + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" }, "right-align": { "version": "0.1.3", @@ -8623,7 +8623,7 @@ "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "requires": { "glob": "7.1.2" } @@ -8723,7 +8723,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=" + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "scandirectory": { "version": "2.5.0", @@ -8738,7 +8738,7 @@ "schema-utils": { "version": "0.4.5", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz", - "integrity": "sha1-IYNvBgiqwXt4+ePiTa/xSlyhOj4=", + "integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==", "requires": { "ajv": "6.2.1", "ajv-keywords": "3.1.0" @@ -8772,7 +8772,7 @@ "secp256k1": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.5.0.tgz", - "integrity": "sha1-Z307io4E4aX6OBoa5DfFQge3ONA=", + "integrity": "sha512-e5QIJl8W7Y4tT6LHffVcZAxJjvpgE5Owawv6/XCYPQljE9aP2NFFddQ8OYMKhdLshNu88FfL3qCN3/xYkXGRsA==", "requires": { "bindings": "1.3.0", "bip66": "1.1.5", @@ -8805,12 +8805,12 @@ "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha1-3Eu8emyp2Rbe5dQ1FvAJK1j3uKs=" + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" }, "send": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha1-bsyh4PjBVtFBWXVZhI32RzCmu8E=", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", "depd": "1.1.2", @@ -8837,7 +8837,7 @@ "serve-static": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha1-CV6Ecv1bRiN9tQzkhqQ/S4bGzsE=", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "requires": { "encodeurl": "1.0.2", "escape-html": "1.0.3", @@ -8870,7 +8870,7 @@ "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "requires": { "extend-shallow": "2.0.1", "is-extendable": "0.1.1", @@ -9029,7 +9029,7 @@ "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "requires": { "base": "0.11.2", "debug": "2.6.9", @@ -9113,7 +9113,7 @@ "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "requires": { "define-property": "1.0.0", "isobject": "3.0.1", @@ -9138,7 +9138,7 @@ "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "requires": { "kind-of": "3.2.2" } @@ -9340,7 +9340,7 @@ "source-list-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", - "integrity": "sha1-qqR0A/eyRakvvJfqCPJQ1gh+0IU=" + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==" }, "source-map": { "version": "0.5.7", @@ -9350,7 +9350,7 @@ "source-map-resolve": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha1-etD1k/IoFZjoVN+A8ZquS5LXoRo=", + "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", "requires": { "atob": "2.0.3", "decode-uri-component": "0.2.0", @@ -9362,7 +9362,7 @@ "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha1-Aoam3ovkJkEzhZTpfM6nXwosWF8=", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "requires": { "source-map": "0.5.7" } @@ -9375,7 +9375,7 @@ "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha1-BaW01xU6GVvJLDxCW2nzsqlSTII=", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "requires": { "spdx-expression-parse": "3.0.0", "spdx-license-ids": "3.0.0" @@ -9384,12 +9384,12 @@ "spdx-exceptions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha1-LHrmEFbHFKW5ubKyr30xHvXHj+k=" + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==" }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "requires": { "spdx-exceptions": "2.1.0", "spdx-license-ids": "3.0.0" @@ -9398,12 +9398,12 @@ "spdx-license-ids": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha1-enzShHDMbToc/m1miG9rxDDTrIc=" + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==" }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "requires": { "extend-shallow": "3.0.2" } @@ -9411,7 +9411,7 @@ "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "requires": { "through2": "2.0.3" } @@ -9458,7 +9458,7 @@ "static-eval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.0.tgz", - "integrity": "sha1-DoIfiSaEfe97S1DNpdVcBKmxOGQ=", + "integrity": "sha512-6flshd3F1Gwm+Ksxq463LtFd1liC77N/PX1FVVc3OzL3hAmo2fwHFbuArkcfi7s9rTNsLEhcRmXGFZhlgy40uw==", "requires": { "escodegen": "1.9.1" } @@ -9602,7 +9602,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" @@ -9693,7 +9693,7 @@ "style-loader": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.19.1.tgz", - "integrity": "sha1-WR/8gLzv4mi3fF2evAUF13Jhn4U=", + "integrity": "sha512-IRE+ijgojrygQi3rsqT0U4dd+UcPCqcVvauZpCnQrGAlEe+FUIyrK93bUDScamesjP08JlQNsFJU+KmPedP5Og==", "requires": { "loader-utils": "1.1.0", "schema-utils": "0.3.0" @@ -9868,7 +9868,7 @@ "tar": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-3.2.1.tgz", - "integrity": "sha1-mqjkHIjwnnbBZgdbxx+T1RZuYbE=", + "integrity": "sha512-ZSzds1E0IqutvMU8HxjMaU8eB7urw2fGwTq88ukDOVuUIh0656l7/P7LiVPxhO5kS4flcRJQk8USG+cghQbTUQ==", "requires": { "chownr": "1.0.1", "minipass": "2.2.1", @@ -10026,7 +10026,7 @@ "to-regex": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "requires": { "define-property": "2.0.2", "extend-shallow": "3.0.2", @@ -10085,7 +10085,7 @@ "tslib": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", - "integrity": "sha1-43qG/ajLuvI6BX9HPJ9Nxk5fwug=" + "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==" }, "tty-browserify": { "version": "0.0.0", @@ -10141,7 +10141,7 @@ "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha1-qX7nqf9CaRufeD/xvFES/j/KkIA=", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "requires": { "is-typedarray": "1.0.0" } @@ -10376,7 +10376,7 @@ "url-loader": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-0.6.2.tgz", - "integrity": "sha1-oAenEJYg6dmI0UvOZ3od7Lmpk/c=", + "integrity": "sha512-h3qf9TNn53BpuXTTcpC+UehiRrl0Cv45Yr/xWayApjw6G8Bg2dGke7rIwDQ39piciWCWrC+WiqLjOh3SUp9n0Q==", "requires": { "loader-utils": "1.1.0", "mime": "1.4.1", @@ -10425,7 +10425,7 @@ "use": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha1-FHFr8D/f79AwQK71jYtLhfOnxUQ=", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", "requires": { "kind-of": "6.0.2" }, @@ -10475,7 +10475,7 @@ "validate-npm-package-license": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha1-gWQ7y+8b3+zUYjeT3EZIlIupgzg=", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "requires": { "spdx-correct": "3.0.0", "spdx-expression-parse": "3.0.0" @@ -10514,7 +10514,7 @@ "vlq": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha1-jz5DKM9jsVQMDWfhsneDhviXWyY=" + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==" }, "vm-browserify": { "version": "0.0.4", @@ -11026,7 +11026,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "requires": { "isexe": "2.0.0" } diff --git a/package.json b/package.json index 02271d346..c2a357285 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "live-plugin-manager": "https://github.com/iurimatias/live-plugin-manager.git", "merge": "^1.2.0", "orbit-db": "^0.17.3", + "os-locale": "^2.1.0", "parse-json": "^4.0.0", "promptly": "^2.1.0", "propose": "0.0.5", From 854fa0deb08e88c80181c82ec1d6a1a35aa75d94 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 9 May 2018 18:46:38 -0400 Subject: [PATCH 6/8] add locale option to most cmds --- lib/cmd.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/cmd.js b/lib/cmd.js index 7cbac225f..8fc4b60f8 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -46,7 +46,9 @@ class Cmd { .command('new [name]') .description(__('New Application')) .option('--simple', __('create a barebones project meant only for contract development')) + .option('--locale [locale]', __('language to use (default: en)')) .action(function (name, options) { + i18n.setOrDetectLocale(options.locale); if (name === undefined) { return promptly.prompt(__("Name your app (default is %s):", 'embarkDapp'), { default: "embarkDApp", @@ -79,8 +81,10 @@ class Cmd { demo() { program .command('demo') + .option('--locale [locale]', __('language to use (default: en)')) .description(__('create a working dapp with a SimpleStorage contract')) .action(function () { + i18n.setOrDetectLocale(options.locale); embark.generateTemplate('demo', './', 'embark_demo'); }); } @@ -90,8 +94,10 @@ class Cmd { .command('build [environment]') .option('--logfile [logfile]', __('filename to output logs (default: none)')) .option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') + .option('--locale [locale]', __('language to use (default: en)')) .description(__('deploy and build dapp at ') + 'dist/ (default: development)') .action(function (env, _options) { + i18n.setOrDetectLocale(options.locale); _options.env = env || 'development'; _options.logFile = _options.logfile; // fix casing _options.logLevel = _options.loglevel; // fix casing @@ -129,8 +135,10 @@ class Cmd { program .command('blockchain [environment]') .option('-c, --client [client]', __('Use a specific ethereum client or simulator (supported: %s)', 'geth, testrpc')) + .option('--locale [locale]', __('language to use (default: en)')) .description(__('run blockchain server (default: %s)', 'development')) .action(function (env, options) { + i18n.setOrDetectLocale(options.locale); embark.initConfig(env || 'development', { embarkConfig: 'embark.json', interceptLogs: false @@ -149,8 +157,10 @@ class Cmd { .option('-a, --accounts [numAccounts]', __('number of accounts (default: %s)', '10')) .option('-e, --defaultBalanceEther [balance]', __('Amount of ether to assign each test account (default: %s)', '100')) .option('-l, --gasLimit [gasLimit]', __('custom gas limit (default: %s)', '8000000')) + .option('--locale [locale]', __('language to use (default: en)')) .action(function (env, options) { + i18n.setOrDetectLocale(options.locale); embark.initConfig(env || 'development', { embarkConfig: 'embark.json', interceptLogs: false @@ -168,8 +178,10 @@ class Cmd { test() { program .command('test [file]') + .option('--locale [locale]', __('language to use (default: en)')) .description(__('run tests')) .action(function (file) { + i18n.setOrDetectLocale(options.locale); embark.initConfig('development', { embarkConfig: 'embark.json', interceptLogs: false }); @@ -182,8 +194,10 @@ class Cmd { .command('upload [environment]') .option('--logfile [logfile]', __('filename to output logs (default: %s)', 'none')) .option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') + .option('--locale [locale]', __('language to use (default: en)')) .description(__('Upload your dapp to a decentralized storage') + ' (e.g embark upload ipfs).') .action(function (platform, env, _options) { + i18n.setOrDetectLocale(options.locale); _options.env = env || 'development'; _options.logFile = _options.logfile; // fix casing _options.logLevel = _options.loglevel; // fix casing @@ -197,8 +211,10 @@ class Cmd { .option('--skip-undeployed', __('Graph will not include undeployed contracts')) .option('--skip-functions', __('Graph will not include functions')) .option('--skip-events', __('Graph will not include events')) + .option('--locale [locale]', __('language to use (default: en)')) .description(__('generates documentation based on the smart contracts configured')) .action(function (env, options) { + i18n.setOrDetectLocale(options.locale); embark.graph({ env: env || 'development', logFile: options.logfile, @@ -212,8 +228,10 @@ class Cmd { reset() { program .command('reset') + .option('--locale [locale]', __('language to use (default: en)')) .description(__('resets embarks state on this dapp including clearing cache')) .action(function () { + i18n.setOrDetectLocale(options.locale); embark.initConfig('development', { embarkConfig: 'embark.json', interceptLogs: false }); From 2e324484d4f60260f44acee17b6b7e16435f67e6 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 10 May 2018 15:26:09 -0400 Subject: [PATCH 7/8] add missing option --- lib/cmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmd.js b/lib/cmd.js index 8fc4b60f8..79035f682 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -180,7 +180,7 @@ class Cmd { .command('test [file]') .option('--locale [locale]', __('language to use (default: en)')) .description(__('run tests')) - .action(function (file) { + .action(function (file, options) { i18n.setOrDetectLocale(options.locale); embark.initConfig('development', { embarkConfig: 'embark.json', interceptLogs: false From 4236f561478572e493fb2ca6e50fa8a8b1c841c4 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 10 May 2018 15:36:24 -0400 Subject: [PATCH 8/8] add missing option --- lib/cmd.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cmd.js b/lib/cmd.js index 79035f682..d59c3f1e8 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -83,7 +83,7 @@ class Cmd { .command('demo') .option('--locale [locale]', __('language to use (default: en)')) .description(__('create a working dapp with a SimpleStorage contract')) - .action(function () { + .action(function (options) { i18n.setOrDetectLocale(options.locale); embark.generateTemplate('demo', './', 'embark_demo'); }); @@ -97,7 +97,7 @@ class Cmd { .option('--locale [locale]', __('language to use (default: en)')) .description(__('deploy and build dapp at ') + 'dist/ (default: development)') .action(function (env, _options) { - i18n.setOrDetectLocale(options.locale); + i18n.setOrDetectLocale(_options.locale); _options.env = env || 'development'; _options.logFile = _options.logfile; // fix casing _options.logLevel = _options.loglevel; // fix casing @@ -197,7 +197,7 @@ class Cmd { .option('--locale [locale]', __('language to use (default: en)')) .description(__('Upload your dapp to a decentralized storage') + ' (e.g embark upload ipfs).') .action(function (platform, env, _options) { - i18n.setOrDetectLocale(options.locale); + i18n.setOrDetectLocale(_options.locale); _options.env = env || 'development'; _options.logFile = _options.logfile; // fix casing _options.logLevel = _options.loglevel; // fix casing @@ -230,7 +230,7 @@ class Cmd { .command('reset') .option('--locale [locale]', __('language to use (default: en)')) .description(__('resets embarks state on this dapp including clearing cache')) - .action(function () { + .action(function (options) { i18n.setOrDetectLocale(options.locale); embark.initConfig('development', { embarkConfig: 'embark.json', interceptLogs: false