[gxml] Mark translatable warning strings



commit 580cac0253846ff14ede92203c0d6d98723d92bd
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue Oct 27 10:22:44 2015 -0600

    Mark translatable warning strings

 gxml/Node.vala                    |    2 +-
 gxml/SerializableEnum.vala        |    4 ++--
 gxml/SerializableObjectModel.vala |    6 +++---
 gxml/SerializableProperty.vala    |    4 ++--
 gxml/Serialization.vala           |    2 +-
 gxml/libxml-ChildNodeList.vala    |    2 +-
 gxml/libxml-Document.vala         |    2 +-
 gxml/libxml-Entity.vala           |    2 +-
 gxml/libxml-Node.vala             |    2 +-
 po/POTFILES.in                    |   12 ++++++++++--
 10 files changed, 23 insertions(+), 15 deletions(-)
---
diff --git a/gxml/Node.vala b/gxml/Node.vala
index 32ea2c6..d229f13 100644
--- a/gxml/Node.vala
+++ b/gxml/Node.vala
@@ -131,7 +131,7 @@ public interface GXml.Node : Object
         }
         if (c is Text) {
           if (c.value == null) {
-            GLib.warning ("Text node with NULL string");
+            GLib.warning (_("Text node with NULL string"));
             continue;
           }
           var t = doc.create_text (c.value);
diff --git a/gxml/SerializableEnum.vala b/gxml/SerializableEnum.vala
index c9df0af..c406628 100644
--- a/gxml/SerializableEnum.vala
+++ b/gxml/SerializableEnum.vala
@@ -69,10 +69,10 @@ public class GXml.SerializableEnum : SerializableObjectModel, SerializableProper
   public int to_integer () throws GLib.Error
   {
     if (_val == null)
-      throw new SerializableEnumError.INVALID_VALUE_ERROR ("Value can't be parsed to a valid enumeration's 
value. Value is not set");
+      throw new SerializableEnumError.INVALID_VALUE_ERROR (_("Value can't be parsed to a valid enumeration's 
value. Value is not set"));
     var e = Enumeration.parse (_enumtype, _val);
     if (e == null)
-      throw new SerializableEnumError.INVALID_VALUE_ERROR ("Value can't be parsed to a valid enumeration's 
value");
+      throw new SerializableEnumError.INVALID_VALUE_ERROR (_("Value can't be parsed to a valid enumeration's 
value"));
     return e.value;
   }
   public string get_serializable_property_value () { return _val; }
diff --git a/gxml/SerializableObjectModel.vala b/gxml/SerializableObjectModel.vala
index 7e1fcc7..f5310b3 100644
--- a/gxml/SerializableObjectModel.vala
+++ b/gxml/SerializableObjectModel.vala
@@ -170,7 +170,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
             element.childs.add (e);
           }
           if (n is Text) {
-            if (n.value == null) GLib.warning ("Text node with NULL or none text");
+            if (n.value == null) GLib.warning (_("Text node with NULL or none text"));
             if (n.value == "") continue;
             var t = doc.create_text (n.value);
             element.childs.add (t);
@@ -294,11 +294,11 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
       element = (Element) doc.root;
     return_val_if_fail (element != null, null);
     if (node_name () == null) {
-      GLib.warning (@"WARNING: Object type '$(get_type ().name ())' have no Node Name defined");
+      GLib.warning (_("WARNING: Object type '%s' have no Node Name defined").printf (get_type ().name ()));
       return null;
     }
     if (element.name.down () != node_name ().down ()) {
-      GLib.warning (@"Actual node's name is '$(element.name.down ())' expected '$(node_name ().down ())'");
+      GLib.warning (_("Actual node's name is '%s' expected '%s'").printf (element.name.down (),node_name 
().down ()));
     }
 #if DEBUG
     stdout.printf (@"Deserialize Node: $(element.name)\n");
diff --git a/gxml/SerializableProperty.vala b/gxml/SerializableProperty.vala
index 6fdf6a1..4d41d18 100644
--- a/gxml/SerializableProperty.vala
+++ b/gxml/SerializableProperty.vala
@@ -90,7 +90,7 @@ public interface GXml.SerializableProperty : Object, Serializable
       name = prop.get_name ();
     Test.message ("Property to set:"+name+" - with value: "+get_serializable_property_value ());
     if (!(element is GXml.Element)) {
-      GLib.warning ("Trying to serialize to a non GXmlElement!");
+      GLib.warning (_("Trying to serialize to a non GXmlElement!"));
       return element;
     }
     ((GXml.Element) element).set_attr (name, get_serializable_property_value ());
@@ -109,7 +109,7 @@ public interface GXml.SerializableProperty : Object, Serializable
       attr = (GXml.Attribute) property_node;
     if (attr == null) {
 #if DEBUG
-      GLib.warning ("No attribute found to deserialize from");
+      GLib.warning (_("No attribute found to deserialize from"));
 #endif
       return false;
     }
diff --git a/gxml/Serialization.vala b/gxml/Serialization.vala
index 7ec5af1..0258d1e 100644
--- a/gxml/Serialization.vala
+++ b/gxml/Serialization.vala
@@ -181,7 +181,7 @@ namespace GXml {
                                        // TODO: Make copy_node public to allow others to use it
                                        value_node = doc.copy_node (value_doc.document_element);
                        } else if (type.name () == "gpointer") {
-                               GLib.warning ("DEBUG: skipping gpointer with name '%s' of object '%s'", 
prop_spec.name, object.get_type ().name ());
+                               GLib.warning (_("DEBUG: skipping gpointer with name '%s' of object '%s'"), 
prop_spec.name, object.get_type ().name ());
                                value_node = doc.create_text_node (prop_spec.name);
                        } else {
                                throw new SerializationError.UNSUPPORTED_PROPERTY_TYPE ("Can't currently 
serialize type '%s' for property '%s' of object '%s'", type.name (), prop_spec.name, object.get_type ().name 
());
diff --git a/gxml/libxml-ChildNodeList.vala b/gxml/libxml-ChildNodeList.vala
index 4548cd1..cb3a8d4 100644
--- a/gxml/libxml-ChildNodeList.vala
+++ b/gxml/libxml-ChildNodeList.vala
@@ -144,7 +144,7 @@ internal abstract class GXml.ChildNodeList : AbstractBidirList<xNode>, NodeList
                                child = child->next;
                        }
                        if (child == null) {
-                               GXml.warning (DomException.NOT_FOUND, "ref_child '%s' not found, was supposed 
to have '%s' inserted before it.".printf (ref_child.node_name, new_child.node_name));
+                               GXml.warning (DomException.NOT_FOUND, _("ref_child '%s' not found, was 
supposed to have '%s' inserted before it.").printf (ref_child.node_name, new_child.node_name));
                                return null;
                                // TODO: provide a more useful description of ref_child, but there are so 
many different types
                        } else {
diff --git a/gxml/libxml-Document.vala b/gxml/libxml-Document.vala
index a0f3f46..6ff4fd1 100644
--- a/gxml/libxml-Document.vala
+++ b/gxml/libxml-Document.vala
@@ -134,7 +134,7 @@ namespace GXml {
                                case NodeType.DOCUMENT_TYPE:
                                case NodeType.NOTATION:
                                case NodeType.DOCUMENT:
-                                       GLib.warning ("Looking up %s from an xmlNode* is not supported", 
nodetype.to_string ());
+                                       GLib.warning (_("Looking up %s from an xmlNode* is not supported"), 
nodetype.to_string ());
                                        break;
                                }
 
diff --git a/gxml/libxml-Entity.vala b/gxml/libxml-Entity.vala
index 1648dc1..c17eb3f 100644
--- a/gxml/libxml-Entity.vala
+++ b/gxml/libxml-Entity.vala
@@ -126,7 +126,7 @@ namespace GXml {
                        return (this.child_nodes.length > 0);
                }
                public override unowned xNode? clone_node (bool deep) {
-                       GLib.warning ("Cloning of Entity not yet supported");
+                       GLib.warning (_("Cloning of Entity not yet supported"));
                        return this; // STUB
                }
 
diff --git a/gxml/libxml-Node.vala b/gxml/libxml-Node.vala
index d4210bc..543ec1b 100644
--- a/gxml/libxml-Node.vala
+++ b/gxml/libxml-Node.vala
@@ -64,7 +64,7 @@ namespace GXml {
                        }
 
                        if (this_doc != node.owner_document) {
-                               GXml.warning (DomException.WRONG_DOCUMENT, "xNode tried to interact with this 
document '%p' but belonged to document '%p'".printf (this_doc, node.owner_document));
+                               GXml.warning (DomException.WRONG_DOCUMENT, _("xNode tried to interact with 
this document '%p' but belonged to document '%p'").printf (this_doc, node.owner_document));
                        }
                }
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4175df1..43019ab 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,3 +1,11 @@
 # List of source files containing translatable strings.
-
-gxml/SerializableEnum.c
\ No newline at end of file
+gxml/libxml-ChildNodeList.c
+gxml/SerializableEnum.c
+gxml/SerializableEnum.c
+gxml/libxml-Document.c
+gxml/libxml-Entity.c
+gxml/libxml-Node.c
+gxml/SerializableObjectModel.c
+gxml/SerializableProperty.c
+gxml/Node.c
+gxml/Serialization.c


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