From 8863766ca4792383dad0e48550f8fb79d4c104e4 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 1 Jun 2011 13:21:32 +0100 Subject: Mark GError messages for translations These errors might find their way into a UI. --- json-glib/json-path.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'json-glib/json-path.c') diff --git a/json-glib/json-path.c b/json-glib/json-path.c index 4ed232f..4be1909 100644 --- a/json-glib/json-path.c +++ b/json-glib/json-path.c @@ -372,15 +372,16 @@ json_path_compile (JsonPath *path, { g_set_error_literal (error, JSON_PATH_ERROR, JSON_PATH_ERROR_INVALID_QUERY, - "Multiple roots"); + _("Only one root node is allowed in a JSONPath expression")); return FALSE; } if (!(*(p + 1) == '.' || *(p + 1) == '[')) { + /* translators: the %c is the invalid character */ g_set_error (error, JSON_PATH_ERROR, JSON_PATH_ERROR_INVALID_QUERY, - "Root node followed by '%c'", + _("Root node followed by invalid character '%c'"), *(p + 1)); return FALSE; } @@ -486,7 +487,7 @@ json_path_compile (JsonPath *path, { g_set_error (error, JSON_PATH_ERROR, JSON_PATH_ERROR_INVALID_QUERY, - "Malformed slice '%*s'", + _("Malformed slice expression '%*s'"), end_p - p, p + 1); goto fail; @@ -530,7 +531,7 @@ json_path_compile (JsonPath *path, g_array_unref (indices); g_set_error (error, JSON_PATH_ERROR, JSON_PATH_ERROR_INVALID_QUERY, - "Invalid set definition '%*s'", + _("Invalid set definition '%*s'"), end_p - p, p + 1); goto fail; @@ -583,7 +584,7 @@ json_path_compile (JsonPath *path, { g_set_error (error, JSON_PATH_ERROR, JSON_PATH_ERROR_INVALID_QUERY, - "Invalid slice definition '%*s'", + _("Invalid slice definition '%*s'"), end_p - p, p + 1); goto fail; @@ -611,7 +612,7 @@ json_path_compile (JsonPath *path, { g_set_error (error, JSON_PATH_ERROR, JSON_PATH_ERROR_INVALID_QUERY, - "Invalid array index '%*s'", + _("Invalid array index definition '%*s'"), end_p - p, p + 1); goto fail; -- cgit v1.2.1