[gtranslator] Header with default values when doesn't exists



commit f7b1d14cdf63f913b4ffbbcc8d101f92ddbe74a5
Author: Daniel GarcĂ­a Moreno <danigm wadobo com>
Date:   Sun Jan 6 13:09:40 2019 +0100

    Header with default values when doesn't exists

 src/gtr-po.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/gtr-po.c b/src/gtr-po.c
index e96fb9b2..a43ba571 100644
--- a/src/gtr-po.c
+++ b/src/gtr-po.c
@@ -460,9 +460,15 @@ _gtr_po_load (GtrPo * po, GFile * location, GError ** error)
     priv->header = gtr_header_new (iter, message);
   else
     {
-      /* FIXME: add a header with default values */
       po_message_iterator_free (iter);
       iter = po_message_iterator (priv->gettext_po_file, NULL);
+
+      message = po_message_create ();
+      po_message_set_msgid (message, "");
+      po_message_set_msgstr (message, "");
+      po_message_insert (iter, message);
+
+      priv->header = gtr_header_new (iter, message);
     }
 
   priv->iter = iter;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]