Skip to content

Commit

Permalink
Merge branch 'release/1.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
goooseman committed Aug 8, 2019
2 parents e78fc06 + 28b82a8 commit ceac03b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gettext-utils",
"version": "1.2.1",
"version": "1.2.2",
"description": "A set of utils to parse react files and export .po files and import them back",
"bin": "src/cli.js",
"main": "src/main.js",
Expand Down
7 changes: 7 additions & 0 deletions src/utils/__fixtures__/pot.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
"msgstr": [
"Project-Id-Version: gettext-utils 1.1.2\nContent-Type: text/plain; charset=utf-8\nPOT-Creation-Date: Thu Jan 01 2018 00:00:00\nContent-Transfer-Encoding: 8bit\nPlural-Forms: nplurals=2; plural=(n != 1);\n"
]
},
"I don't have my own context, sad...": {
"msgid": "I don't have my own context, sad...",
"comments": {
"reference": "__fixtures__/react-project/src/components/LionessHocComponent.tsx:13"
},
"msgstr": [""]
}
},
"lion.sound": {
Expand Down
11 changes: 9 additions & 2 deletions src/utils/arePotsDifferent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ const arePotsDifferent = (
): boolean => {
const newTranslations = { ...newPot.translations };
const oldTranslations = { ...oldPot.translations };
delete newTranslations[""];
delete oldTranslations[""];

// We don't want to compare project's metadata
if (newTranslations[""]) {
delete newTranslations[""][""];
}
if (oldTranslations[""]) {
delete oldTranslations[""][""];
}

try {
assert.deepStrictEqual(newTranslations, oldTranslations);
} catch (e) {
Expand Down

0 comments on commit ceac03b

Please sign in to comment.