react-intl-po
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -73,3 +73,3 @@ 'use strict'; | ||
.sort().map(function (id) { | ||
return potCommentsFormater(messageObject[id]) + 'msgid "' + id + '"\nmsgstr ""\n'; | ||
return potCommentsFormater(messageObject[id]) + 'msgid ' + JSON.stringify(id) + '\nmsgstr ""\n'; | ||
}).join('\n'); | ||
@@ -76,0 +76,0 @@ }; |
{ | ||
"name": "react-intl-po", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Extract POT from react-intl and convert back to json.", | ||
@@ -52,3 +52,3 @@ "author": "Michael Hsu", | ||
"eslint": "^3.13.0", | ||
"jest": "^18.1.0", | ||
"jest": "^19.0.2", | ||
"lint-config-m": "^3.1.0", | ||
@@ -68,5 +68,9 @@ "stylelint": "^7.7.1" | ||
"jest": { | ||
"testEnvironment": "node", | ||
"testRegex": "(/test/.*|\\.(test))\\.js$", | ||
"moduleFileExtensions": [ | ||
"js" | ||
], | ||
"snapshotSerializers": [ | ||
"./config/stringSerializer.js" | ||
] | ||
@@ -73,0 +77,0 @@ }, |
@@ -61,5 +61,5 @@ /** | ||
.sort() | ||
.map(id => `${potCommentsFormater(messageObject[id])}msgid "${id}"\nmsgstr ""\n`) | ||
.map(id => `${potCommentsFormater(messageObject[id])}msgid ${JSON.stringify(id)}\nmsgstr ""\n`) | ||
.join('\n'); | ||
export default potFormater; |
@@ -56,1 +56,16 @@ import potFormater from '../src/potFormater'; | ||
}); | ||
it('should return pot formatted string, with double quotes escaped', () => { | ||
expect( | ||
potFormater({ | ||
'This is "quoted"': [ | ||
{ | ||
id: 'NotFound.errorButton', | ||
description: 'My description\nis\nquite\nlong.', | ||
defaultMessage: 'This is "quoted"', | ||
filename: './messages/src/containers/NotFound/messages.json', | ||
}, | ||
], | ||
}), | ||
).toMatchSnapshot(); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62394
848