New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

xlf-translate

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xlf-translate - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "xlf-translate",
"version": "2.0.0",
"version": "2.0.1",
"description": "Populate XLIFF (.XLF) files with existing translations",

@@ -5,0 +5,0 @@ "main": "translate.js",

@@ -5,2 +5,7 @@ 'use strict';

const indent = node => {
const indent = node.parent().html().match(/^\s+/);
return indent !== null ? indent[0] : '';
};
/**

@@ -18,7 +23,17 @@ * Fills in translations in XLIFF files based on 'meaning' metadata as a key.

units
.filter(unit => doc(unit).find('note').length > 0)
.map(unit => ({
target: doc(unit).find('target'),
id: doc(unit).find('note[from=meaning]').text()
}))
.map(unit => doc(unit))
.filter(unit => unit.find('note').length > 0)
.map(unit => {
const source = unit.find('source');
let target = unit.find('target');
if (target.length === 0 && source.length === 1) {
target = doc('<target />');
source.after(indent(source), target);
}
return {
target: target,
id: doc(unit).find('note[from=meaning]').text()
};
})
.filter(d => d.id && isKey(d.id))

@@ -25,0 +40,0 @@ .forEach(d => {

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