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

@vocab/phrase

Package Overview
Dependencies
Maintainers
0
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vocab/phrase - npm Package Compare versions

Comparing version 0.0.0-global-key-support-20231025223328 to 0.0.0-master-20240711232538

4

dist/declarations/src/index.d.ts

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

export { pull } from './pull-translations';
export { push } from './push-translations';
export { pull } from "./pull-translations.js";
export { push } from "./push-translations.js";

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

import type { UserConfig } from '@vocab/core';
import { type UserConfig } from '@vocab/core';
interface PullOptions {

@@ -3,0 +3,0 @@ branch?: string;

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

import type { UserConfig } from '@vocab/core';
import { type UserConfig } from '@vocab/core';
interface PushOptions {

@@ -3,0 +3,0 @@ branch: string;

export * from "./declarations/src/index";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItcGhyYXNlLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==

@@ -8,5 +8,3 @@ 'use strict';

var core = require('@vocab/core');
var FormData = require('form-data');
var fetch = require('node-fetch');
var chalk = require('chalk');
var pc = require('picocolors');
var debug = require('debug');

@@ -18,5 +16,3 @@ var sync = require('csv-stringify/sync');

var path__default = /*#__PURE__*/_interopDefault(path);
var FormData__default = /*#__PURE__*/_interopDefault(FormData);
var fetch__default = /*#__PURE__*/_interopDefault(fetch);
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
var pc__default = /*#__PURE__*/_interopDefault(pc);
var debug__default = /*#__PURE__*/_interopDefault(debug);

@@ -30,3 +26,3 @@

// eslint-disable-next-line no-console
console.log(chalk__default["default"].yellow('Vocab'), ...params);
console.log(pc__default["default"].yellow('Vocab'), ...params);
};

@@ -48,4 +44,4 @@

altLanguages.map(language => {
var _translations$languag, _translations$languag2;
const altTranslationMessage = (_translations$languag = translations[language]) === null || _translations$languag === void 0 ? void 0 : (_translations$languag2 = _translations$languag[key]) === null || _translations$languag2 === void 0 ? void 0 : _translations$languag2.message;
var _translations$languag;
const altTranslationMessage = (_translations$languag = translations[language]) === null || _translations$languag === void 0 || (_translations$languag = _translations$languag[key]) === null || _translations$languag === void 0 ? void 0 : _translations$languag.message;
if (altTranslationMessage) {

@@ -86,3 +82,3 @@ csvFilesByLanguage[language].push([...sharedData, altTranslationMessage]);

}
return fetch__default["default"](path, {
return fetch(path, {
...options,

@@ -92,3 +88,3 @@ headers: {

// Provide identification via User Agent as requested in https://developers.phrase.com/api/#overview--identification-via-user-agent
'User-Agent': 'SEEK Demo Candidate App (jhope@seek.com.au)',
'User-Agent': 'Vocab Client (https://github.com/seek-oss/vocab)',
...options.headers

@@ -166,8 +162,6 @@ }

for (const [language, csvFileString] of Object.entries(csvFileStrings)) {
const formData = new FormData__default["default"]();
const fileContents = Buffer.from(csvFileString);
formData.append('file', fileContents, {
contentType: 'text/csv',
filename: `${language}.translations.csv`
});
const formData = new FormData();
formData.append('file', new Blob([csvFileString], {
type: 'text/csv'
}), `${language}.translations.csv`);
formData.append('file_format', 'csv');

@@ -177,6 +171,6 @@ formData.append('branch', branch);

formData.append('update_descriptions', 'true');
formData.append(`locale_mapping[${language}]`, messageIndex);
formData.append('format_options[key_index]', keyIndex);
formData.append('format_options[comment_index]', commentIndex);
formData.append('format_options[tag_column]', tagColumn);
formData.append(`locale_mapping[${language}]`, messageIndex.toString());
formData.append('format_options[key_index]', keyIndex.toString());
formData.append('format_options[comment_index]', commentIndex.toString());
formData.append('format_options[tag_column]', tagColumn.toString());
formData.append('format_options[enable_pluralization]', 'false');

@@ -340,3 +334,2 @@ log(`Uploading translations for language ${language}`);

for (const localKey of Object.keys(localTranslations)) {
var _globalKey;
const {

@@ -349,7 +342,4 @@ tags = [],

}
let globalKey;
if (loadedTranslation.languages[config.devLanguage][localKey].globalKey) {
globalKey = loadedTranslation.languages[config.devLanguage][localKey].globalKey;
}
const phraseKey = (_globalKey = globalKey) !== null && _globalKey !== void 0 ? _globalKey : core.getUniqueKey(localKey, loadedTranslation.namespace);
const globalKey = loadedTranslation.languages[config.devLanguage][localKey].globalKey;
const phraseKey = globalKey !== null && globalKey !== void 0 ? globalKey : core.getUniqueKey(localKey, loadedTranslation.namespace);
phraseTranslations[language][phraseKey] = localTranslation;

@@ -356,0 +346,0 @@ }

@@ -8,5 +8,3 @@ 'use strict';

var core = require('@vocab/core');
var FormData = require('form-data');
var fetch = require('node-fetch');
var chalk = require('chalk');
var pc = require('picocolors');
var debug = require('debug');

@@ -18,5 +16,3 @@ var sync = require('csv-stringify/sync');

var path__default = /*#__PURE__*/_interopDefault(path);
var FormData__default = /*#__PURE__*/_interopDefault(FormData);
var fetch__default = /*#__PURE__*/_interopDefault(fetch);
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
var pc__default = /*#__PURE__*/_interopDefault(pc);
var debug__default = /*#__PURE__*/_interopDefault(debug);

@@ -30,3 +26,3 @@

// eslint-disable-next-line no-console
console.log(chalk__default["default"].yellow('Vocab'), ...params);
console.log(pc__default["default"].yellow('Vocab'), ...params);
};

@@ -48,4 +44,4 @@

altLanguages.map(language => {
var _translations$languag, _translations$languag2;
const altTranslationMessage = (_translations$languag = translations[language]) === null || _translations$languag === void 0 ? void 0 : (_translations$languag2 = _translations$languag[key]) === null || _translations$languag2 === void 0 ? void 0 : _translations$languag2.message;
var _translations$languag;
const altTranslationMessage = (_translations$languag = translations[language]) === null || _translations$languag === void 0 || (_translations$languag = _translations$languag[key]) === null || _translations$languag === void 0 ? void 0 : _translations$languag.message;
if (altTranslationMessage) {

@@ -86,3 +82,3 @@ csvFilesByLanguage[language].push([...sharedData, altTranslationMessage]);

}
return fetch__default["default"](path, {
return fetch(path, {
...options,

@@ -92,3 +88,3 @@ headers: {

// Provide identification via User Agent as requested in https://developers.phrase.com/api/#overview--identification-via-user-agent
'User-Agent': 'SEEK Demo Candidate App (jhope@seek.com.au)',
'User-Agent': 'Vocab Client (https://github.com/seek-oss/vocab)',
...options.headers

@@ -166,8 +162,6 @@ }

for (const [language, csvFileString] of Object.entries(csvFileStrings)) {
const formData = new FormData__default["default"]();
const fileContents = Buffer.from(csvFileString);
formData.append('file', fileContents, {
contentType: 'text/csv',
filename: `${language}.translations.csv`
});
const formData = new FormData();
formData.append('file', new Blob([csvFileString], {
type: 'text/csv'
}), `${language}.translations.csv`);
formData.append('file_format', 'csv');

@@ -177,6 +171,6 @@ formData.append('branch', branch);

formData.append('update_descriptions', 'true');
formData.append(`locale_mapping[${language}]`, messageIndex);
formData.append('format_options[key_index]', keyIndex);
formData.append('format_options[comment_index]', commentIndex);
formData.append('format_options[tag_column]', tagColumn);
formData.append(`locale_mapping[${language}]`, messageIndex.toString());
formData.append('format_options[key_index]', keyIndex.toString());
formData.append('format_options[comment_index]', commentIndex.toString());
formData.append('format_options[tag_column]', tagColumn.toString());
formData.append('format_options[enable_pluralization]', 'false');

@@ -340,3 +334,2 @@ log(`Uploading translations for language ${language}`);

for (const localKey of Object.keys(localTranslations)) {
var _globalKey;
const {

@@ -349,7 +342,4 @@ tags = [],

}
let globalKey;
if (loadedTranslation.languages[config.devLanguage][localKey].globalKey) {
globalKey = loadedTranslation.languages[config.devLanguage][localKey].globalKey;
}
const phraseKey = (_globalKey = globalKey) !== null && _globalKey !== void 0 ? _globalKey : core.getUniqueKey(localKey, loadedTranslation.namespace);
const globalKey = loadedTranslation.languages[config.devLanguage][localKey].globalKey;
const phraseKey = globalKey !== null && globalKey !== void 0 ? globalKey : core.getUniqueKey(localKey, loadedTranslation.namespace);
phraseTranslations[language][phraseKey] = localTranslation;

@@ -356,0 +346,0 @@ }

import { promises } from 'fs';
import path from 'path';
import { getAltLanguages, loadAllTranslations, getUniqueKey, getAltLanguageFilePath } from '@vocab/core';
import FormData from 'form-data';
import fetch from 'node-fetch';
import chalk from 'chalk';
import pc from 'picocolors';
import debug from 'debug';

@@ -16,3 +14,3 @@ import { stringify } from 'csv-stringify/sync';

// eslint-disable-next-line no-console
console.log(chalk.yellow('Vocab'), ...params);
console.log(pc.yellow('Vocab'), ...params);
};

@@ -34,4 +32,4 @@

altLanguages.map(language => {
var _translations$languag, _translations$languag2;
const altTranslationMessage = (_translations$languag = translations[language]) === null || _translations$languag === void 0 ? void 0 : (_translations$languag2 = _translations$languag[key]) === null || _translations$languag2 === void 0 ? void 0 : _translations$languag2.message;
var _translations$languag;
const altTranslationMessage = (_translations$languag = translations[language]) === null || _translations$languag === void 0 || (_translations$languag = _translations$languag[key]) === null || _translations$languag === void 0 ? void 0 : _translations$languag.message;
if (altTranslationMessage) {

@@ -77,3 +75,3 @@ csvFilesByLanguage[language].push([...sharedData, altTranslationMessage]);

// Provide identification via User Agent as requested in https://developers.phrase.com/api/#overview--identification-via-user-agent
'User-Agent': 'SEEK Demo Candidate App (jhope@seek.com.au)',
'User-Agent': 'Vocab Client (https://github.com/seek-oss/vocab)',
...options.headers

@@ -152,7 +150,5 @@ }

const formData = new FormData();
const fileContents = Buffer.from(csvFileString);
formData.append('file', fileContents, {
contentType: 'text/csv',
filename: `${language}.translations.csv`
});
formData.append('file', new Blob([csvFileString], {
type: 'text/csv'
}), `${language}.translations.csv`);
formData.append('file_format', 'csv');

@@ -162,6 +158,6 @@ formData.append('branch', branch);

formData.append('update_descriptions', 'true');
formData.append(`locale_mapping[${language}]`, messageIndex);
formData.append('format_options[key_index]', keyIndex);
formData.append('format_options[comment_index]', commentIndex);
formData.append('format_options[tag_column]', tagColumn);
formData.append(`locale_mapping[${language}]`, messageIndex.toString());
formData.append('format_options[key_index]', keyIndex.toString());
formData.append('format_options[comment_index]', commentIndex.toString());
formData.append('format_options[tag_column]', tagColumn.toString());
formData.append('format_options[enable_pluralization]', 'false');

@@ -325,3 +321,2 @@ log(`Uploading translations for language ${language}`);

for (const localKey of Object.keys(localTranslations)) {
var _globalKey;
const {

@@ -334,7 +329,4 @@ tags = [],

}
let globalKey;
if (loadedTranslation.languages[config.devLanguage][localKey].globalKey) {
globalKey = loadedTranslation.languages[config.devLanguage][localKey].globalKey;
}
const phraseKey = (_globalKey = globalKey) !== null && _globalKey !== void 0 ? _globalKey : getUniqueKey(localKey, loadedTranslation.namespace);
const globalKey = loadedTranslation.languages[config.devLanguage][localKey].globalKey;
const phraseKey = globalKey !== null && globalKey !== void 0 ? globalKey : getUniqueKey(localKey, loadedTranslation.namespace);
phraseTranslations[language][phraseKey] = localTranslation;

@@ -341,0 +333,0 @@ }

{
"name": "@vocab/phrase",
"version": "0.0.0-global-key-support-20231025223328",
"version": "0.0.0-master-20240711232538",
"repository": {
"type": "git",
"url": "https://github.com/seek-oss/vocab.git",
"directory": "packages/phrase"
},
"engines": {
"node": ">=18"
},
"main": "dist/vocab-phrase.cjs.js",

@@ -9,12 +17,10 @@ "module": "dist/vocab-phrase.esm.js",

"dependencies": {
"@vocab/core": "0.0.0-global-key-support-20231025223328",
"chalk": "^4.1.0",
"csv-stringify": "^6.2.3",
"debug": "^4.3.1",
"form-data": "^3.0.0",
"node-fetch": "^2.6.1"
"picocolors": "^1.0.0",
"@vocab/core": "^1.6.2"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/node-fetch": "^2.5.7"
"@types/node": "^18.11.9"
},

@@ -21,0 +27,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc