Repository: elixir-gettext/gettext (elixir)

Issue:
gettext_comment disappearing
When using gettext_comment it only appears the first time you extract a msg. 
So for example:

```
    gettext_comment("very important clarifying comment")
    gettext("This is some very awesome text"
```
If you would run gettext.extract the comment does appear in the pot file.
However, if you run extract again the comment is gone.
Only if the string within the gettext call gets updated, and is thus a new msg again, the comment is back in the pot file.

Pull request:
Consider extracted comments when merging templates during extraction
Fixes #222.

Patch:
diff --git a/lib/gettext/extractor.ex b/lib/gettext/extractor.ex
index 0ca8bc2..1330b52 100644
--- a/lib/gettext/extractor.ex
+++ b/lib/gettext/extractor.ex
@@ -315,7 +315,8 @@ defmodule Gettext.Extractor do
       comments: old.comments,
       # We don't care about the references of the old translation since the new
       # in-memory translation has all the actual and current references.
-      references: new.references
+      references: new.references,
+      extracted_comments: new.extracted_comments
     }
   end
 
@@ -330,7 +331,8 @@ defmodule Gettext.Extractor do
       msgstr: old.msgstr,
       flags: old.flags,
       comments: old.comments,
-      references: new.references
+      references: new.references,
+      extracted_comments: new.extracted_comments
     }
   end
 


Test patch:
diff --git a/test/gettext/extractor_test.exs b/test/gettext/extractor_test.exs
index 069732f..bf39616 100644
--- a/test/gettext/extractor_test.exs
+++ b/test/gettext/extractor_test.exs
@@ -123,7 +123,8 @@ defmodule Gettext.ExtractorTest do
         %Translation{
           msgid: ["matching autogenerated"],
           references: [{"foo.ex", 2}],
-          flags: flags
+          flags: flags,
+          extracted_comments: ["#. Foo"]
         },
         %Translation{msgid: ["non-matching autogenerated"], flags: flags},
         %Translation{msgid: ["non-autogenerated"], references: [{"foo.ex", 4}]}
@@ -131,7 +132,11 @@ defmodule Gettext.ExtractorTest do
 
       ts2 = [
         %Translation{msgid: ["non-matching non-autogenerated"]},
-        %Translation{msgid: ["matching autogenerated"], references: [{"foo.ex", 3}]}
+        %Translation{
+          msgid: ["matching autogenerated"],
+          references: [{"foo.ex", 3}],
+          extracted_comments: ["#. Bar"]
+        }
       ]
 
       assert Extractor.merge_template(%PO{translations: ts1}, %PO{translations: ts2}, []) == %PO{
@@ -139,7 +144,8 @@ defmodule Gettext.ExtractorTest do
                  %Translation{
                    msgid: ["matching autogenerated"],
                    references: [{"foo.ex", 3}],
-                   flags: flags
+                   flags: flags,
+                   extracted_comments: ["#. Bar"]
                  },
                  %Translation{msgid: ["non-autogenerated"], references: [{"foo.ex", 4}]},
                  %Translation{msgid: ["non-matching non-autogenerated"]}