[vala/wip/gettext: 49/53] codegen: Mark Report.error/warning strings as translatable



commit 7d9489b1f7e6e3cbfc3666b6870710dba463e972
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Aug 8 10:20:51 2018 +0200

    codegen: Mark Report.error/warning strings as translatable

 codegen/valaccodearraymodule.vala        |  4 +--
 codegen/valaccodeassignmentmodule.vala   |  2 +-
 codegen/valaccodeattribute.vala          | 12 ++++-----
 codegen/valaccodebasemodule.vala         | 44 ++++++++++++++++----------------
 codegen/valaccodedelegatemodule.vala     |  2 +-
 codegen/valaccodememberaccessmodule.vala |  6 ++---
 codegen/valaccodestructmodule.vala       |  2 +-
 codegen/valagdbusclientmodule.vala       |  6 ++---
 codegen/valagdbusservermodule.vala       |  4 +--
 codegen/valagirwriter.vala               |  6 ++---
 codegen/valagobjectmodule.vala           | 16 ++++++------
 codegen/valagsignalmodule.vala           | 14 +++++-----
 codegen/valagtkmodule.vala               | 26 +++++++++----------
 codegen/valagtypemodule.vala             | 10 ++++----
 codegen/valagvariantmodule.vala          |  4 +--
 15 files changed, 79 insertions(+), 79 deletions(-)
---
diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala
index cd9377512..5e3afc335 100644
--- a/codegen/valaccodearraymodule.vala
+++ b/codegen/valaccodearraymodule.vala
@@ -169,7 +169,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                                int dim = int.parse (lit.value);
                                set_cvalue (expr, get_array_length_cexpression (memberaccess.inner, dim + 1));
                        } else {
-                               Report.error (expr.source_reference, "only integer literals supported as 
index");
+                               Report.error (expr.source_reference, _("only integer literals supported as 
index"));
                        }
                } else {
                        // access to element in an array
@@ -699,7 +699,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                    && (array_var is LocalVariable || array_var is Field)) {
                        // valid array add
                } else {
-                       Report.error (assignment.source_reference, "Array concatenation not supported for 
public array variables and parameters");
+                       Report.error (assignment.source_reference, _("Array concatenation not supported for 
public array variables and parameters"));
                        return;
                }
 
diff --git a/codegen/valaccodeassignmentmodule.vala b/codegen/valaccodeassignmentmodule.vala
index c8f24383e..7817ce2da 100644
--- a/codegen/valaccodeassignmentmodule.vala
+++ b/codegen/valaccodeassignmentmodule.vala
@@ -153,7 +153,7 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
                                if (rvalue_target != null) {
                                        ccode.add_assignment (lvalue_target, rvalue_target);
                                } else {
-                                       Report.error (source_reference, "Assigning delegate without required 
target in scope");
+                                       Report.error (source_reference, _("Assigning delegate without 
required target in scope"));
                                        ccode.add_assignment (lvalue_target, new CCodeInvalidExpression ());
                                }
                                var lvalue_destroy_notify = get_delegate_target_destroy_notify_cvalue 
(lvalue);
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala
index b6f60498c..1f04fa2ea 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -651,7 +651,7 @@ public class Vala.CCodeAttribute : AttributeCache {
                                        cname = "%s%s".printf (get_ccode_lower_case_prefix 
(sym.parent_symbol), sym.name);
                                }
                                if (cname[0].isdigit ()) {
-                                       Report.error (node.source_reference, "Field name starts with a digit. 
Use the `cname' attribute to provide a valid C name if intended");
+                                       Report.error (node.source_reference, _("Field name starts with a 
digit. Use the `cname' attribute to provide a valid C name if intended"));
                                        return "";
                                }
                                return cname;
@@ -778,7 +778,7 @@ public class Vala.CCodeAttribute : AttributeCache {
                } else if (node is CType) {
                        return ((CType) node).ctype_name;
                } else {
-                       Report.error (node.source_reference, "Unresolved type reference");
+                       Report.error (node.source_reference, _("Unresolved type reference"));
                        return "";
                }
        }
@@ -1021,7 +1021,7 @@ public class Vala.CCodeAttribute : AttributeCache {
                                        }
                                }
                                if (st.is_simple_type ()) {
-                                       Report.error (st.source_reference, "The type `%s' doesn't declare a 
marshaller type name".printf (st.get_full_name ()));
+                                       Report.error (st.source_reference, _("The type `%s' doesn't declare a 
marshaller type name").printf (st.get_full_name ()));
                                } else if (get_ccode_has_type_id (st)) {
                                        return "BOXED";
                                } else {
@@ -1107,7 +1107,7 @@ public class Vala.CCodeAttribute : AttributeCache {
                                }
                        }
                        if (st.is_simple_type ()) {
-                               Report.error (st.source_reference, "The type `%s' doesn't declare a GValue 
get function".printf (st.get_full_name ()));
+                               Report.error (st.source_reference, _("The type `%s' doesn't declare a GValue 
get function").printf (st.get_full_name ()));
                        } else if (get_ccode_has_type_id (st)) {
                                return "g_value_get_boxed";
                        } else {
@@ -1165,7 +1165,7 @@ public class Vala.CCodeAttribute : AttributeCache {
                                }
                        }
                        if (st.is_simple_type ()) {
-                               Report.error (st.source_reference, "The type `%s' doesn't declare a GValue 
set function".printf (st.get_full_name ()));
+                               Report.error (st.source_reference, _("The type `%s' doesn't declare a GValue 
set function").printf (st.get_full_name ()));
                        } else if (get_ccode_has_type_id (st)) {
                                return "g_value_set_boxed";
                        } else {
@@ -1223,7 +1223,7 @@ public class Vala.CCodeAttribute : AttributeCache {
                                }
                        }
                        if (st.is_simple_type ()) {
-                               Report.error (st.source_reference, "The type `%s' doesn't declare a GValue 
take function".printf (st.get_full_name ()));
+                               Report.error (st.source_reference, _("The type `%s' doesn't declare a GValue 
take function").printf (st.get_full_name ()));
                        } else if (get_ccode_has_type_id (st)) {
                                return "g_value_take_boxed";
                        } else {
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 2bcbc09be..ccc2bbd44 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -525,7 +525,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                if (context.symbols_filename != null) {
                        var stream = FileStream.open (context.symbols_filename, "w");
                        if (stream == null) {
-                               Report.error (null, "unable to open `%s' for writing".printf 
(context.symbols_filename));
+                               Report.error (null, _("unable to open `%s' for writing").printf 
(context.symbols_filename));
                                this.context = null;
                                return;
                        }
@@ -547,7 +547,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                ret = header_file.store (context.header_filename, null, 
context.version_header, false);
                        }
                        if (!ret) {
-                               Report.error (null, "unable to open `%s' for writing".printf 
(context.header_filename));
+                               Report.error (null, _("unable to open `%s' for writing").printf 
(context.header_filename));
                        }
                }
 
@@ -560,7 +560,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                ret = internal_header_file.store (context.internal_header_filename, null, 
context.version_header, false);
                        }
                        if (!ret) {
-                               Report.error (null, "unable to open `%s' for writing".printf 
(context.internal_header_filename));
+                               Report.error (null, _("unable to open `%s' for writing").printf 
(context.internal_header_filename));
                        }
                }
 
@@ -802,7 +802,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                }
 
                if (!cfile.store (source_file.get_csource_filename (), source_file.filename, 
context.version_header, context.debug)) {
-                       Report.error (null, "unable to open `%s' for writing".printf 
(source_file.get_csource_filename ()));
+                       Report.error (null, _("unable to open `%s' for writing").printf 
(source_file.get_csource_filename ()));
                }
 
                cfile = null;
@@ -1199,7 +1199,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        }
                } else if (f.binding == MemberBinding.CLASS)  {
                        if (!is_gtypeinstance) {
-                               Report.error (f.source_reference, "class fields are not supported in compact 
classes");
+                               Report.error (f.source_reference, _("class fields are not supported in 
compact classes"));
                                f.error = true;
                                return;
                        }
@@ -1373,7 +1373,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                                        }
                                                } else {
                                                        f.error = true;
-                                                       Report.error (f.source_reference, "Non-constant field 
initializers not supported in this context");
+                                                       Report.error (f.source_reference, _("Non-constant 
field initializers not supported in this context"));
                                                        return;
                                                }
                                        }
@@ -1595,11 +1595,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                var t = (TypeSymbol) prop.parent_symbol;
 
                if (acc.construction && !t.is_subtype_of (gobject_type)) {
-                       Report.error (acc.source_reference, "construct properties require GLib.Object");
+                       Report.error (acc.source_reference, _("construct properties require GLib.Object"));
                        acc.error = true;
                        return;
                } else if (acc.construction && !is_gobject_property (prop)) {
-                       Report.error (acc.source_reference, "construct properties not supported for specified 
property type");
+                       Report.error (acc.source_reference, _("construct properties not supported for 
specified property type"));
                        acc.error = true;
                        return;
                }
@@ -1883,7 +1883,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
        public override void visit_destructor (Destructor d) {
                if (d.binding == MemberBinding.STATIC && !in_plugin) {
-                       Report.error (d.source_reference, "static destructors are only supported for dynamic 
types");
+                       Report.error (d.source_reference, _("static destructors are only supported for 
dynamic types"));
                        d.error = true;
                        return;
                }
@@ -2639,7 +2639,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        void require_generic_accessors (Interface iface) {
                if (iface.get_attribute ("GenericAccessors") == null) {
                        Report.error (iface.source_reference,
-                                     "missing generic type for interface `%s', add GenericAccessors 
attribute to interface declaration"
+                                     _("missing generic type for interface `%s', add GenericAccessors 
attribute to interface declaration")
                                      .printf (iface.get_full_name ()));
                }
        }
@@ -2686,7 +2686,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        if (is_reference_counting (type.data_type)) {
                                dup_function = get_ccode_ref_function ((ObjectTypeSymbol) type.data_type);
                                if (type.data_type is Interface && dup_function == null) {
-                                       Report.error (source_reference, "missing class prerequisite for 
interface `%s', add GLib.Object to interface declaration if unsure".printf (type.data_type.get_full_name ()));
+                                       Report.error (source_reference, _("missing class prerequisite for 
interface `%s', add GLib.Object to interface declaration if unsure").printf (type.data_type.get_full_name 
()));
                                        return new CCodeInvalidExpression();
                                }
                        } else if (cl != null && cl.is_immutable) {
@@ -2710,7 +2710,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                }
                        } else {
                                // duplicating non-reference counted objects may cause side-effects (and 
performance issues)
-                               Report.error (source_reference, "duplicating %s instance, use unowned 
variable or explicitly invoke copy method".printf (type.data_type.name));
+                               Report.error (source_reference, _("duplicating %s instance, use unowned 
variable or explicitly invoke copy method").printf (type.data_type.name));
                                return new CCodeInvalidExpression();
                        }
 
@@ -3184,7 +3184,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                if (is_reference_counting (type.data_type)) {
                                        unref_function = get_ccode_unref_function ((ObjectTypeSymbol) 
type.data_type);
                                        if (type.data_type is Interface && unref_function == null) {
-                                               Report.error (type.source_reference, "missing class 
prerequisite for interface `%s', add GLib.Object to interface declaration if unsure".printf 
(type.data_type.get_full_name ()));
+                                               Report.error (type.source_reference, _("missing class 
prerequisite for interface `%s', add GLib.Object to interface declaration if unsure").printf 
(type.data_type.get_full_name ()));
                                                return null;
                                        }
                                } else {
@@ -4593,9 +4593,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                                }
                                                int nParams = ccode.get_parameter_count ();
                                                if (nParams == 0 || !ccode.get_parameter (nParams - 
1).ellipsis) {
-                                                       Report.error (expr.source_reference, "`va_list' used 
in method with fixed args");
+                                                       Report.error (expr.source_reference, _("`va_list' 
used in method with fixed args"));
                                                } else if (nParams == 1) {
-                                                       Report.error (expr.source_reference, "`va_list' used 
in method without parameter");
+                                                       Report.error (expr.source_reference, _("`va_list' 
used in method without parameter"));
                                                } else {
                                                        creation_call.add_argument (new CCodeIdentifier 
(ccode.get_parameter (nParams - 2).name));
                                                }
@@ -5159,7 +5159,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        if (expr.is_silent_cast) {
                                set_cvalue (expr, new CCodeInvalidExpression ());
                                expr.error = true;
-                               Report.error (expr.source_reference, "Operation not supported for this type");
+                               Report.error (expr.source_reference, _("Operation not supported for this 
type"));
                                return;
                        }
 
@@ -5640,7 +5640,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                }
 
                if (get_cvalue (expr) is CCodeInvalidExpression) {
-                       Report.error (expr.source_reference, "type check expressions not supported for 
compact classes, structs, and enums");
+                       Report.error (expr.source_reference, _("type check expressions not supported for 
compact classes, structs, and enums"));
                }
        }
 
@@ -5738,7 +5738,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                        ccode.close ();
                                }
                        } else {
-                               Report.error (node.source_reference, "type `%s' does not support floating 
references".printf (type.data_type.name));
+                               Report.error (node.source_reference, _("type `%s' does not support floating 
references").printf (type.data_type.name));
                        }
                }
 
@@ -5809,7 +5809,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        }
                        var type_id = get_ccode_type_id (type);
                        if (type_id == "") {
-                               Report.error (node.source_reference, "GValue boxing of type `%s' is not 
supported".printf (type.to_string ()));
+                               Report.error (node.source_reference, _("GValue boxing of type `%s' is not 
supported").printf (type.to_string ()));
                        }
                        ccall.add_argument (new CCodeIdentifier (type_id));
                        ccode.add_expression (ccall);
@@ -5909,7 +5909,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        // need to copy value
                        var copy = (GLibValue) copy_value (result, node);
                        if (target_type.data_type is Interface && copy == null) {
-                               Report.error (node.source_reference, "missing class prerequisite for 
interface `%s', add GLib.Object to interface declaration if unsure".printf 
(target_type.data_type.get_full_name ()));
+                               Report.error (node.source_reference, _("missing class prerequisite for 
interface `%s', add GLib.Object to interface declaration if unsure").printf 
(target_type.data_type.get_full_name ()));
                                return result;
                        }
                        result = copy;
@@ -6348,12 +6348,12 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public virtual string get_dynamic_property_getter_cname (DynamicProperty node) {
-               Report.error (node.source_reference, "dynamic properties are not supported for %s".printf 
(node.dynamic_type.to_string ()));
+               Report.error (node.source_reference, _("dynamic properties are not supported for %s").printf 
(node.dynamic_type.to_string ()));
                return "";
        }
 
        public virtual string get_dynamic_property_setter_cname (DynamicProperty node) {
-               Report.error (node.source_reference, "dynamic properties are not supported for %s".printf 
(node.dynamic_type.to_string ()));
+               Report.error (node.source_reference, _("dynamic properties are not supported for %s").printf 
(node.dynamic_type.to_string ()));
                return "";
        }
 
diff --git a/codegen/valaccodedelegatemodule.vala b/codegen/valaccodedelegatemodule.vala
index 042e2be05..3a08b268f 100644
--- a/codegen/valaccodedelegatemodule.vala
+++ b/codegen/valaccodedelegatemodule.vala
@@ -301,7 +301,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
                        } else {
                                // use first delegate parameter as instance
                                if (d_params.size == 0 || m.closure) {
-                                       Report.error (node != null ? node.source_reference : null, "Cannot 
create delegate without target for instance method or closure");
+                                       Report.error (node != null ? node.source_reference : null, _("Cannot 
create delegate without target for instance method or closure"));
                                        arg = new CCodeConstant ("NULL");
                                } else {
                                        arg = new CCodeIdentifier (get_variable_cname (d_params.get 
(0).name));
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 400448643..af8577659 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -110,7 +110,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                        }
                } else if (expr.symbol_reference is ArrayLengthField) {
                        if (expr.value_type is ArrayType && !(expr.parent_node is ElementAccess)) {
-                               Report.error (expr.source_reference, "unsupported use of length field of 
multi-dimensional array");
+                               Report.error (expr.source_reference, _("unsupported use of length field of 
multi-dimensional array"));
                        }
                        set_cvalue (expr, get_array_length_cexpression (expr.inner, 1));
                } else if (expr.symbol_reference is Field) {
@@ -295,7 +295,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                                        var owned_value_type = prop.get_accessor.value_type.copy ();
                                        owned_value_type.value_owned = true;
                                        if (requires_copy (owned_value_type)) {
-                                               Report.error (prop.get_accessor.source_reference, "unowned 
return value for getter of property `%s' not supported without accessor".printf (prop.get_full_name ()));
+                                               Report.error (prop.get_accessor.source_reference, _("unowned 
return value for getter of property `%s' not supported without accessor").printf (prop.get_full_name ()));
                                        }
                                }
 
@@ -582,7 +582,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
 
                        if (inst == null) {
                                // FIXME Report this with proper source-reference on the vala side!
-                               Report.error (field.source_reference, "Invalid access to instance member 
`%s'".printf (field.get_full_name ()));
+                               Report.error (field.source_reference, _("Invalid access to instance member 
`%s'").printf (field.get_full_name ()));
                                result.cvalue = new CCodeInvalidExpression ();
                                return result;
                        }
diff --git a/codegen/valaccodestructmodule.vala b/codegen/valaccodestructmodule.vala
index d9237e656..1c068825b 100644
--- a/codegen/valaccodestructmodule.vala
+++ b/codegen/valaccodestructmodule.vala
@@ -162,7 +162,7 @@ public abstract class Vala.CCodeStructModule : CCodeBaseModule {
 
                if (get_ccode_has_type_id (st) && get_ccode_name (st).length < 3) {
                        st.error = true;
-                       Report.error (st.source_reference, "Name `%s' is too short for struct using 
GType".printf (get_ccode_name (st)));
+                       Report.error (st.source_reference, _("Name `%s' is too short for struct using 
GType").printf (get_ccode_name (st)));
                        return;
                }
 
diff --git a/codegen/valagdbusclientmodule.vala b/codegen/valagdbusclientmodule.vala
index 32a45de21..cd0050660 100644
--- a/codegen/valagdbusclientmodule.vala
+++ b/codegen/valagdbusclientmodule.vala
@@ -57,7 +57,7 @@ public class Vala.GDBusClientModule : GDBusModule {
                if (dynamic_method.dynamic_type.data_type == dbus_proxy_type) {
                        generate_marshalling (method, CallType.SYNC, null, method.name, -1);
                } else {
-                       Report.error (method.source_reference, "dynamic methods are not supported for 
`%s'".printf (dynamic_method.dynamic_type.to_string ()));
+                       Report.error (method.source_reference, _("dynamic methods are not supported for 
`%s'").printf (dynamic_method.dynamic_type.to_string ()));
                }
 
                pop_function ();
@@ -266,7 +266,7 @@ public class Vala.GDBusClientModule : GDBusModule {
                        var iface = (Interface) object_type.type_symbol;
 
                        if (get_dbus_name (iface) == null) {
-                               Report.error (expr.source_reference, "`%s' is not a D-Bus interface".printf 
(iface.get_full_name ()));
+                               Report.error (expr.source_reference, _("`%s' is not a D-Bus 
interface").printf (iface.get_full_name ()));
                                return;
                        }
 
@@ -957,7 +957,7 @@ public class Vala.GDBusClientModule : GDBusModule {
                var owned_type = prop.get_accessor.value_type.copy ();
                owned_type.value_owned = true;
                if (owned_type.is_disposable () && !prop.get_accessor.value_type.value_owned) {
-                       Report.error (prop.get_accessor.value_type.source_reference, "Properties used in 
D-Bus clients require owned get accessor");
+                       Report.error (prop.get_accessor.value_type.source_reference, _("Properties used in 
D-Bus clients require owned get accessor"));
                }
 
                var array_type = prop.get_accessor.value_type as ArrayType;
diff --git a/codegen/valagdbusservermodule.vala b/codegen/valagdbusservermodule.vala
index e1984e24f..73a94f758 100644
--- a/codegen/valagdbusservermodule.vala
+++ b/codegen/valagdbusservermodule.vala
@@ -995,7 +995,7 @@ public class Vala.GDBusServerModule : GDBusClientModule {
                var object_type = type_arg as ObjectType;
                if (object_type != null) {
                        if (get_dbus_name (object_type.type_symbol) == null) {
-                               Report.error (expr.source_reference, "DBusConnection.register_object requires 
type argument with [DBus (name = ...)] attribute");
+                               Report.error (expr.source_reference, _("DBusConnection.register_object 
requires type argument with [DBus (name = ...)] attribute"));
                                return;
                        }
 
@@ -1119,7 +1119,7 @@ public class Vala.GDBusServerModule : GDBusClientModule {
 
                var ref_function = get_ccode_ref_function (sym);
                if (sym is Interface && ref_function == null) {
-                       Report.error (sym.source_reference, "missing class prerequisite for interface `%s', 
add GLib.Object to interface declaration if unsure".printf (sym.get_full_name ()));
+                       Report.error (sym.source_reference, _("missing class prerequisite for interface `%s', 
add GLib.Object to interface declaration if unsure").printf (sym.get_full_name ()));
                        return;
                }
 
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 7c2ebc7f0..2d861ccc2 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -164,7 +164,7 @@ public class Vala.GIRWriter : CodeVisitor {
                string filename = "%s%c%s".printf (directory, Path.DIR_SEPARATOR, gir_filename);
                stream = FileStream.open (filename, "w");
                if (stream == null) {
-                       Report.error (null, "unable to open `%s' for writing".printf (filename));
+                       Report.error (null, _("unable to open `%s' for writing").printf (filename));
                        this.context = null;
                        return;
                }
@@ -186,7 +186,7 @@ public class Vala.GIRWriter : CodeVisitor {
 
                foreach (var ns in unannotated_namespaces) {
                        if (!our_namespaces.contains(ns)) {
-                               Report.warning (ns.source_reference, "Namespace %s does not have a GIR 
namespace and version annotation".printf (ns.name));
+                               Report.warning (ns.source_reference, _("Namespace %s does not have a GIR 
namespace and version annotation".printf (ns.name)));
                        }
                }
                foreach (var ns in our_namespaces) {
@@ -195,7 +195,7 @@ public class Vala.GIRWriter : CodeVisitor {
                }
 
                if (our_namespaces.size == 0) {
-                       Report.error (null, "No suitable namespace found to export for GIR");
+                       Report.error (null, _("No suitable namespace found to export for GIR"));
                }
 
                this.context = null;
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index ad808a138..5fe0cdcc6 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -136,7 +136,7 @@ public class Vala.GObjectModule : GTypeModule {
                foreach (Property prop in props) {
                        if (!is_gobject_property (prop)) {
                                if (!has_valid_gobject_property_type (prop)) {
-                                       Report.warning (prop.source_reference, "Type `%s' can not be used for 
a GLib.Object property".printf (prop.property_type.to_qualified_string ()));
+                                       Report.warning (prop.source_reference, _("Type `%s' can not be used 
for a GLib.Object property".printf (prop.property_type.to_qualified_string ())));
                                }
                                continue;
                        }
@@ -433,7 +433,7 @@ public class Vala.GObjectModule : GTypeModule {
 
                if (c.binding == MemberBinding.INSTANCE) {
                        if (!cl.is_subtype_of (gobject_type)) {
-                               Report.error (c.source_reference, "construct blocks require GLib.Object");
+                               Report.error (c.source_reference, _("construct blocks require GLib.Object"));
                                c.error = true;
                                return;
                        }
@@ -489,7 +489,7 @@ public class Vala.GObjectModule : GTypeModule {
                        // class constructor
 
                        if (cl.is_compact) {
-                               Report.error (c.source_reference, "class constructors are not supported in 
compact classes");
+                               Report.error (c.source_reference, _("class constructors are not supported in 
compact classes"));
                                c.error = true;
                                return;
                        }
@@ -511,7 +511,7 @@ public class Vala.GObjectModule : GTypeModule {
                        // add to class_init
 
                        if (cl.is_compact) {
-                               Report.error (c.source_reference, "static constructors are not supported in 
compact classes");
+                               Report.error (c.source_reference, _("static constructors are not supported in 
compact classes"));
                                c.error = true;
                                return;
                        }
@@ -777,20 +777,20 @@ public class Vala.GObjectModule : GTypeModule {
                                foreach (var arg in expr.get_argument_list ()) {
                                        var named_argument = arg as NamedArgument;
                                        if (named_argument == null) {
-                                               Report.error (arg.source_reference, "Named argument 
expected");
+                                               Report.error (arg.source_reference, _("Named argument 
expected"));
                                                break;
                                        }
                                        var prop = SemanticAnalyzer.symbol_lookup_inherited (current_class, 
named_argument.name) as Property;
                                        if (prop == null) {
-                                               Report.error (arg.source_reference, "Property `%s' not found 
in `%s'".printf (named_argument.name, current_class.get_full_name ()));
+                                               Report.error (arg.source_reference, _("Property `%s' not 
found in `%s'").printf (named_argument.name, current_class.get_full_name ()));
                                                break;
                                        }
                                        if (!is_gobject_property (prop)) {
-                                               Report.error (arg.source_reference, "Property `%s' not 
supported in Object (property: value) constructor chain up".printf (named_argument.name));
+                                               Report.error (arg.source_reference, _("Property `%s' not 
supported in Object (property: value) constructor chain up").printf (named_argument.name));
                                                break;
                                        }
                                        if (!arg.value_type.compatible (prop.property_type)) {
-                                               Report.error (arg.source_reference, "Cannot convert from `%s' 
to `%s'".printf (arg.value_type.to_string (), prop.property_type.to_string ()));
+                                               Report.error (arg.source_reference, _("Cannot convert from 
`%s' to `%s'").printf (arg.value_type.to_string (), prop.property_type.to_string ()));
                                                break;
                                        }
                                }
diff --git a/codegen/valagsignalmodule.vala b/codegen/valagsignalmodule.vala
index f9a3b9faf..395506a25 100644
--- a/codegen/valagsignalmodule.vala
+++ b/codegen/valagsignalmodule.vala
@@ -114,7 +114,7 @@ public class Vala.GSignalModule : GObjectModule {
 
                if (detail_expr.value_type is NullType || !detail_expr.value_type.compatible (string_type)) {
                        node.error = true;
-                       Report.error (detail_expr.source_reference, "only string details are supported");
+                       Report.error (detail_expr.source_reference, _("only string details are supported"));
                        return null;
                }
 
@@ -145,7 +145,7 @@ public class Vala.GSignalModule : GObjectModule {
        private CCodeExpression? get_detail_cexpression (Expression detail_expr, CodeNode node) {
                if (detail_expr.value_type is NullType || !detail_expr.value_type.compatible (string_type)) {
                        node.error = true;
-                       Report.error (detail_expr.source_reference, "only string details are supported");
+                       Report.error (detail_expr.source_reference, _("only string details are supported"));
                        return null;
                }
 
@@ -167,7 +167,7 @@ public class Vala.GSignalModule : GObjectModule {
                var cl = sig.parent_symbol as Class;
                if (cl != null && cl.is_compact) {
                        sig.error = true;
-                       Report.error (sig.source_reference, "Signals are not supported in compact classes");
+                       Report.error (sig.source_reference, _("Signals are not supported in compact 
classes"));
                        return;
                }
 
@@ -175,7 +175,7 @@ public class Vala.GSignalModule : GObjectModule {
                        foreach (DataType base_type in cl.get_base_types ()) {
                                if (SemanticAnalyzer.symbol_lookup_inherited (base_type.data_type, sig.name) 
is Signal) {
                                        sig.error = true;
-                                       Report.error (sig.source_reference, "Signals with the same name as a 
signal in a base type are not supported");
+                                       Report.error (sig.source_reference, _("Signals with the same name as 
a signal in a base type are not supported"));
                                        return;
                                }
                        }
@@ -507,7 +507,7 @@ public class Vala.GSignalModule : GObjectModule {
                        disconnect = true;
                } else {
                        assignment.error = true;
-                       Report.error (assignment.source_reference, "Specified compound assignment type for 
signals not supported.");
+                       Report.error (assignment.source_reference, _("Specified compound assignment type for 
signals not supported."));
                        return;
                }
 
@@ -610,7 +610,7 @@ public class Vala.GSignalModule : GObjectModule {
                if (p != null) {
                        dt = p.variable_type as DelegateType;
                        if (dt != null && !context.experimental) {
-                               Report.warning (dt.source_reference, "Connecting delegates to signals is 
experimental");
+                               Report.warning (dt.source_reference, _("Connecting delegates to signals is 
experimental"));
                        }
                }
                var m = handler.symbol_reference as Method;
@@ -635,7 +635,7 @@ public class Vala.GSignalModule : GObjectModule {
                } else {
                        // disconnect
                        if (handler is LambdaExpression) {
-                               Report.error (handler.source_reference, "Cannot disconnect lambda expression 
from signal. Use Object.disconnect.");
+                               Report.error (handler.source_reference, _("Cannot disconnect lambda 
expression from signal. Use Object.disconnect."));
                        }
                        if (sig is DynamicSignal) {
                                connect_func = get_dynamic_signal_disconnect_wrapper_name ((DynamicSignal) 
sig);
diff --git a/codegen/valagtkmodule.vala b/codegen/valagtkmodule.vala
index da0fe9905..53780c2a4 100644
--- a/codegen/valagtkmodule.vala
+++ b/codegen/valagtkmodule.vala
@@ -94,7 +94,7 @@ public class Vala.GtkModule : GSignalModule {
                gresource_to_file_map = new HashMap<string, string>(str_hash, str_equal);
                foreach (var gresource in context.gresources) {
                        if (!FileUtils.test (gresource, FileTest.EXISTS)) {
-                               Report.error (null, "GResources file `%s' does not exist".printf (gresource));
+                               Report.error (null, _("GResources file `%s' does not exist").printf 
(gresource));
                                continue;
                        }
 
@@ -137,7 +137,7 @@ public class Vala.GtkModule : GSignalModule {
                var ui_file = gresource_to_file_map.get (ui_resource);
                if (ui_file == null || !FileUtils.test (ui_file, FileTest.EXISTS)) {
                        node.error = true;
-                       Report.error (node.source_reference, "UI resource not found: `%s'. Please make sure 
to specify the proper GResources xml files with --gresources and alternative search locations with 
--gresourcesdir.".printf (ui_resource));
+                       Report.error (node.source_reference, _("UI resource not found: `%s'. Please make sure 
to specify the proper GResources xml files with --gresources and alternative search locations with 
--gresourcesdir.").printf (ui_resource));
                        return;
                }
                current_handler_to_signal_map = new HashMap<string, Signal>(str_hash, str_equal);
@@ -165,7 +165,7 @@ public class Vala.GtkModule : GSignalModule {
                                if (current_class == null) {
                                        var class_name = reader.get_attribute ("class");
                                        if (class_name == null) {
-                                               Report.error (node.source_reference, "Invalid %s in ui file 
`%s'".printf (current_name, ui_file));
+                                               Report.error (node.source_reference, _("Invalid %s in ui file 
`%s'").printf (current_name, ui_file));
                                                current_token = reader.read_token (null, null);
                                                continue;
                                        }
@@ -184,7 +184,7 @@ public class Vala.GtkModule : GSignalModule {
 
                                if (current_class != null) {
                                        if (signal_name == null || handler_name == null) {
-                                               Report.error (node.source_reference, "Invalid signal in ui 
file `%s'".printf (ui_file));
+                                               Report.error (node.source_reference, _("Invalid signal in ui 
file `%s'").printf (ui_file));
                                                current_token = reader.read_token (null, null);
                                                continue;
                                        }
@@ -204,7 +204,7 @@ public class Vala.GtkModule : GSignalModule {
                }
 
                if (!template_tag_found) {
-                       Report.error (node.source_reference, "ui resource `%s' does not describe a valid 
composite template".printf (ui_resource));
+                       Report.error (node.source_reference, _("ui resource `%s' does not describe a valid 
composite template").printf (ui_resource));
                }
        }
 
@@ -213,7 +213,7 @@ public class Vala.GtkModule : GSignalModule {
                if (attr != null) {
                        if (gtk_widget_type == null || !cl.is_subtype_of (gtk_widget_type)) {
                                if (!cl.error) {
-                                       Report.error (attr.source_reference, "subclassing Gtk.Widget is 
required for using Gtk templates");
+                                       Report.error (attr.source_reference, _("subclassing Gtk.Widget is 
required for using Gtk templates"));
                                        cl.error = true;
                                }
                                return false;
@@ -233,7 +233,7 @@ public class Vala.GtkModule : GSignalModule {
                /* Gtk builder widget template */
                var ui = cl.get_attribute_string ("GtkTemplate", "ui");
                if (ui == null) {
-                       Report.error (cl.source_reference, "empty ui resource declaration for Gtk widget 
template");
+                       Report.error (cl.source_reference, _("empty ui resource declaration for Gtk widget 
template"));
                        cl.error = true;
                        return;
                }
@@ -250,7 +250,7 @@ public class Vala.GtkModule : GSignalModule {
 
        public override void visit_property (Property prop) {
                if (prop.get_attribute ("GtkChild") != null && prop.field == null) {
-                       Report.error (prop.source_reference, "[GtkChild] is only allowed on automatic 
properties");
+                       Report.error (prop.source_reference, _("[GtkChild] is only allowed on automatic 
properties"));
                }
 
                base.visit_property (prop);
@@ -271,7 +271,7 @@ public class Vala.GtkModule : GSignalModule {
                /* If the field has a [GtkChild] attribute but its class doesn'thave a
                         [GtkTemplate] attribute, we throw an error */
                if (!is_gtk_template (cl)) {
-                       Report.error (f.source_reference, "[GtkChild] is only allowed in classes with a 
[GtkTemplate] attribute");
+                       Report.error (f.source_reference, _("[GtkChild] is only allowed in classes with a 
[GtkTemplate] attribute"));
                        return;
                }
 
@@ -281,14 +281,14 @@ public class Vala.GtkModule : GSignalModule {
                var gtk_name = f.get_attribute_string ("GtkChild", "name", f.name);
                var child_class = current_child_to_class_map.get (gtk_name);
                if (child_class == null) {
-                       Report.error (f.source_reference, "could not find child `%s'".printf (gtk_name));
+                       Report.error (f.source_reference, _("could not find child `%s'").printf (gtk_name));
                        return;
                }
 
                /* We allow Gtk child to have stricter type than class field */
                var field_class = f.variable_type.data_type as Class;
                if (field_class == null || !child_class.is_subtype_of (field_class)) {
-                       Report.error (f.source_reference, "cannot convert from Gtk child type `%s' to 
`%s'".printf (child_class.get_full_name(), field_class.get_full_name()));
+                       Report.error (f.source_reference, _("cannot convert from Gtk child type `%s' to 
`%s'").printf (child_class.get_full_name(), field_class.get_full_name()));
                        return;
                }
 
@@ -338,7 +338,7 @@ public class Vala.GtkModule : GSignalModule {
                var handler_name = m.get_attribute_string ("GtkCallback", "name", m.name);
                var sig = current_handler_to_signal_map.get (handler_name);
                if (sig == null) {
-                       Report.error (m.source_reference, "could not find signal for handler `%s'".printf 
(handler_name));
+                       Report.error (m.source_reference, _("could not find signal for handler `%s'").printf 
(handler_name));
                        return;
                }
 
@@ -350,7 +350,7 @@ public class Vala.GtkModule : GSignalModule {
                        var signal_type = new SignalType (sig);
                        var delegate_type = signal_type.get_handler_type ();
                        if (!method_type.compatible (delegate_type)) {
-                               Report.error (m.source_reference, "method `%s' is incompatible with signal 
`%s', expected `%s'".printf (method_type.to_string (), delegate_type.to_string (), 
delegate_type.to_prototype_string (m.name)));
+                               Report.error (m.source_reference, _("method `%s' is incompatible with signal 
`%s', expected `%s'").printf (method_type.to_string (), delegate_type.to_string (), 
delegate_type.to_prototype_string (m.name)));
                        } else {
                                var wrapper = generate_delegate_wrapper (m, signal_type.get_handler_type (), 
m);
 
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 4b39cbbee..700dcad1f 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -615,7 +615,7 @@ public class Vala.GTypeModule : GErrorModule {
                        }
                } else {
                        if (cl.has_private_fields) {
-                               Report.error (cl.source_reference, "Private fields not supported in compact 
classes");
+                               Report.error (cl.source_reference, _("Private fields not supported in compact 
classes"));
                        }
                }
        }
@@ -640,7 +640,7 @@ public class Vala.GTypeModule : GErrorModule {
 
                if (get_ccode_name (cl).length < 3) {
                        cl.error = true;
-                       Report.error (cl.source_reference, "Class name `%s' is too short".printf 
(get_ccode_name (cl)));
+                       Report.error (cl.source_reference, _("Class name `%s' is too short").printf 
(get_ccode_name (cl)));
                        return;
                }
 
@@ -2216,7 +2216,7 @@ public class Vala.GTypeModule : GErrorModule {
 
                if (get_ccode_name (iface).length < 3) {
                        iface.error = true;
-                       Report.error (iface.source_reference, "Interface name `%s' is too short".printf 
(get_ccode_name (iface)));
+                       Report.error (iface.source_reference, _("Interface name `%s' is too short").printf 
(get_ccode_name (iface)));
                        return;
                }
 
@@ -2412,13 +2412,13 @@ public class Vala.GTypeModule : GErrorModule {
                }
 
                if (cl != null && cl.is_compact && (prop.get_accessor == null || 
prop.get_accessor.automatic_body)) {
-                       Report.error (prop.source_reference, "Properties without accessor bodies are not 
supported in compact classes");
+                       Report.error (prop.source_reference, _("Properties without accessor bodies are not 
supported in compact classes"));
                        return;
                }
 
                if (base_prop.get_attribute ("NoAccessorMethod") == null &&
                        prop.name == "type" && ((cl != null && !cl.is_compact) || (st != null && 
get_ccode_has_type_id (st)))) {
-                       Report.error (prop.source_reference, "Property 'type' not allowed");
+                       Report.error (prop.source_reference, _("Property 'type' not allowed"));
                        return;
                }
                base.visit_property (prop);
diff --git a/codegen/valagvariantmodule.vala b/codegen/valagvariantmodule.vala
index b6d36b6eb..37dbdd4af 100644
--- a/codegen/valagvariantmodule.vala
+++ b/codegen/valagvariantmodule.vala
@@ -520,7 +520,7 @@ public class Vala.GVariantModule : GAsyncModule {
                }
 
                if (result == null) {
-                       Report.error (type.source_reference, "GVariant deserialization of type `%s' is not 
supported".printf (type.to_string ()));
+                       Report.error (type.source_reference, _("GVariant deserialization of type `%s' is not 
supported").printf (type.to_string ()));
                }
 
                return result;
@@ -812,7 +812,7 @@ public class Vala.GVariantModule : GAsyncModule {
                }
 
                if (result == null) {
-                       Report.error (type.source_reference, "GVariant serialization of type `%s' is not 
supported".printf (type.to_string ()));
+                       Report.error (type.source_reference, _("GVariant serialization of type `%s' is not 
supported").printf (type.to_string ()));
                }
 
                return result;



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