From 96ebf5bc3fb455162286b9bc31e763f3c4f1c457 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 8 Aug 2018 18:24:49 -0700 Subject: Two fixes and translate more strings. * Fix finding translations with escaped characters. * Add back \r to translations since its needed by screen. --- py/objfloat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'py/objfloat.c') diff --git a/py/objfloat.c b/py/objfloat.c index 16aa9bc20..c3f47018c 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -32,6 +32,8 @@ #include "py/parsenum.h" #include "py/runtime.h" +#include "supervisor/shared/translate.h" + #if MICROPY_PY_BUILTINS_FLOAT #include @@ -265,7 +267,7 @@ mp_obj_t mp_obj_float_binary_op(mp_binary_op_t op, mp_float_t lhs_val, mp_obj_t case MP_BINARY_OP_INPLACE_FLOOR_DIVIDE: if (rhs_val == 0) { zero_division_error: - mp_raise_msg(&mp_type_ZeroDivisionError, "division by zero"); + mp_raise_msg(&mp_type_ZeroDivisionError, translate("division by zero")); } // Python specs require that x == (x//y)*y + (x%y) so we must // call divmod to compute the correct floor division, which @@ -303,7 +305,7 @@ mp_obj_t mp_obj_float_binary_op(mp_binary_op_t op, mp_float_t lhs_val, mp_obj_t #if MICROPY_PY_BUILTINS_COMPLEX return mp_obj_complex_binary_op(MP_BINARY_OP_POWER, lhs_val, 0, rhs_in); #else - mp_raise_ValueError("complex values not supported"); + mp_raise_ValueError(translate("complex values not supported")); #endif } lhs_val = MICROPY_FLOAT_C_FUN(pow)(lhs_val, rhs_val); -- cgit v1.2.3