[gxml] Market error strings as translatable



commit e7a9243c6d32a8438c6c9d79c9a0bd8540638910
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue Oct 27 10:36:14 2015 -0600

    Market error strings as translatable

 gxml/Document.vala                  |    2 +-
 gxml/Enumeration.vala               |    4 ++--
 gxml/Serializable.vala              |    4 ++--
 gxml/SerializableGeeArrayList.vala  |    2 +-
 gxml/SerializableGeeDualKeyMap.vala |    2 +-
 gxml/SerializableGeeHashMap.vala    |    2 +-
 gxml/SerializableGeeTreeMap.vala    |    2 +-
 gxml/Serialization.vala             |    6 +++---
 gxml/libxml-Document.vala           |    2 +-
 gxml/libxml-Error.vala              |    2 +-
 po/POTFILES.in                      |    8 ++++++++
 11 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/gxml/Document.vala b/gxml/Document.vala
index 085ddae..601b7c4 100644
--- a/gxml/Document.vala
+++ b/gxml/Document.vala
@@ -147,7 +147,7 @@ public interface GXml.Document : Object, GXml.Node
   {
     var d = new xDocument.from_path (f.get_path ());
     if (!f.query_exists ())
-      throw new DocumentError.INVALID_FILE ("Invalid file");
+      throw new DocumentError.INVALID_FILE (_("Invalid file"));
     d.file = f;
     return d;
   }
diff --git a/gxml/Enumeration.vala b/gxml/Enumeration.vala
index 391db74..e1ba0df 100644
--- a/gxml/Enumeration.vala
+++ b/gxml/Enumeration.vala
@@ -85,7 +85,7 @@ namespace GXml {
                        EnumClass enumc = (EnumClass) enumeration.class_ref ();
                        EnumValue? enumv = enumc.get_value (val);
                        if (enumv == null)
-                               throw new EnumerationError.INVALID_VALUE ("value is invalid");
+                               throw new EnumerationError.INVALID_VALUE (_("value is invalid"));
                        if (use_nick && enumv.value_nick != null)
                                return enumv.value_nick;
                        if (camelcase && enumv.value_nick != null) {
@@ -126,7 +126,7 @@ namespace GXml {
                                        enumv = ev;
                        }
                        if (enumv == null)
-                               throw new EnumerationError.INVALID_TEXT ("text can not been parsed to 
enumeration type:"+enumeration.name ());
+                               throw new EnumerationError.INVALID_TEXT (_("text can not been parsed to 
enumeration type:")+enumeration.name ());
                        return enumv;
                }
                /**
diff --git a/gxml/Serializable.vala b/gxml/Serializable.vala
index 0543adc..a133416 100644
--- a/gxml/Serializable.vala
+++ b/gxml/Serializable.vala
@@ -570,7 +570,7 @@ namespace GXml {
         dest = dest2;
         return true;
       } else {
-        throw new SerializableError.UNSUPPORTED_TYPE_ERROR ("Transformation Error on '%s' or Unsupported 
type: '%s'",
+        throw new SerializableError.UNSUPPORTED_TYPE_ERROR (_("Transformation Error on '%s' or Unsupported 
type: '%s'"),
                                                       str, t.name ());
       }
     }
@@ -612,7 +612,7 @@ namespace GXml {
       }
       else
       {
-        throw new SerializableError.UNSUPPORTED_TYPE_ERROR ("Can't transform '%s' to string", val.type 
().name ());
+        throw new SerializableError.UNSUPPORTED_TYPE_ERROR (_("Can't transform '%s' to string"), val.type 
().name ());
       }
     }
   }
diff --git a/gxml/SerializableGeeArrayList.vala b/gxml/SerializableGeeArrayList.vala
index dced86e..c152af3 100644
--- a/gxml/SerializableGeeArrayList.vala
+++ b/gxml/SerializableGeeArrayList.vala
@@ -136,7 +136,7 @@ public class GXml.SerializableArrayList<G> : Gee.ArrayList<G>, Serializable, Ser
                     throws GLib.Error
   {
     if (!element_type.is_a (typeof (GXml.Serializable))) {
-      throw new SerializableError.UNSUPPORTED_TYPE_ERROR ("%s: Value type '%s' is unsupported", 
+      throw new SerializableError.UNSUPPORTED_TYPE_ERROR (_("%s: Value type '%s' is unsupported"), 
                                                     this.get_type ().name (), element_type.name ());
     }
     if (node is Element) {
diff --git a/gxml/SerializableGeeDualKeyMap.vala b/gxml/SerializableGeeDualKeyMap.vala
index 9df1074..06f6a48 100644
--- a/gxml/SerializableGeeDualKeyMap.vala
+++ b/gxml/SerializableGeeDualKeyMap.vala
@@ -221,7 +221,7 @@ public class GXml.SerializableDualKeyMap<P,S,V> : Object, Serializable, Serializ
 #endif
     if (!(value_type.is_a (typeof (GXml.Serializable)) &&
         value_type.is_a (typeof (SerializableMapDualKey)))) {
-      throw new SerializableError.UNSUPPORTED_TYPE_ERROR ("%s: Value type '%s' is unsupported", 
+      throw new SerializableError.UNSUPPORTED_TYPE_ERROR (_("%s: Value type '%s' is unsupported"), 
                                                     this.get_type ().name (), value_type.name ());
     }
     foreach (GXml.Node n in node.childs) {
diff --git a/gxml/SerializableGeeHashMap.vala b/gxml/SerializableGeeHashMap.vala
index d9e3afb..cc14f2e 100644
--- a/gxml/SerializableGeeHashMap.vala
+++ b/gxml/SerializableGeeHashMap.vala
@@ -134,7 +134,7 @@ public class GXml.SerializableHashMap<K,V> : Gee.HashMap<K,V>, Serializable, Ser
   {
     if (!(value_type.is_a (typeof (GXml.Serializable)) &&
         value_type.is_a (typeof (SerializableMapKey)))) {
-      throw new SerializableError.UNSUPPORTED_TYPE_ERROR ("%s: Value type '%s' is unsupported", 
+      throw new SerializableError.UNSUPPORTED_TYPE_ERROR (_("%s: Value type '%s' is unsupported"), 
                                                     this.get_type ().name (), value_type.name ());
     }
     if (node is Element) {
diff --git a/gxml/SerializableGeeTreeMap.vala b/gxml/SerializableGeeTreeMap.vala
index 18c8c31..a83b5eb 100644
--- a/gxml/SerializableGeeTreeMap.vala
+++ b/gxml/SerializableGeeTreeMap.vala
@@ -137,7 +137,7 @@ public class GXml.SerializableTreeMap<K,V> : Gee.TreeMap<K,V>, Serializable, Ser
   {
     if (!(value_type.is_a (typeof (GXml.Serializable)) &&
         value_type.is_a (typeof (SerializableMapKey)))) {
-      throw new SerializableError.UNSUPPORTED_TYPE_ERROR ("%s: Value type '%s' is unsupported", 
+      throw new SerializableError.UNSUPPORTED_TYPE_ERROR (_("%s: Value type '%s' is unsupported"), 
                                                     this.get_type ().name (), value_type.name ());
     }
     if (node is Element) {
diff --git a/gxml/Serialization.vala b/gxml/Serialization.vala
index 0258d1e..330d3c6 100644
--- a/gxml/Serialization.vala
+++ b/gxml/Serialization.vala
@@ -184,7 +184,7 @@ namespace GXml {
                                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 
());
+                               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 
());
                        }
 
                        return value_node;
@@ -400,7 +400,7 @@ namespace GXml {
                        otype = obj_elem.get_attribute ("otype");
                        type = Type.from_name (otype);
                        if (type == 0) {
-                               throw new SerializationError.UNKNOWN_TYPE ("Deserializing unknown GType '%s' 
objects is unsupported", otype);
+                               throw new SerializationError.UNKNOWN_TYPE (_("Deserializing unknown GType 
'%s' objects is unsupported"), otype);
                        }
                        
                        if (type.is_a (typeof (Serializable))) {
@@ -430,7 +430,7 @@ namespace GXml {
                                        spec = obj_class.find_property (pname);
 
                                        if (spec == null) {
-                                               throw new SerializationError.UNKNOWN_PROPERTY ("Unknown 
property '%s' found, for object type '%s'-->XML: [%s]", pname, otype, obj_elem.stringify ());
+                                               throw new SerializationError.UNKNOWN_PROPERTY (_("Unknown 
property '%s' found, for object type '%s'-->XML: [%s]"), pname, otype, obj_elem.stringify ());
                                        }
                                        Serialization.deserialize_property (spec, prop_elem, out val);
                                        obj.set_property (pname, val);
diff --git a/gxml/libxml-Document.vala b/gxml/libxml-Document.vala
index 6ff4fd1..a160599 100644
--- a/gxml/libxml-Document.vala
+++ b/gxml/libxml-Document.vala
@@ -308,7 +308,7 @@ namespace GXml {
 
                        if (doc == null) {
                                e = Xmlx.parser_context_get_last_error (ctxt);
-                               GXml.warning (DomException.INVALID_DOC, "Could not load document from path: 
%s".printf (e->message));
+                               GXml.warning (DomException.INVALID_DOC, _("Could not load document from path: 
%s").printf (e->message));
                                throw new GXml.Error.PARSER (GXml.libxml2_error_to_string (e));
                        }
 
diff --git a/gxml/libxml-Error.vala b/gxml/libxml-Error.vala
index b155c3d..b458223 100644
--- a/gxml/libxml-Error.vala
+++ b/gxml/libxml-Error.vala
@@ -9,7 +9,7 @@ namespace GXml {
 
        // TODO: replace usage of this with GXml.get_last_error_msg
        internal static string libxml2_error_to_string (Xml.Error *e) {
-               return "%s:%s:%d: %s:%d: %s".printf (
+               return _("%s:%s:%d: %s:%d: %s").printf (
                        e->level.to_string ().replace ("XML_ERR_",""),
                        e->domain.to_string ().replace ("XML_FROM_",""),
                        e->code, e->file == null ? "<io>" : e->file, e->line, e->message);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 43019ab..7b91040 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,9 +3,17 @@ gxml/libxml-ChildNodeList.c
 gxml/SerializableEnum.c
 gxml/SerializableEnum.c
 gxml/libxml-Document.c
+gxml/libxml-Error.c
 gxml/libxml-Entity.c
 gxml/libxml-Node.c
+gxml/Serializable.c
+gxml/SerializableGeeArrayList.c
+gxml/SerializableGeeDualKeyMap.c
+gxml/SerializableGeeHashMap.c
+gxml/SerializableGeeTreeMap.c
 gxml/SerializableObjectModel.c
 gxml/SerializableProperty.c
 gxml/Node.c
 gxml/Serialization.c
+gxml/Document.c
+gxml/Enumeration.c


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