From: Rico Tzschichholz Date: Wed, 8 Aug 2018 08:20:51 +0000 (+0200) Subject: codegen: Mark Report.error/warning strings as translatable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=611a6a2fdf57e9b7d1d8cffebfefa6e758c24ecc;p=thirdparty%2Fvala.git codegen: Mark Report.error/warning strings as translatable --- diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala index 07a9a5399..b7ef2dcae 100644 --- a/codegen/valaccodearraymodule.vala +++ b/codegen/valaccodearraymodule.vala @@ -702,7 +702,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 96a47524e..54af05c6d 100644 --- a/codegen/valaccodeassignmentmodule.vala +++ b/codegen/valaccodeassignmentmodule.vala @@ -144,7 +144,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 5615eb618..ab531dd61 100644 --- a/codegen/valaccodeattribute.vala +++ b/codegen/valaccodeattribute.vala @@ -694,7 +694,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; @@ -828,7 +828,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 ""; } } @@ -1071,7 +1071,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 { @@ -1169,7 +1169,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 { @@ -1227,7 +1227,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 { @@ -1285,7 +1285,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 acbb763ce..5a86c4a33 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -549,7 +549,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; } @@ -571,7 +571,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { ret = header_file.store (context.header_filename, null, context.version_header, false, "#ifdef __cplusplus\nextern \"C\" {\n#endif", "#ifdef __cplusplus\n}\n#endif"); } 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)); } } @@ -584,7 +584,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { ret = internal_header_file.store (context.internal_header_filename, null, context.version_header, false, "#ifdef __cplusplus\nextern \"C\" {\n#endif", "#ifdef __cplusplus\n}\n#endif"); } 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)); } } @@ -818,7 +818,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; @@ -1387,7 +1387,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; } } @@ -1639,11 +1639,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; } @@ -1929,7 +1929,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; } @@ -2703,7 +2703,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 ())); } } @@ -2750,7 +2750,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) { @@ -2774,7 +2774,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(); } @@ -3279,7 +3279,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 { @@ -4681,10 +4681,10 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } else if (type_arg is DelegateType) { var delegate_type = (DelegateType) type_arg; if (delegate_type.delegate_symbol.has_target) { - Report.error (type_arg.source_reference, "Delegates with target are not supported as generic type arguments"); + Report.error (type_arg.source_reference, _("Delegates with target are not supported as generic type arguments")); } } else { - Report.error (type_arg.source_reference, "`%s' is not a supported generic type argument, use `?' to box value types".printf (type_arg.to_string ())); + Report.error (type_arg.source_reference, _("`%s' is not a supported generic type argument, use `?' to box value types").printf (type_arg.to_string ())); } } @@ -4830,9 +4830,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)); } @@ -5420,7 +5420,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; } @@ -5922,7 +5922,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")); } } @@ -6018,7 +6018,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)); } } @@ -6089,7 +6089,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); @@ -6189,7 +6189,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; @@ -6630,12 +6630,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 ef2bd1179..b2bb1cb82 100644 --- a/codegen/valaccodedelegatemodule.vala +++ b/codegen/valaccodedelegatemodule.vala @@ -294,7 +294,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_ccode_name (d_params.get (0))); diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala index 5ef5f4eb9..40f593eca 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) { @@ -302,7 +302,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 ())); } } @@ -591,7 +591,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 048cbb790..25e825cfb 100644 --- a/codegen/valaccodestructmodule.vala +++ b/codegen/valaccodestructmodule.vala @@ -159,7 +159,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 5303975ea..608053efb 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; } @@ -960,7 +960,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 01fbef616..7db36b271 100644 --- a/codegen/valagdbusservermodule.vala +++ b/codegen/valagdbusservermodule.vala @@ -1001,7 +1001,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; } @@ -1125,7 +1125,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 4373ec8bb..829f59932 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 b2adc9a6f..66257d32d 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; } @@ -562,7 +562,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; } @@ -584,7 +584,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; } @@ -850,20 +850,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 822519030..e5b8ee38c 100644 --- a/codegen/valagsignalmodule.vala +++ b/codegen/valagsignalmodule.vala @@ -599,7 +599,7 @@ public class Vala.GSignalModule : GObjectModule { if (handler.symbol_reference is Variable) { dt = ((Variable) handler.symbol_reference).variable_type as DelegateType; if (dt != null && !context.experimental) { - Report.warning (handler.source_reference, "Connecting delegates to signals is experimental"); + Report.warning (handler.source_reference, _("Connecting delegates to signals is experimental")); } // Use actual lambda expression if available for proper target/destroy handling if (((Variable) handler.symbol_reference).initializer is LambdaExpression) { 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(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(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 63ae8a153..c3e6b6f24 100644 --- a/codegen/valagtypemodule.vala +++ b/codegen/valagtypemodule.vala @@ -630,7 +630,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; } @@ -2211,7 +2211,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; } @@ -2408,13 +2408,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 061b8f5ab..b79aede52 100644 --- a/codegen/valagvariantmodule.vala +++ b/codegen/valagvariantmodule.vala @@ -521,7 +521,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; @@ -813,7 +813,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;