Repository: lingui/js-lingui (ts)

Issue:
Multiple comments get ignored for same ID
**Describe the bug**

A given translation ID may occur multiple times in the source code. 
It is reasonable that some of these invocations have comments and other not, some comments may even be different.
Lingui only uses the comment of the first instance it find. If that instance does not have a comment, no comment is added to the PO file.

**To Reproduce**

Given the following file

```tsx
<Trans id="long_value" comment="First comment" />
<Trans id="long_value" comment="Second comment, does not work yet" />
```

when running ```lingui extract```

We get 

```po
#. First comment
#: src/pages/Lingui.tsx:62
#: src/pages/Lingui.tsx:69
#: src/pages/Lingui.tsx:74
msgid "long_value"
msgstr ""
```

**Expected behavior**

The PO file should contain all comments:

```po
#. First comment
#: src/pages/Lingui.tsx:62
# Second comment, does not work yet
#: src/pages/Lingui.tsx:69
#: src/pages/Lingui.tsx:74
msgid "long_value"
msgstr ""
```

**Additional context**

- jsLingui version 3.1.0


Pull request:
feat: extract multiple comments per translation ID
This PR resolves #845 

On par file level is collects multiple ```extractedComments``` (using the same name as ```pofile``` package)
This - just like origins - gets merged together to build the catalogue.

Some refactoring was done to use the ```extractedComments``` name throughout.

**Possible issues**

This change should just work for PO file users.
However if users are using lingui file type thing might break. Namely the ```description (string)``` is replaced with ```extractedComments (string[])```. Either some backwards compatibility should be built on top of these changes, or sufficient change information should be provided.

**What can be improved***

Currently the PO file gets built like with ```extractedComments``` and ```references``` grouped: 

```po
#. Comment in code
#. Other comment
#: App.js:12
#: Screen.js:56
# msgid "Nice"
```

It would be cool to output them with comment associated with the reference file.

```po
#: App.js:12
#. Comment in code
#: Screen.js:56
#. Other comment
# msgid "Nice"
```

However, it seems that PO file here is major blocker and this change would be way to much work to achieve.

Patch:
diff --git a/packages/babel-plugin-extract-messages/src/index.ts b/packages/babel-plugin-extract-messages/src/index.ts
index 038ec9c1..905f454b 100644
--- a/packages/babel-plugin-extract-messages/src/index.ts
+++ b/packages/babel-plugin-extract-messages/src/index.ts
@@ -17,7 +17,7 @@ const VISITED = Symbol("I18nVisited")
 function addMessage(
   path,
   messages,
-  { id, message: newDefault, origin, ...props }
+  { id, message: newDefault, origin, comment, ...props }
 ) {
   if (messages.has(id)) {
     const message = messages.get(id)
@@ -33,9 +33,13 @@ function addMessage(
       }
 
       ;[].push.apply(message.origin, origin)
+      if (comment) {
+        ;[].push.apply(message.extractedComments, [comment])
+      }
     }
   } else {
-    messages.set(id, { ...props, message: newDefault, origin })
+    const extractedComments = comment ? [comment] : []
+    messages.set(id, { ...props, message: newDefault, origin, extractedComments })
   }
 }
 
diff --git a/packages/cli/src/api/catalog.ts b/packages/cli/src/api/catalog.ts
index 3ae443b1..a8e53acd 100644
--- a/packages/cli/src/api/catalog.ts
+++ b/packages/cli/src/api/catalog.ts
@@ -25,11 +25,10 @@ type MessageOrigin = [string, number];
 export type ExtractedMessageType = {
   message?: string
   origin?: MessageOrigin[]
-  comment?: string
+  extractedComments?: string[]
   comments?: string[]
   obsolete?: boolean
   flags?: string[]
-  description?: string
 }
 
 export type MessageType = ExtractedMessageType & {
@@ -169,7 +168,7 @@ export class Catalog {
           .filter(Boolean)
           .reduce(
             (catalog, messages) =>
-              R.mergeWithKey(mergeOrigins, catalog, messages),
+              R.mergeWithKey(mergeOriginsAndExtractedComments, catalog, messages),
             {}
           )
       })(tmpDir)
@@ -541,10 +540,10 @@ export function getCatalogForMerge(config: LinguiConfig) {
 }
 
 /**
- * Merge origins for messages found in different places. All other attributes
+ * Merge origins and extractedComments for messages found in different places. All other attributes
  * should be the same (raise an error if defaults are different).
  */
-function mergeOrigins(msgId, prev, next) {
+function mergeOriginsAndExtractedComments(msgId, prev, next) {
   if (prev.defaults !== next.defaults) {
     throw new Error(
       `Encountered different defaults for message ${chalk.yellow(msgId)}` +
@@ -555,6 +554,7 @@ function mergeOrigins(msgId, prev, next) {
 
   return {
     ...next,
+    extractedComments: R.concat(prev.extractedComments, next.extractedComments),
     origin: R.concat(prev.origin, next.origin),
   }
 }
diff --git a/packages/cli/src/api/fixtures/collect/componentA/componentA.js b/packages/cli/src/api/fixtures/collect/componentA/componentA.js
index 67bd58bc..7365855d 100644
--- a/packages/cli/src/api/fixtures/collect/componentA/componentA.js
+++ b/packages/cli/src/api/fixtures/collect/componentA/componentA.js
@@ -1,1 +1,3 @@
-/*i18n*/ i18n._("Component A")
+/*i18n*/ i18n._("Component A");
+/*i18n*/ i18n._("Hello World", {}, {comment: "Comment A"});
+/*i18n*/ i18n._("Hello World", {}, {comment: "Comment A again"});
diff --git a/packages/cli/src/api/fixtures/collect/componentA/index.js b/packages/cli/src/api/fixtures/collect/componentA/index.js
index b8c091b3..2cd64b7a 100644
--- a/packages/cli/src/api/fixtures/collect/componentA/index.js
+++ b/packages/cli/src/api/fixtures/collect/componentA/index.js
@@ -1,1 +1,1 @@
-/*i18n*/ i18n._("Hello World")
+/*i18n*/ i18n._("Hello World", {}, {comment: "Hello comment"})
diff --git a/packages/cli/src/api/formats/po.ts b/packages/cli/src/api/formats/po.ts
index b10fbb8c..bcc18e94 100644
--- a/packages/cli/src/api/formats/po.ts
+++ b/packages/cli/src/api/formats/po.ts
@@ -24,7 +24,7 @@ const serialize = (items: CatalogType, options) =>
       item.msgid = key
       item.msgstr = [message.translation]
       item.comments = message.comments || []
-      item.extractedComments = message.comment ? [message.comment] : []
+      item.extractedComments = message.extractedComments || []
       if (options.origins) {
         item.references = message.origin ? message.origin.map(joinOrigin) : []
       }
@@ -53,12 +53,8 @@ const isObsolete = R.either(R.path(["flags", "obsolete"]), R.prop("obsolete"))
 const deserialize: (item: Object) => Object = R.map(
   R.applySpec({
     translation: R.compose(R.head, R.defaultTo([]), getTranslations),
-    comment: R.compose(R.head, R.defaultTo([]), getExtractedComments),
-    comments: (item) =>
-      R.concat(
-        getTranslatorComments(item) as string,
-        R.tail(getExtractedComments(item))
-      ),
+    extractedComments: R.compose(R.defaultTo([]), getExtractedComments),
+    comments: R.compose(R.defaultTo([]), getTranslatorComments),
     obsolete: isObsolete,
     origin: R.compose(R.map(splitOrigin), R.defaultTo([]), getOrigins),
     flags: getFlags,


Test patch:
diff --git a/docs/guides/testing.rst b/docs/guides/testing.rst
index 9edd4d60..6e944169 100644
--- a/docs/guides/testing.rst
+++ b/docs/guides/testing.rst
@@ -16,10 +16,12 @@ Here is a working example with `react-testing-library`_, using the `wrapper-prop
    import { render } from '@testing-library/react'
    import { i18n } from '@lingui/core'
    import { I18nProvider } from '@lingui/react'
+   import { en } from 'make-plural/plurals';
    import { messages } from '../your-path-to/en/messages.js'
    import Inbox from './Inbox'
 
    i18n.load('en', messages)
+   i18n.loadLocaleData({ en: { plurals: en } });
    i18n.activate('en')
    const TestingProvider = ({ children }) => (
      <I18nProvider i18n={i18n}>
diff --git a/packages/babel-plugin-extract-messages/test/__snapshots__/index.ts.snap b/packages/babel-plugin-extract-messages/test/__snapshots__/index.ts.snap
index f556de87..5571ff1c 100644
--- a/packages/babel-plugin-extract-messages/test/__snapshots__/index.ts.snap
+++ b/packages/babel-plugin-extract-messages/test/__snapshots__/index.ts.snap
@@ -3,6 +3,7 @@
 exports[`@lingui/babel-plugin-extract-messages should extract Plural messages from JSX files when there's no Trans tag (integration) 1`] = `
 Object {
   {count, plural, one {# book} other {# books}}: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         jsx-without-trans.js,
@@ -16,7 +17,9 @@ Object {
 exports[`@lingui/babel-plugin-extract-messages should extract all messages from JS files (macros) 1`] = `
 Object {
   Description: Object {
-    comment: description,
+    extractedComments: Array [
+      description,
+    ],
     origin: Array [
       Array [
         js-with-macros.js,
@@ -25,6 +28,7 @@ Object {
     ],
   },
   ID: Object {
+    extractedComments: Array [],
     message: Message with id,
     origin: Array [
       Array [
@@ -34,6 +38,7 @@ Object {
     ],
   },
   ID Some: Object {
+    extractedComments: Array [],
     message: Message with id some,
     origin: Array [
       Array [
@@ -43,6 +48,7 @@ Object {
     ],
   },
   Message: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         js-with-macros.js,
@@ -55,6 +61,7 @@ Object {
     ],
   },
   Values {param}: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         js-with-macros.js,
@@ -68,7 +75,9 @@ Object {
 exports[`@lingui/babel-plugin-extract-messages should extract all messages from JS files 1`] = `
 Object {
   Description: Object {
-    comment: description,
+    extractedComments: Array [
+      description,
+    ],
     origin: Array [
       Array [
         js-without-macros.js,
@@ -77,6 +86,7 @@ Object {
     ],
   },
   ID: Object {
+    extractedComments: Array [],
     message: Message with id,
     origin: Array [
       Array [
@@ -86,6 +96,7 @@ Object {
     ],
   },
   Message: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         js-without-macros.js,
@@ -94,6 +105,7 @@ Object {
     ],
   },
   Values {param}: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         js-without-macros.js,
@@ -107,6 +119,7 @@ Object {
 exports[`@lingui/babel-plugin-extract-messages should extract all messages from JSX files (macros) 1`] = `
 Object {
   Hi, my name is {name}: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         jsx-with-macros.js,
@@ -115,6 +128,7 @@ Object {
     ],
   },
   Title: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         jsx-with-macros.js,
@@ -123,6 +137,7 @@ Object {
     ],
   },
   {count, plural, one {# book} other {# books}}: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         jsx-with-macros.js,
@@ -136,6 +151,7 @@ Object {
 exports[`@lingui/babel-plugin-extract-messages should extract all messages from JSX files 1`] = `
 Object {
   Hi, my name is <0>{name}</0>: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         jsx-without-macros.js,
@@ -144,6 +160,7 @@ Object {
     ],
   },
   msg.default: Object {
+    extractedComments: Array [],
     message: Hello World,
     origin: Array [
       Array [
@@ -157,7 +174,9 @@ Object {
     ],
   },
   msg.hello: Object {
-    comment: Description,
+    extractedComments: Array [
+      Description,
+    ],
     origin: Array [
       Array [
         jsx-without-macros.js,
diff --git a/packages/cli/src/api/__snapshots__/catalog.test.ts.snap b/packages/cli/src/api/__snapshots__/catalog.test.ts.snap
index 1fbc1b33..d6a3ac41 100644
--- a/packages/cli/src/api/__snapshots__/catalog.test.ts.snap
+++ b/packages/cli/src/api/__snapshots__/catalog.test.ts.snap
@@ -3,6 +3,7 @@
 exports[`Catalog collect should extract messages from source files 1`] = `
 Object {
   Component A: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         collect/componentA/componentA.js,
@@ -11,6 +12,7 @@ Object {
     ],
   },
   Component B: Object {
+    extractedComments: Array [],
     origin: Array [
       Array [
         collect/componentB.js,
@@ -19,7 +21,20 @@ Object {
     ],
   },
   Hello World: Object {
+    extractedComments: Array [
+      Comment A,
+      Comment A again,
+      Hello comment,
+    ],
     origin: Array [
+      Array [
+        collect/componentA/componentA.js,
+        2,
+      ],
+      Array [
+        collect/componentA/componentA.js,
+        3,
+      ],
       Array [
         collect/componentA/index.js,
         1,
@@ -42,8 +57,8 @@ exports[`Catalog make should collect and write catalogs 2`] = `
 Object {
   cs: Object {
     Component A: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [
@@ -55,11 +70,23 @@ Object {
       translation: ,
     },
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [
+        Comment A,
+        Comment A again,
+        Hello comment,
+      ],
       flags: Array [],
       obsolete: false,
       origin: Array [
+        Array [
+          collect/componentA/componentA.js,
+          2,
+        ],
+        Array [
+          collect/componentA/componentA.js,
+          3,
+        ],
         Array [
           collect/componentA/index.js,
           1,
@@ -70,8 +97,8 @@ Object {
   },
   en: Object {
     Component A: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [
@@ -83,11 +110,23 @@ Object {
       translation: ,
     },
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [
+        Comment A,
+        Comment A again,
+        Hello comment,
+      ],
       flags: Array [],
       obsolete: false,
       origin: Array [
+        Array [
+          collect/componentA/componentA.js,
+          2,
+        ],
+        Array [
+          collect/componentA/componentA.js,
+          3,
+        ],
         Array [
           collect/componentA/index.js,
           1,
@@ -103,8 +142,8 @@ exports[`Catalog make should merge with existing catalogs 1`] = `
 Object {
   cs: Object {
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [],
@@ -113,8 +152,8 @@ Object {
   },
   en: Object {
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [],
@@ -128,8 +167,8 @@ exports[`Catalog make should merge with existing catalogs 2`] = `
 Object {
   cs: Object {
     Component A: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [
@@ -141,8 +180,8 @@ Object {
       translation: ,
     },
     Component B: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [
@@ -154,11 +193,23 @@ Object {
       translation: ,
     },
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [
+        Comment A,
+        Comment A again,
+        Hello comment,
+      ],
       flags: Array [],
       obsolete: false,
       origin: Array [
+        Array [
+          collect/componentA/componentA.js,
+          2,
+        ],
+        Array [
+          collect/componentA/componentA.js,
+          3,
+        ],
         Array [
           collect/componentA/index.js,
           1,
@@ -169,8 +220,8 @@ Object {
   },
   en: Object {
     Component A: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [
@@ -182,8 +233,8 @@ Object {
       translation: ,
     },
     Component B: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [
@@ -195,11 +246,23 @@ Object {
       translation: ,
     },
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [
+        Comment A,
+        Comment A again,
+        Hello comment,
+      ],
       flags: Array [],
       obsolete: false,
       origin: Array [
+        Array [
+          collect/componentA/componentA.js,
+          2,
+        ],
+        Array [
+          collect/componentA/componentA.js,
+          3,
+        ],
         Array [
           collect/componentA/index.js,
           1,
@@ -223,8 +286,8 @@ Object {
   cs: null,
   en: Object {
     Component A: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [
@@ -236,11 +299,23 @@ Object {
       translation: ,
     },
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [
+        Comment A,
+        Comment A again,
+        Hello comment,
+      ],
       flags: Array [],
       obsolete: false,
       origin: Array [
+        Array [
+          collect/componentA/componentA.js,
+          2,
+        ],
+        Array [
+          collect/componentA/componentA.js,
+          3,
+        ],
         Array [
           collect/componentA/index.js,
           1,
@@ -257,8 +332,8 @@ exports[`Catalog makeTemplate should collect and write a template 1`] = `null`;
 exports[`Catalog makeTemplate should collect and write a template 2`] = `
 Object {
   Component A: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [
@@ -270,11 +345,23 @@ Object {
     translation: ,
   },
   Hello World: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [
+      Comment A,
+      Comment A again,
+      Hello comment,
+    ],
     flags: Array [],
     obsolete: false,
     origin: Array [
+      Array [
+        collect/componentA/componentA.js,
+        2,
+      ],
+      Array [
+        collect/componentA/componentA.js,
+        3,
+      ],
       Array [
         collect/componentA/index.js,
         1,
@@ -288,51 +375,53 @@ Object {
 exports[`Catalog read should read file in given format 1`] = `
 Object {
   obsolete: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: true,
     origin: Array [],
     translation: Is marked as obsolete,
   },
   static: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [],
     translation: Static message,
   },
   veryLongString: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [],
     translation: One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked. "What's happened to me?" he thought. It wasn't a dream. His room, a proper human,
   },
   withComments: Object {
-    comment: undefined,
     comments: Array [
       Translator comment,
       This one might come from developer,
     ],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [],
     translation: Support translator comments separately,
   },
   withDescription: Object {
-    comment: Description is comment from developers to translators,
     comments: Array [],
+    extractedComments: Array [
+      Description is comment from developers to translators,
+    ],
     flags: Array [],
     obsolete: false,
     origin: Array [],
     translation: Message with description,
   },
   withFlags: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [
       fuzzy,
       otherFlag,
@@ -342,8 +431,8 @@ Object {
     translation: Keeps any flags that are defined,
   },
   withMultipleOrigins: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [
@@ -359,8 +448,8 @@ Object {
     translation: Message with multiple origin,
   },
   withOrigin: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [
@@ -380,8 +469,8 @@ exports[`Catalog readAll should read existing catalogs for all locales 1`] = `
 Object {
   cs: Object {
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [],
@@ -390,8 +479,8 @@ Object {
   },
   en: Object {
     Hello World: Object {
-      comment: undefined,
       comments: Array [],
+      extractedComments: Array [],
       flags: Array [],
       obsolete: false,
       origin: Array [],
diff --git a/packages/cli/src/api/formats/__snapshots__/lingui.test.ts.snap b/packages/cli/src/api/formats/__snapshots__/lingui.test.ts.snap
index 4cf6a970..af1ff828 100644
--- a/packages/cli/src/api/formats/__snapshots__/lingui.test.ts.snap
+++ b/packages/cli/src/api/formats/__snapshots__/lingui.test.ts.snap
@@ -36,7 +36,9 @@ exports[`lingui format should write catalog in lingui format 1`] = `
   },
   "withDescription": {
     "translation": "Message with description",
-    "description": "Description is comment from developers to translators"
+    "extractedComments": [
+      "Description is comment from developers to translators"
+    ]
   },
   "withComments": {
     "comments": [
diff --git a/packages/cli/src/api/formats/__snapshots__/po.test.ts.snap b/packages/cli/src/api/formats/__snapshots__/po.test.ts.snap
index bfcfe401..7d4c535c 100644
--- a/packages/cli/src/api/formats/__snapshots__/po.test.ts.snap
+++ b/packages/cli/src/api/formats/__snapshots__/po.test.ts.snap
@@ -3,9 +3,11 @@
 exports[`pofile format should correct badly used comments 1`] = `
 Object {
   withDescriptionAndComments: Object {
-    comment: Single description only,
     comments: Array [
       Translator comment,
+    ],
+    extractedComments: Array [
+      Single description only,
       Second description?,
     ],
     flags: Array [],
@@ -14,8 +16,9 @@ Object {
     translation: Second description joins translator comments,
   },
   withMultipleDescriptions: Object {
-    comment: First description,
-    comments: Array [
+    comments: Array [],
+    extractedComments: Array [
+      First description,
       Second comment,
       Third comment,
     ],
@@ -30,51 +33,53 @@ Object {
 exports[`pofile format should read catalog in pofile format 1`] = `
 Object {
   obsolete: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: true,
     origin: Array [],
     translation: Is marked as obsolete,
   },
   static: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [],
     translation: Static message,
   },
   veryLongString: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [],
     translation: One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked. "What's happened to me?" he thought. It wasn't a dream. His room, a proper human,
   },
   withComments: Object {
-    comment: undefined,
     comments: Array [
       Translator comment,
       This one might come from developer,
     ],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [],
     translation: Support translator comments separately,
   },
   withDescription: Object {
-    comment: Description is comment from developers to translators,
     comments: Array [],
+    extractedComments: Array [
+      Description is comment from developers to translators,
+    ],
     flags: Array [],
     obsolete: false,
     origin: Array [],
     translation: Message with description,
   },
   withFlags: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [
       fuzzy,
       otherFlag,
@@ -84,8 +89,8 @@ Object {
     translation: Keeps any flags that are defined,
   },
   withMultipleOrigins: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [
@@ -101,8 +106,8 @@ Object {
     translation: Message with multiple origin,
   },
   withOrigin: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [
@@ -119,8 +124,8 @@ Object {
 exports[`pofile format should throw away additional msgstr if present 1`] = `
 Object {
   withMultipleTranslation: Object {
-    comment: undefined,
     comments: Array [],
+    extractedComments: Array [],
     flags: Array [],
     obsolete: false,
     origin: Array [],
@@ -151,6 +156,7 @@ msgstr "Message with origin"
 msgid "withMultipleOrigins"
 msgstr "Message with multiple origin"
 
+#. Description is comment from developers to translators
 msgid "withDescription"
 msgstr "Message with description"
 
diff --git a/packages/cli/src/api/formats/lingui.test.ts b/packages/cli/src/api/formats/lingui.test.ts
index d391761b..c93efcb5 100644
--- a/packages/cli/src/api/formats/lingui.test.ts
+++ b/packages/cli/src/api/formats/lingui.test.ts
@@ -38,7 +38,7 @@ describe("lingui format", function () {
       },
       withDescription: {
         translation: "Message with description",
-        description: "Description is comment from developers to translators",
+        extractedComments: ["Description is comment from developers to translators"],
       },
       withComments: {
         comments: ["Translator comment", "This one might come from developer"],
diff --git a/packages/cli/src/api/formats/po.test.ts b/packages/cli/src/api/formats/po.test.ts
index ea1a2eb7..3cb2c5de 100644
--- a/packages/cli/src/api/formats/po.test.ts
+++ b/packages/cli/src/api/formats/po.test.ts
@@ -40,7 +40,7 @@ describe("pofile format", function () {
       },
       withDescription: {
         translation: "Message with description",
-        description: "Description is comment from developers to translators",
+        extractedComments: ["Description is comment from developers to translators"],
       },
       withComments: {
         comments: ["Translator comment", "This one might come from developer"],