[vala/wip/gettext: 354/358] codegen: Mark Report.error/warning strings as translatable
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/gettext: 354/358] codegen: Mark Report.error/warning strings as translatable
- Date: Mon, 4 Feb 2019 09:57:12 +0000 (UTC)
commit 477f1a0e11e90af45a549cf06119e1a9211e0d36
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 | 2 +-
codegen/valaccodeassignmentmodule.vala | 2 +-
codegen/valaccodeattribute.vala | 12 ++++-----
codegen/valaccodebasemodule.vala | 42 ++++++++++++++++----------------
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 | 4 +--
codegen/valagtkmodule.vala | 26 ++++++++++----------
codegen/valagtypemodule.vala | 8 +++---
codegen/valagvariantmodule.vala | 4 +--
15 files changed, 71 insertions(+), 71 deletions(-)
---
diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala
index 66cf9f402..02ce41c87 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 d6399e459..eec7c1950 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -689,7 +689,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;
@@ -823,7 +823,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 "";
}
}
@@ -1066,7 +1066,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 {
@@ -1164,7 +1164,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 {
@@ -1222,7 +1222,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 {
@@ -1280,7 +1280,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 1236342f7..b70f85952 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -550,7 +550,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;
}
@@ -572,7 +572,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));
}
}
@@ -585,7 +585,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));
}
}
@@ -824,7 +824,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;
@@ -1391,7 +1391,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;
}
}
@@ -1635,11 +1635,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;
}
@@ -1925,7 +1925,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;
}
@@ -2697,7 +2697,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 ()));
}
}
@@ -2744,7 +2744,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) {
@@ -2768,7 +2768,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();
}
@@ -3273,7 +3273,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 {
@@ -4703,9 +4703,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));
}
@@ -5284,7 +5284,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;
}
@@ -5767,7 +5767,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"));
}
}
@@ -5865,7 +5865,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));
}
}
@@ -5936,7 +5936,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);
@@ -6036,7 +6036,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;
@@ -6477,12 +6477,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 c82364699..5acd4639f 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 f49d93b1a..31ef104a4 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 0baa75233..647412afa 100644
--- a/codegen/valaccodestructmodule.vala
+++ b/codegen/valaccodestructmodule.vala
@@ -164,7 +164,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 8961af672..e374b0507 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 0d5a323a4..b6691b402 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 c01912167..06d7d64e7 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 80f02f849..b6da707a5 100644
--- a/codegen/valagsignalmodule.vala
+++ b/codegen/valagsignalmodule.vala
@@ -598,7 +598,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) {
@@ -627,7 +627,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 af53b8370..6a66d580b 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -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;
}
@@ -2218,7 +2218,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;
}
@@ -2415,13 +2415,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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]