2
* Helper functions to translate statuses and actions to strings
3
* Copyright (C) 2008 Bastien Nocera <hadess@hadess.net>
5
* Experimental code. This will be moved out of fprintd into it's own
6
* package once the system has matured.
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License along
19
* with this program; if not, write to the Free Software Foundation, Inc.,
20
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
const char *dbus_name;
25
const char *place_str;
26
const char *swipe_str;
28
{ "left-thumb", N_("Place your left thumb on %s"), N_("Swipe your left thumb on %s") },
29
{ "left-index-finger", N_("Place your left index finger on %s"), N_("Swipe your left index finger on %s") },
30
{ "left-middle-finger", N_("Place your left middle finger on %s"), N_("Swipe your left middle finger on %s") },
31
{ "left-ring-finger", N_("Place your left ring finger on %s"), N_("Swipe your left ring finger on %s") },
32
{ "left-little-finger", N_("Place your left little finger on %s"), N_("Swipe your left little finger on %s") },
33
{ "right-thumb", N_("Place your right thumb on %s"), N_("Swipe your right thumb on %s") },
34
{ "right-index-finger", N_("Place your right index finger on %s"), N_("Swipe your right index finger on %s") },
35
{ "right-middle-finger", N_("Place your right middle finger on %s"), N_("Swipe your right middle finger on %s") },
36
{ "right-ring-finger", N_("Place your right ring finger on %s"), N_("Swipe your right ring finger on %s") },
37
{ "right-little-finger", N_("Place your right little finger on %s"), N_("Swipe your right little finger on %s") },
41
static const char *finger_str_to_msg(const char *finger_name, gboolean is_swipe)
45
if (finger_name == NULL)
48
for (i = 0; fingers[i].dbus_name != NULL; i++) {
49
if (g_str_equal (fingers[i].dbus_name, finger_name)) {
50
if (is_swipe == FALSE)
51
return fingers[i].place_str;
53
return fingers[i].swipe_str;
63
* verify-unknown-error
65
G_GNUC_UNUSED static const char *verify_result_str_to_msg(const char *result, gboolean is_swipe)
70
if (strcmp (result, "verify-retry-scan") == 0) {
71
if (is_swipe == FALSE)
72
return N_("Place your finger on the reader again");
74
return N_("Swipe your finger again");
76
if (strcmp (result, "verify-swipe-too-short") == 0)
77
return N_("Swipe was too short; try again");
78
if (strcmp (result, "verify-finger-not-centered") == 0)
79
return N_("Your finger was not centered; try swiping your finger again");
80
if (strcmp (result, "verify-remove-and-retry") == 0)
81
return N_("Remove your finger and try swiping it again");
89
* enroll-unknown-error
91
static const char *enroll_result_str_to_msg(const char *result, gboolean is_swipe)
96
if (strcmp (result, "enroll-retry-scan") == 0 || strcmp (result, "enroll-stage-passed") == 0) {
97
if (is_swipe == FALSE)
98
return N_("Place your finger on the reader again");
100
return N_("Swipe your finger again");
102
if (strcmp (result, "enroll-swipe-too-short") == 0)
103
return N_("Swipe was too short, try again");
104
if (strcmp (result, "enroll-finger-not-centered") == 0)
105
return N_("Your finger was not centered, try swiping your finger again");
106
if (strcmp (result, "enroll-remove-and-retry") == 0)
107
return N_("Remove your finger, and try swiping your finger again");