[gnome-calculator] GCalc: mark translatable strings
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] GCalc: mark translatable strings
- Date: Mon, 4 Nov 2019 15:09:28 +0000 (UTC)
commit cb0ad0e958172a854608e3eb357018236f00aee7
Author: Daniel Espinosa <esodan gmail com>
Date: Mon Nov 4 09:09:03 2019 -0600
GCalc: mark translatable strings
gcalc/gcalc-function-acos.vala | 6 +++---
gcalc/gcalc-function-acosh.vala | 6 +++---
gcalc/gcalc-function-asin.vala | 6 +++---
gcalc/gcalc-function-asinh.vala | 6 +++---
gcalc/gcalc-function-atan.vala | 6 +++---
gcalc/gcalc-function-atanh.vala | 6 +++---
gcalc/gcalc-function-cos.vala | 6 +++---
gcalc/gcalc-function-cosh.vala | 6 +++---
gcalc/gcalc-function-exp.vala | 6 +++---
gcalc/gcalc-function-log.vala | 6 +++---
gcalc/gcalc-function-sin.vala | 6 +++---
gcalc/gcalc-function-sinh.vala | 6 +++---
gcalc/gcalc-function-sqrt.vala | 6 +++---
gcalc/gcalc-function-tan.vala | 6 +++---
gcalc/gcalc-math-assign.vala | 8 ++++----
gcalc/gcalc-math-function.vala | 2 +-
gcalc/gcalc-math-group.vala | 4 ++--
gcalc/gcalc-math-term.vala | 6 +++---
gcalc/gcalc-math-variable.vala | 8 ++++----
gcalc/gcalc-parser.vala | 20 ++++++++++----------
gcalc/gcalc-solver.vala | 6 +++---
21 files changed, 69 insertions(+), 69 deletions(-)
---
diff --git a/gcalc/gcalc-function-acos.vala b/gcalc/gcalc-function-acos.vala
index 12ed3d7b..c314401d 100644
--- a/gcalc/gcalc-function-acos.vala
+++ b/gcalc/gcalc-function-acos.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionAcos : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-acosh.vala b/gcalc/gcalc-function-acosh.vala
index ebb1a337..49518636 100644
--- a/gcalc/gcalc-function-acosh.vala
+++ b/gcalc/gcalc-function-acosh.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionAcosh : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-asin.vala b/gcalc/gcalc-function-asin.vala
index bcbbefba..cbcce6d1 100644
--- a/gcalc/gcalc-function-asin.vala
+++ b/gcalc/gcalc-function-asin.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionAsin : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-asinh.vala b/gcalc/gcalc-function-asinh.vala
index 334bdf5d..1d3649fe 100644
--- a/gcalc/gcalc-function-asinh.vala
+++ b/gcalc/gcalc-function-asinh.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionAsinh : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-atan.vala b/gcalc/gcalc-function-atan.vala
index 959811f9..7d4e4e8f 100644
--- a/gcalc/gcalc-function-atan.vala
+++ b/gcalc/gcalc-function-atan.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionAtan : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-atanh.vala b/gcalc/gcalc-function-atanh.vala
index e247eb63..d7a36e51 100644
--- a/gcalc/gcalc-function-atanh.vala
+++ b/gcalc/gcalc-function-atanh.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionAtanh : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-cos.vala b/gcalc/gcalc-function-cos.vala
index a0c15f21..74c506f1 100644
--- a/gcalc/gcalc-function-cos.vala
+++ b/gcalc/gcalc-function-cos.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionCos : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-cosh.vala b/gcalc/gcalc-function-cosh.vala
index d3589492..17392336 100644
--- a/gcalc/gcalc-function-cosh.vala
+++ b/gcalc/gcalc-function-cosh.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionCosh : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-exp.vala b/gcalc/gcalc-function-exp.vala
index 3aaae225..e6b13516 100644
--- a/gcalc/gcalc-function-exp.vala
+++ b/gcalc/gcalc-function-exp.vala
@@ -36,17 +36,17 @@ public class GCalc.FunctionExp : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-log.vala b/gcalc/gcalc-function-log.vala
index bf93e7f3..8bc05288 100644
--- a/gcalc/gcalc-function-log.vala
+++ b/gcalc/gcalc-function-log.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionLog : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-sin.vala b/gcalc/gcalc-function-sin.vala
index 35469afd..76ad7499 100644
--- a/gcalc/gcalc-function-sin.vala
+++ b/gcalc/gcalc-function-sin.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionSin : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-sinh.vala b/gcalc/gcalc-function-sinh.vala
index 2cf2e7ed..aa33d298 100644
--- a/gcalc/gcalc-function-sinh.vala
+++ b/gcalc/gcalc-function-sinh.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionSinh : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-sqrt.vala b/gcalc/gcalc-function-sqrt.vala
index c398d70e..4b7ed0a3 100644
--- a/gcalc/gcalc-function-sqrt.vala
+++ b/gcalc/gcalc-function-sqrt.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionSqrt : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-function-tan.vala b/gcalc/gcalc-function-tan.vala
index 5f7a3113..5d13e276 100644
--- a/gcalc/gcalc-function-tan.vala
+++ b/gcalc/gcalc-function-tan.vala
@@ -35,17 +35,17 @@ public class GCalc.FunctionTan : Function {
Constant c = null;
var exp = expressions.get_item (0) as MathExpression;
if (exp == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid parameter type. Expected %s",
typeof(MathExpression).name ());
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid parameter type. Expected %s"),
typeof(MathExpression).name ());
}
var ev = exp.solve ();
if (ev is ErrorResult) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression: %s", ((ErrorResult) ev).message);
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression: %s"), ((ErrorResult) ev).message);
}
if (ev is MathResult) {
c = ((MathResult) ev).expression as Constant;
}
if (c == null) {
- throw new FunctionError.INVOCATION_ERROR ("Invalid expression in result");
+ throw new FunctionError.INVOCATION_ERROR (_("Invalid expression in result"));
}
var p1 = MPC.Complex (1000);
p1.set (c.get_complex ());
diff --git a/gcalc/gcalc-math-assign.vala b/gcalc/gcalc-math-assign.vala
index d5a7f446..a84fa9df 100644
--- a/gcalc/gcalc-math-assign.vala
+++ b/gcalc/gcalc-math-assign.vala
@@ -27,19 +27,19 @@ public interface GCalc.MathAssign : Object, MathExpression, MathOperator, MathBi
*/
public MathExpression evaluate () throws GLib.Error {
if (expressions.get_n_items () != 2) {
- throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid number of expressions in assign");
+ throw new AssigError.INVALID_STRUCTURE_ERROR (_("Invalid number of expressions in assign"));
}
var v = expressions.get_item (0) as MathVariable;
if (v == null) {
- throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid variable object in assign");
+ throw new AssigError.INVALID_STRUCTURE_ERROR (_("Invalid variable object in assign"));
}
var p = expressions.get_item (1) as MathPolynomial;
if (p == null) {
- throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid polynomial object in assign");
+ throw new AssigError.INVALID_STRUCTURE_ERROR (_("Invalid polynomial object in assign"));
}
var ca = p.evaluate () as MathConstant;
if (ca == null) {
- throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid polynomial evaluation in assign; should a
constant no Variable update was done");
+ throw new AssigError.INVALID_STRUCTURE_ERROR (_("Invalid polynomial evaluation in assign; should a
constant no Variable update was done"));
}
v.@value = ca;
return v.@value;
diff --git a/gcalc/gcalc-math-function.vala b/gcalc/gcalc-math-function.vala
index 0363b20f..7e868337 100644
--- a/gcalc/gcalc-math-function.vala
+++ b/gcalc/gcalc-math-function.vala
@@ -53,7 +53,7 @@ public interface GCalc.MathFunction : Object, MathExpression {
*/
public virtual bool verify_params () throws GLib.Error {
if (expressions.get_n_items () != n_params) {
- throw new FunctionError.INVALID_PARAMETERS_ERROR ("Invalid number of parameters. Required %u,
provided: %u",
+ throw new FunctionError.INVALID_PARAMETERS_ERROR (_("Invalid number of parameters. Required %u,
provided: %u"),
n_params, expressions.get_n_items ());
}
return true;
diff --git a/gcalc/gcalc-math-group.vala b/gcalc/gcalc-math-group.vala
index c93cd572..b24fab9e 100644
--- a/gcalc/gcalc-math-group.vala
+++ b/gcalc/gcalc-math-group.vala
@@ -31,11 +31,11 @@ public interface GCalc.MathGroup : Object, MathExpression {
public abstract bool closed { get; set; }
public virtual MathExpression evaluate () throws GLib.Error {
if (expressions.get_n_items () == 0) {
- throw new GroupError.INVALID_POLYNOMIAL ("No internal polynomial in group");
+ throw new GroupError.INVALID_POLYNOMIAL (_("No internal polynomial in group"));
}
var e = expressions.get_item (0) as MathPolynomial;
if (e == null) {
- throw new GroupError.INVALID_POLYNOMIAL ("Invalid internal polynomial in group");
+ throw new GroupError.INVALID_POLYNOMIAL (_("Invalid internal polynomial in group"));
}
return e.evaluate ();
}
diff --git a/gcalc/gcalc-math-term.vala b/gcalc/gcalc-math-term.vala
index 6f14426e..fab1a7dc 100644
--- a/gcalc/gcalc-math-term.vala
+++ b/gcalc/gcalc-math-term.vala
@@ -49,7 +49,7 @@ public interface GCalc.MathTerm : Object, MathExpression {
foreach (MathExpression e in expressions) {
if (e is MathOperator) {
if (!(e is MathMinus || e is MathPlus) && first) {
- throw new TermError.INVALID_OPERATOR ("Incorrect position for operator in expression");
+ throw new TermError.INVALID_OPERATOR (_("Incorrect position for operator in expression"));
}
if (e is MathMinus && first) {
var c = new Constant.@double (-1.0);
@@ -100,7 +100,7 @@ public interface GCalc.MathTerm : Object, MathExpression {
}
}
if (current == null) {
- throw new TermError.EVALUATION_FAIL ("Evaluation fail on Term");
+ throw new TermError.EVALUATION_FAIL (_("Evaluation fail on Term"));
}
return current;
}
@@ -124,7 +124,7 @@ public interface GCalc.MathTerm : Object, MathExpression {
res = c1.pow (c2);
}
if (res == null) {
- throw new TermError.INVALID_OPERATOR ("Unsupported operator in term's expression");
+ throw new TermError.INVALID_OPERATOR (_("Unsupported operator in term's expression"));
}
return res;
}
diff --git a/gcalc/gcalc-math-variable.vala b/gcalc/gcalc-math-variable.vala
index 7143a3b6..3dd35905 100644
--- a/gcalc/gcalc-math-variable.vala
+++ b/gcalc/gcalc-math-variable.vala
@@ -38,18 +38,18 @@ public interface GCalc.MathVariable : Object, MathExpression {
return @value;
}
if (parent == null) {
- throw new VariableError.INVALID_PARENT ("Can't access to MathVariable's expression definition. Invalid
parent. Expected Assign operator");
+ throw new VariableError.INVALID_PARENT (_("Can't access to MathVariable's expression definition.
Invalid parent. Expected Assign operator"));
}
if (parent.expressions.get_n_items () != 2) {
- throw new VariableError.INVALID_EXPRESSION_DEFINITION ("Can't access to MathVariable's expression
definition. Expression not found");
+ throw new VariableError.INVALID_EXPRESSION_DEFINITION (_("Can't access to MathVariable's expression
definition. Expression not found"));
}
var e = parent.expressions.get_item (1) as MathPolynomial;
if (e == null) {
- throw new VariableError.INVALID_EXPRESSION_DEFINITION ("Can't access to MathVariable's expression
definition. Unexpected object type");
+ throw new VariableError.INVALID_EXPRESSION_DEFINITION (_("Can't access to MathVariable's expression
definition. Unexpected object type"));
}
var exp = e.evaluate () as MathConstant;
if (exp == null) {
- throw new VariableError.EVALUATION_FAIL ("MathVariable evaluation fail. MathVariable's value not
updated");
+ throw new VariableError.EVALUATION_FAIL (_("MathVariable evaluation fail. MathVariable's value not
updated"));
}
@value = exp;
return exp;
diff --git a/gcalc/gcalc-parser.vala b/gcalc/gcalc-parser.vala
index 7ba75262..82bff0ce 100644
--- a/gcalc/gcalc-parser.vala
+++ b/gcalc/gcalc-parser.vala
@@ -109,7 +109,7 @@ public class GCalc.Parser : Object {
} else if (n.down () == "def" && current == null) {
// FIXME: implement function definition
} else if (n.down () == "def" && current is MathFunction) {
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected function definition
expression");
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected function definition
expression"));
} else {
var v = new Variable (n) as MathExpression;
if (enable_parameter) {
@@ -155,7 +155,7 @@ public class GCalc.Parser : Object {
case TokenType.REAL_LITERAL:
double res = 0;
if (!double.try_parse (n, out res)) {
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for a constant");
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected expression for a constant"));
}
var cexp = new Constant.@double (double.parse (n));
add_constant (cexp);
@@ -178,9 +178,9 @@ public class GCalc.Parser : Object {
break;
case TokenType.ASSIGN:
if (current == null) {
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for an assignment");
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected expression for an
assignment"));
} else if (current is MathPolynomial) {
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression: can't set a value to
a polynomial");
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected expression: can't set a value
to a polynomial"));
} else if (current is MathVariable) {
bool removed = false;
if (current.parent != null) {
@@ -201,7 +201,7 @@ public class GCalc.Parser : Object {
}
}
if (!removed) {
- throw new ParserError.INVALID_EXPRESSION_ERROR ("Found an unexpected expression for an
assignment. Assignment should be done on variables");
+ throw new ParserError.INVALID_EXPRESSION_ERROR (_("Found an unexpected expression for an
assignment. Assignment should be done on variables"));
}
var expa = new Assign ();
eq.expressions.add (expa);
@@ -254,7 +254,7 @@ public class GCalc.Parser : Object {
break;
case TokenType.CLOSE_PARENS:
if (current == null) {
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression while closing
parenthesis");
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected expression while closing
parenthesis"));
}
bool foundp = false;
var par = current;
@@ -284,7 +284,7 @@ public class GCalc.Parser : Object {
case TokenType.CARRET:
var op = new Pow ();
if (current == null) {
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression trying power
expression");
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected expression trying power
expression"));
} else {
process_term_operator (op, eq);
}
@@ -321,7 +321,7 @@ public class GCalc.Parser : Object {
case TokenType.INTERR:
// Hash
case TokenType.HASH:
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression: '%s'", token.to_string
());
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected expression: '%s'"),
token.to_string ());
case TokenType.CURRENCY_SYMBOL:
enable_parameter = true;
break;
@@ -331,7 +331,7 @@ public class GCalc.Parser : Object {
}
private void process_operator (MathOperator opp, Equation eq) throws GLib.Error {
if (current is MathBinaryOperator) {
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for a plus operator");
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected expression for a plus operator"));
}
if (current == null) {
var exp = new Polynomial ();
@@ -385,7 +385,7 @@ public class GCalc.Parser : Object {
}
private void process_term_operator (MathOperator op, Equation eq) throws GLib.Error {
if (current is MathOperator) {
- throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for a multiply operator");
+ throw new ParserError.INVALID_TOKEN_ERROR (_("Found an unexpected expression for a multiply
operator"));
}
if ((current is MathConstant || current is MathVariable || current is MathGroup || current is
MathFunction)
&& current_parent is MathTerm && top_parent is MathPolynomial) {
diff --git a/gcalc/gcalc-solver.vala b/gcalc/gcalc-solver.vala
index 51f70aeb..25bb0db2 100644
--- a/gcalc/gcalc-solver.vala
+++ b/gcalc/gcalc-solver.vala
@@ -60,15 +60,15 @@ public class GCalc.Solver : Object {
try {
p.parse (str, equation_manager);
if (equation_manager.equations.get_n_items () == 0) {
- return new ErrorResult ("No equations found after parsing");
+ return new ErrorResult (_("No equations found after parsing"));
}
var eq = equation_manager.equations.get_item (0) as MathEquation;
if (eq == null) {
- return new ErrorResult ("No equations found after parsing");
+ return new ErrorResult (_("No equations found after parsing"));
}
res = eq.solve ();
} catch (GLib.Error e) {
- res = new ErrorResult ("Solving fails: %s".printf (e.message));
+ res = new ErrorResult (_("Solving fails: %s").printf (e.message));
}
return res;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]