[glom] Import of po files: Handle empty gettext strings.



commit 3b190ebedc10b8d1476a3f133da7d2b53a3d6f10
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Jan 8 01:20:38 2012 +0100

    Import of po files: Handle empty gettext strings.
    
    * glom/libglom/translations_po.cc: Handle empty msgid, msgstr and
    msgctxt.

 ChangeLog                       |    7 +++++++
 glom/libglom/translations_po.cc |    6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6189422..32d7ac1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-01-08  Murray Cumming  <murrayc murrayc com>
 
+	Import of po files: Handle empty gettext strings.
+
+	* glom/libglom/translations_po.cc: Handle empty msgid, msgstr and 
+	msgctxt.
+
+2012-01-08  Murray Cumming  <murrayc murrayc com>
+
 	Export to po file: Improve the msgtxt hints more.
 
 	* glom/libglom/document/document.cc: fill_translatable_layout_items():
diff --git a/glom/libglom/translations_po.cc b/glom/libglom/translations_po.cc
index 9ca394d..db08c4d 100644
--- a/glom/libglom/translations_po.cc
+++ b/glom/libglom/translations_po.cc
@@ -245,9 +245,9 @@ bool import_translations_from_po_file(Document* document, const Glib::ustring& p
       //This message:
       //TODO: Just use const char* instead of copying it in to a Glib::ustring,
       //if we have performance problems here:
-      const Glib::ustring msgid = po_message_msgid(msg);
-      const Glib::ustring msgstr = po_message_msgstr(msg);
-      const Glib::ustring msgcontext = po_message_msgctxt(msg);
+      const Glib::ustring msgid = Glib::convert_const_gchar_ptr_to_ustring( po_message_msgid(msg) );
+      const Glib::ustring msgstr = Glib::convert_const_gchar_ptr_to_ustring( po_message_msgstr(msg) );
+      const Glib::ustring msgcontext = Glib::convert_const_gchar_ptr_to_ustring( po_message_msgctxt(msg) );
 
       //Find the matching item in the list:
       for(Document::type_list_translatables::iterator iter = list_layout_items.begin(); iter != list_layout_items.end(); ++iter)



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