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

pofile

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pofile - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

26

lib/po.js

@@ -123,6 +123,10 @@ var fs = require('fs'),

}
else if (line.match(/^#/)) { // Comment
else if (line.match(/^#\s+/)) { // Translator comment
finish();
item.comments.push(trim(line.replace(/^#/, '')));
item.comments.push(trim(line.replace(/^#\s+/, '')));
}
else if (line.match(/^#\./)) { // Extracted comment
finish();
item.extractedComments.push(trim(line.replace(/^#\./, '')));
}
else if (line.match(/^msgid_plural/)) { // Plural form

@@ -172,3 +176,4 @@ item.msgid_plural = extract(line);

this.msgstr = [];
this.comments = [];
this.comments = []; // translator comments
this.extractedComments = [];
this.flags = {};

@@ -197,2 +202,17 @@ };

// https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html
// says order is translator-comments, extracted-comments, references, flags
if (this.comments.length > 0) {
this.comments.forEach(function (c) {
lines.push('# ' + c);
});
}
if (this.extractedComments.length > 0) {
this.extractedComments.forEach(function (c) {
lines.push('#. ' + c);
});
}
if (this.references.length > 0) {

@@ -199,0 +219,0 @@ this.references.forEach(function (ref) {

6

package.json
{
"name": "pofile",
"description": "Parse and serialize Gettext PO files.",
"version": "0.2.4",
"version": "0.2.5",
"author": {

@@ -11,2 +11,3 @@ "name": "Ruben Vermeersch",

"contributors": [
"Julian Bäume",
"Mike Holly"

@@ -28,3 +29,4 @@ ],

"scripts": {
"test": "grunt test"
"test": "grunt test",
"prepublish": "grunt build"
},

@@ -31,0 +33,0 @@ "directories": {

@@ -91,7 +91,8 @@ # pofile - gettext .po parsing for JavaScript

* `references`: An array of reference strings.
* `comments`: An array of string comments.
* `comments`: An array of string translator comments.
* `extractedComments`: An array of string extracted comments.
* `flags`: A dictionary of the string flags. Each flag is mapped to a key with
value true. For instance, a string with the fuzzy flag set will have
`item.flags.fuzzy == true`.
* `msgctxt`: context of the message, an arbitrary string, can be used for disambiguation
* `msgctxt`: Context of the message, an arbitrary string, can be used for disambiguation.

@@ -98,0 +99,0 @@

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